Enable very basic tracing support.

Change-Id: I524a857390e0bbc49273989caf56f03b51de65cf
diff --git a/rsContext.h b/rsContext.h
index abc9b27..4162b64 100644
--- a/rsContext.h
+++ b/rsContext.h
@@ -26,6 +26,11 @@
 #include "rsScriptGroup.h"
 #include "rsSampler.h"
 
+#ifndef RS_SERVER
+#define ATRACE_TAG ATRACE_TAG_RS
+#include "utils/Trace.h"
+#endif
+
 #ifndef RS_COMPATIBILITY_LIB
 #include "rsFont.h"
 #include "rsPath.h"
@@ -34,6 +39,7 @@
 #include "rsProgramRaster.h"
 #include "rsProgramVertex.h"
 #include "rsFBOCache.h"
+
 #endif
 
 
@@ -62,6 +68,8 @@
 #define CHECK_OBJ_OR_NULL(o)
 #endif
 
+
+
 class Context {
 public:
     struct Hal {
diff --git a/rsCppUtils.h b/rsCppUtils.h
index abae7d8..f16325f 100644
--- a/rsCppUtils.h
+++ b/rsCppUtils.h
@@ -34,6 +34,9 @@
 
 #ifdef RS_SERVER
 
+#define ATRACE_TAG
+#define ATRACE_CALL(...)
+
 #include <string>
 #include <vector>
 #include <algorithm>
diff --git a/rsScriptC.cpp b/rsScriptC.cpp
index 56c9f06..3d9cd11 100644
--- a/rsScriptC.cpp
+++ b/rsScriptC.cpp
@@ -168,6 +168,8 @@
                          size_t usrBytes,
                          const RsScriptCall *sc) {
 
+    ATRACE_CALL();
+
     Context::PushState ps(rsc);
 
     setupGLState(rsc);
@@ -176,6 +178,8 @@
 }
 
 void ScriptC::Invoke(Context *rsc, uint32_t slot, const void *data, size_t len) {
+    ATRACE_CALL();
+
     if (slot >= mHal.info.exportedFunctionCount) {
         rsc->setError(RS_ERROR_BAD_SCRIPT, "Calling invoke on bad script");
         return;
@@ -230,7 +234,7 @@
                           const char *cacheDir,
                           const uint8_t *bitcode,
                           size_t bitcodeLen) {
-
+    ATRACE_CALL();
     //ALOGE("runCompiler %p %p %p %p %p %i", rsc, this, resName, cacheDir, bitcode, bitcodeLen);
 #ifndef RS_COMPATIBILITY_LIB
 #ifndef ANDROID_RS_SERIALIZE