diff options
author | John Reck <jreck@google.com> | 2018-12-05 18:16:39 -0800 |
---|---|---|
committer | John Reck <jreck@google.com> | 2018-12-05 18:16:39 -0800 |
commit | 77b31a5eb1674f6c01e8f0e20fa6ecee45ff73d9 (patch) | |
tree | 202f481d102d097fe06d0c08118f18e6f87a3d17 /native | |
parent | f660c012b080496eb70ea77f141f346e80bb6cfa (diff) |
Add NDK async begin/end & counter
Bug: 111503982
Test: atest CtsAtraceHostTestCases
Change-Id: I038b76b505d3103f7b1e85a9469932d23cde2ab8
Diffstat (limited to 'native')
-rw-r--r-- | native/android/libandroid.map.txt | 3 | ||||
-rw-r--r-- | native/android/trace.cpp | 12 |
2 files changed, 15 insertions, 0 deletions
diff --git a/native/android/libandroid.map.txt b/native/android/libandroid.map.txt index 207508e18a8b..96113d68c9b8 100644 --- a/native/android/libandroid.map.txt +++ b/native/android/libandroid.map.txt @@ -229,6 +229,9 @@ LIBANDROID { ATrace_beginSection; # introduced=23 ATrace_endSection; # introduced=23 ATrace_isEnabled; # introduced=23 + ATrace_beginAsyncSection; # introduced=29 + ATrace_endAsyncSection; # introduced=29 + ATrace_setCounter; # introduced=29 android_getaddrinfofornetwork; # introduced=23 android_setprocnetwork; # introduced=23 android_setsocknetwork; # introduced=23 diff --git a/native/android/trace.cpp b/native/android/trace.cpp index db522204f96f..9ff5b8a31bb1 100644 --- a/native/android/trace.cpp +++ b/native/android/trace.cpp @@ -28,3 +28,15 @@ void ATrace_beginSection(const char* sectionName) { void ATrace_endSection() { atrace_end(ATRACE_TAG_APP); } + +void ATrace_beginAsyncSection(const char* sectionName, int32_t cookie) { + atrace_async_begin(ATRACE_TAG_APP, sectionName, cookie); +} + +void ATrace_endAsyncSection(const char* sectionName, int32_t cookie) { + atrace_async_end(ATRACE_TAG_APP, sectionName, cookie); +} + +void ATrace_setCounter(const char* counterName, int64_t counterValue) { + atrace_int64(ATRACE_TAG_APP, counterName, counterValue); +}
\ No newline at end of file |