diff options
author | Yabin Cui <yabinc@google.com> | 2016-06-15 12:10:33 -0700 |
---|---|---|
committer | Yabin Cui <yabinc@google.com> | 2016-06-15 14:49:19 -0700 |
commit | c10a9dce1f1faa292317c815205d821fd1f859be (patch) | |
tree | c73aa746f3024bb5121af0b6127eb04227bac686 /simpleperf/event_attr.h | |
parent | 42ca0e1992695f08d5110d0dd258adc67941f01b (diff) | |
download | extras-c10a9dce1f1faa292317c815205d821fd1f859be.tar.gz |
simpleperf: add type modifier when reporting events.
Before the change:
$simpleperf record -e cpu-cycles:u sleep 1
$simpleperf report
...
Event: cpu-cycles (type 0, config 0)
...
After the change:
$simpleperf report
...
Event: cpu-cycles:u (type 0, config 0)
...
Change-Id: I296c5476e03250e928ed0f579483d6866576d417
Diffstat (limited to 'simpleperf/event_attr.h')
-rw-r--r-- | simpleperf/event_attr.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/simpleperf/event_attr.h b/simpleperf/event_attr.h index df97c2fe..030f7c9f 100644 --- a/simpleperf/event_attr.h +++ b/simpleperf/event_attr.h @@ -19,6 +19,7 @@ #include <stddef.h> +#include <string> #include <vector> #include "perf_event.h" @@ -31,5 +32,7 @@ bool GetCommonEventIdPositionsForAttrs(std::vector<perf_event_attr>& attrs, size_t* event_id_pos_in_sample_records, size_t* event_id_reverse_pos_in_non_sample_records); bool IsTimestampSupported(const perf_event_attr& attr); +// Return event name with modifier if the event is found, otherwise return "unknown". +std::string GetEventNameByAttr(const perf_event_attr& attr); #endif // SIMPLE_PERF_EVENT_ATTR_H_ |