summaryrefslogtreecommitdiff
path: root/simpleperf/event_type.h
diff options
context:
space:
mode:
authorYabin Cui <yabinc@google.com>2015-04-30 09:43:26 -0700
committerYabin Cui <yabinc@google.com>2015-05-15 17:14:00 -0700
commitf569b478e74560a2d9e29a96824e16b93a55b97f (patch)
treee6e0c0f44b749002050626cc29fb63cc2e485468 /simpleperf/event_type.h
parent36a3d0edf07d74f9036ac1cad5a917d74e2a86ce (diff)
downloadextras-f569b478e74560a2d9e29a96824e16b93a55b97f.tar.gz
Support tracepoint event types in simpleperf.
Also support options in `simpleperf list`, add test about tracepoint event types. Bug: 19483574 Change-Id: I2d2c2f300fe5e2968696228899084410aa9f29a4
Diffstat (limited to 'simpleperf/event_type.h')
-rw-r--r--simpleperf/event_type.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/simpleperf/event_type.h b/simpleperf/event_type.h
index b486a294..341d2c4f 100644
--- a/simpleperf/event_type.h
+++ b/simpleperf/event_type.h
@@ -27,16 +27,23 @@
// the event type is supported by the kernel.
struct EventType {
+ EventType(const std::string& name, uint32_t type, uint64_t config)
+ : name(name), type(type), config(config) {
+ }
+
+ EventType() : type(0), config(0) {
+ }
+
bool IsSupportedByKernel() const;
- const char* name;
+ std::string name;
uint32_t type;
uint64_t config;
};
class EventTypeFactory {
public:
- static const std::vector<const EventType>& GetAllEventTypes();
+ static const std::vector<EventType>& GetAllEventTypes();
static const EventType* FindEventTypeByName(const std::string& name,
bool report_unsupported_type = true);
static const EventType* FindEventTypeByConfig(uint32_t type, uint64_t config);