summaryrefslogtreecommitdiff
path: root/simpleperf/event_attr.h
diff options
context:
space:
mode:
authorYabin Cui <yabinc@google.com>2016-04-01 20:22:35 -0700
committerYabin Cui <yabinc@google.com>2016-04-05 16:52:47 -0700
commit2d6efe4b167da4e6b77f168b1820239ee65599e2 (patch)
tree631aced5c7cb30b3c93345c55e67fe329fdf1d1a /simpleperf/event_attr.h
parent96e12e78722988e912664b7323341799fdd12b9b (diff)
downloadextras-2d6efe4b167da4e6b77f168b1820239ee65599e2.tar.gz
simpleperf: support reporting more than one event type.
When sampling kernel trace points, it is like to sample more than one even type. Like `simpleperf record -e kmem:mm_page_alloc,kmem:mm_page_free`. 1. change record command to dump event_id for all records. 2. change report command and record reader to support multiple event attrs. 3. hide record_cache inside EventSelectionSet. 4. add test to report multiple event types. Bug: 27403614 Change-Id: Ic22a5527d68e7a843e3cf95e85381f8ad6bcb196
Diffstat (limited to 'simpleperf/event_attr.h')
-rw-r--r--simpleperf/event_attr.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/simpleperf/event_attr.h b/simpleperf/event_attr.h
index 79d3df45..df97c2fe 100644
--- a/simpleperf/event_attr.h
+++ b/simpleperf/event_attr.h
@@ -19,11 +19,17 @@
#include <stddef.h>
+#include <vector>
+
#include "perf_event.h"
struct EventType;
perf_event_attr CreateDefaultPerfEventAttr(const EventType& event_type);
void DumpPerfEventAttr(const perf_event_attr& attr, size_t indent = 0);
+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);
#endif // SIMPLE_PERF_EVENT_ATTR_H_