diff options
author | TreeHugger Robot <treehugger-gerrit@google.com> | 2017-04-19 20:39:42 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2017-04-19 20:39:43 +0000 |
commit | adc46414b68614c95c3cfbfd0a9de38bfa27c2be (patch) | |
tree | e6c960119b6281a577c925424fd7dace63d3b157 /cpu_ref | |
parent | 97222cef8fcc48378e5de96af51e0fc15ca0ae24 (diff) | |
parent | b4b603d8c1c5574a7a76c7f74d03b996f0902e9a (diff) | |
download | rs-adc46414b68614c95c3cfbfd0a9de38bfa27c2be.tar.gz |
Merge "[debugger] make the ScriptGroup inspection point weak" into oc-dev
Diffstat (limited to 'cpu_ref')
-rw-r--r-- | cpu_ref/rsCpuScriptGroup2.cpp | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/cpu_ref/rsCpuScriptGroup2.cpp b/cpu_ref/rsCpuScriptGroup2.cpp index e42efe18..11393ff4 100644 --- a/cpu_ref/rsCpuScriptGroup2.cpp +++ b/cpu_ref/rsCpuScriptGroup2.cpp @@ -330,7 +330,22 @@ void generateSourceSlot(RsdCpuReferenceImpl* ctxt, } // anonymous namespace -extern __attribute__((noinline)) +// This function is used by the debugger to inspect ScriptGroup +// compilations. +// +// "__attribute__((noinline))" and "__asm__" are used to prevent the +// function call from being eliminated as a no-op (see the "noinline" +// attribute in gcc documentation). +// +// "__attribute__((weak))" is used to prevent callers from recognizing +// that this is guaranteed to be the function definition, recognizing +// that certain arguments are unused, and optimizing away the passing +// of those arguments (see the LLVM optimization +// DeadArgumentElimination). Theoretically, the compiler could get +// aggressive enough with link-time optimization that even marking the +// entry point as a weak definition wouldn't solve the problem. +// +extern __attribute__((noinline)) __attribute__((weak)) void debugHintScriptGroup2(const char* groupName, const uint32_t groupNameSize, const ExpandFuncTy* kernel, @@ -338,6 +353,7 @@ void debugHintScriptGroup2(const char* groupName, ALOGV("group name: %d:%s\n", groupNameSize, groupName); for (uint32_t i=0; i < kernelCount; ++i) { const char* f1 = (const char*)(kernel[i]); + __asm__ __volatile__(""); ALOGV(" closure: %p\n", (const void*)f1); } // do nothing, this is just a hook point for the debugger. |