diff options
author | Yabin Cui <yabinc@google.com> | 2018-07-17 16:06:21 -0700 |
---|---|---|
committer | Yabin Cui <yabinc@google.com> | 2018-07-17 17:49:45 -0700 |
commit | 38335f4c3a6f14ee1f30e896757537e7d310c25c (patch) | |
tree | 09850e2f307522402033fe7cd5a771096507d6b7 /simpleperf/record.h | |
parent | 57bb921048889b011480317b6153a5f68935ba0f (diff) | |
download | extras-38335f4c3a6f14ee1f30e896757537e7d310c25c.tar.gz |
simpleperf: record complete process name.
The kernel limits length of process name to 15. But many app processes
have name with length longer than 15. This patch records complete
process name: When receiving a comm record for a process, try reading
complete name from /proc/pid/cmdline and storing the name in the comm
record.
Bug: none
Test: run simpleperf manually, it shows complete app name in reports.
Test: run simpleperf_unit_test.
Change-Id: Id29f2a2522ef5d2949828450be2d9d2f508a328d
Diffstat (limited to 'simpleperf/record.h')
-rw-r--r-- | simpleperf/record.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/simpleperf/record.h b/simpleperf/record.h index e002370c..3ba73ec0 100644 --- a/simpleperf/record.h +++ b/simpleperf/record.h @@ -327,6 +327,8 @@ struct CommRecord : public Record { CommRecord(const perf_event_attr& attr, uint32_t pid, uint32_t tid, const std::string& comm, uint64_t event_id, uint64_t time); + void SetCommandName(const std::string& name); + protected: void DumpData(size_t indent) const override; }; |