summaryrefslogtreecommitdiff
path: root/simpleperf/event_type.h
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2022-08-31 23:30:01 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2022-08-31 23:30:01 +0000
commite4df6724d440458f7c3ed6f4e709b42a492a52a8 (patch)
tree7423d08ebb843064b0a468d3007a7e6f56287aa2 /simpleperf/event_type.h
parent48f188ddea5c4925121a34655187585dcdb04794 (diff)
parente275d1e943acdaeaaa644dc7cb1db5c4cf73f4e8 (diff)
downloadextras-e4df6724d440458f7c3ed6f4e709b42a492a52a8.tar.gz
Change-Id: I17038ae8868dee099c35012fea1ac753422720e3
Diffstat (limited to 'simpleperf/event_type.h')
-rw-r--r--simpleperf/event_type.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/simpleperf/event_type.h b/simpleperf/event_type.h
index d2cd0c15..14863caa 100644
--- a/simpleperf/event_type.h
+++ b/simpleperf/event_type.h
@@ -24,6 +24,8 @@
#include <string>
#include <vector>
+#include "perf_event.h"
+
namespace simpleperf {
inline const std::string kETMEventName = "cs-etm";
@@ -50,6 +52,9 @@ struct EventType {
bool IsPmuEvent() const { return name.find('/') != std::string::npos; }
bool IsEtmEvent() const { return name == kETMEventName; }
+ bool IsHardwareEvent() const {
+ return type == PERF_TYPE_HARDWARE || type == PERF_TYPE_HW_CACHE || type == PERF_TYPE_RAW;
+ }
std::vector<int> GetPmuCpumask();