diff options
author | Android (Google) Code Review <android-gerrit@google.com> | 2009-05-20 09:21:20 -0700 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2009-05-20 09:21:20 -0700 |
commit | faba7ee37b15cd01594c6cd7ab2ff54651da3593 (patch) | |
tree | df8b994d26e36ee113b7c35e222f071636d0921f /emulator/qtools/read_method.cpp | |
parent | 4d0c73f186563e16df2fa39655a7ca3019fe5653 (diff) | |
parent | 928eec90cf2362db71b8e4aa3c7e86ba576962b1 (diff) | |
download | sdk-faba7ee37b15cd01594c6cd7ab2ff54651da3593.zip sdk-faba7ee37b15cd01594c6cd7ab2ff54651da3593.tar.gz sdk-faba7ee37b15cd01594c6cd7ab2ff54651da3593.tar.bz2 |
am b260872e: Merge change 2024 into donut
Merge commit 'b260872ea4ab52286e1abfa4e79d12feb3d46253'
* commit 'b260872ea4ab52286e1abfa4e79d12feb3d46253':
Add support for native (JNI) calls to the trace tools.
Diffstat (limited to 'emulator/qtools/read_method.cpp')
-rw-r--r-- | emulator/qtools/read_method.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/emulator/qtools/read_method.cpp b/emulator/qtools/read_method.cpp index 48be25a..6aa0c1a 100644 --- a/emulator/qtools/read_method.cpp +++ b/emulator/qtools/read_method.cpp @@ -13,11 +13,13 @@ struct frame { uint64_t time; uint32_t addr; const char *name; + bool isNative; - frame(uint64_t time, uint32_t addr, const char *name) { + frame(uint64_t time, uint32_t addr, const char *name, bool isNative) { this->time = time; this->addr = addr; this->name = name; + this->isNative = isNative; } }; @@ -57,8 +59,9 @@ void Stack::dump() { for (int ii = 0; ii < top; ii++) { pframe = frames[ii]; - printf(" %d: %llu 0x%x %s\n", - ii, pframe->time, pframe->addr, + const char *native = pframe->isNative ? "n" : " "; + printf(" %s %d: %llu 0x%x %s\n", + native, ii, pframe->time, pframe->addr, pframe->name == NULL ? "" : pframe->name); } } @@ -118,9 +121,11 @@ int main(int argc, char **argv) { stacks[proc->pid] = pStack; } - if (method_record.flags == 0) { + int flags = method_record.flags; + if (flags == kMethodEnter || flags == kNativeEnter) { pframe = new frame(method_record.time, method_record.addr, - sym == NULL ? NULL: sym->name); + sym == NULL ? NULL: sym->name, + method_record.flags == kNativeEnter); pStack->push(pframe); } else { pframe = pStack->pop(); |