Fix crash in tracing code.

Bug: http://b/29358536

When we switched to standalone bcc, we accidentally removed the setters
for this name field. It is simplest to just use the slot number for
fixing this today, and revisit how to populate a proper name later on,
since it would technically require vendor driver updates.

(cherry picked from commit d969fdc55bc82d48242be3c6193a6548137e9579)

Change-Id: I38a67a10d960d8fd2dddd03dc5155e3781f390d8
diff --git a/rsScriptC.cpp b/rsScriptC.cpp
index c0f858a..45c01b2 100644
--- a/rsScriptC.cpp
+++ b/rsScriptC.cpp
@@ -29,6 +29,7 @@
 
 #include <sys/stat.h>
 
+#include <sstream>
 #include <string>
 
 #ifdef USE_MINGW
@@ -201,15 +202,12 @@
     // Trace this function call.
     // To avoid overhead we only build the string if tracing is actually
     // enabled.
-    String8 *AString = NULL;
-    const char *String = "";
+    std::stringstream ss;
     if (ATRACE_ENABLED()) {
-        AString = new String8("runForEach_");
-        AString->append(mHal.info.exportedForeachFuncList[slot].first);
-        String = AString->string();
+        ss << "runForEach slot[" << slot << "]";
     }
-    ATRACE_NAME(String);
-    (void)String;
+    ATRACE_NAME(ss.str().c_str());
+
     if (mRSC->hadFatalError()) return;
 
     Context::PushState ps(rsc);
@@ -233,10 +231,6 @@
         rsc->setError(RS_ERROR_FATAL_DRIVER,
                       "Driver support for multi-input not present");
     }
-
-    if (AString) {
-        delete AString;
-    }
 }
 
 void ScriptC::runReduce(Context *rsc, uint32_t slot,