summaryrefslogtreecommitdiff
path: root/simpleperf/event_type.h
diff options
context:
space:
mode:
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();