diff options
author | Yabin Cui <yabinc@google.com> | 2023-04-06 11:37:08 -0700 |
---|---|---|
committer | Yabin Cui <yabinc@google.com> | 2023-04-06 11:42:16 -0700 |
commit | cc006815ca73539bd3c4ca984c2c6602622cd6cd (patch) | |
tree | b8a70020cc376179e2bfc3c11a250b4aa2e962a7 | |
parent | 79f3a53607aff0ff5b28b2eb85a674330ee35f24 (diff) | |
download | extras-cc006815ca73539bd3c4ca984c2c6602622cd6cd.tar.gz |
simpleperf: inject cmd: add build id in AutoFDO output.
It is to allow searching debug binaries by build id.
Bug: none
Test: run simpleperf_unit_test
Change-Id: I52b5ef8bbc4055d8c166b80766f2a500290ba1ff
-rw-r--r-- | simpleperf/cmd_inject.cpp | 1 | ||||
-rw-r--r-- | simpleperf/testdata/etm/perf_inject.data | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/simpleperf/cmd_inject.cpp b/simpleperf/cmd_inject.cpp index 43cfc728..e00f4826 100644 --- a/simpleperf/cmd_inject.cpp +++ b/simpleperf/cmd_inject.cpp @@ -618,6 +618,7 @@ class AutoFDOWriter { } // Write the binary path in comment. + fprintf(output_fp.get(), "// build_id: %s\n", key.build_id.ToString().c_str()); fprintf(output_fp.get(), "// %s\n\n", key.path.c_str()); } return true; diff --git a/simpleperf/testdata/etm/perf_inject.data b/simpleperf/testdata/etm/perf_inject.data index 4c121a32..9f83430b 100644 --- a/simpleperf/testdata/etm/perf_inject.data +++ b/simpleperf/testdata/etm/perf_inject.data @@ -20,5 +20,6 @@ 10a0->1054:1 10b0->0:1 10ec->0:1 +// build_id: 0x0c9a20bf9c009d0e4e8bbf9fad0300ae00000000 // /data/local/tmp/etm_test_loop |