summaryrefslogtreecommitdiff
path: root/simpleperf/record.h
diff options
context:
space:
mode:
authorYabin Cui <yabinc@google.com>2015-06-02 17:54:52 -0700
committerYabin Cui <yabinc@google.com>2015-06-03 17:00:29 -0700
commitddddc06d1f1d15d49e1eb43201b73beb29cf4cde (patch)
tree6a56bd02c759141a246ae81ca67576a45e357793 /simpleperf/record.h
parent34bce194a474083a3e156de8ffb0daf4fd27e005 (diff)
downloadextras-ddddc06d1f1d15d49e1eb43201b73beb29cf4cde.tar.gz
Simpleperf: support branch stack sampling in `simpleperf record`.
This only adds support in simpleperf. Branch stack sampling still lacks kernel support on arm devices. Use perf_event.h of bionic in host build, because the perf_event.h of platform glibc is too old. Bug: 19483574 Change-Id: I9c7332c054e93e7433717dd293d3f366b1802e2d
Diffstat (limited to 'simpleperf/record.h')
-rw-r--r--simpleperf/record.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/simpleperf/record.h b/simpleperf/record.h
index 83f60db9..bbcd7d01 100644
--- a/simpleperf/record.h
+++ b/simpleperf/record.h
@@ -68,6 +68,15 @@ struct PerfSamplePeriodType {
uint64_t period;
};
+struct PerfSampleBranchStackType {
+ struct BranchStackItemType {
+ uint64_t from;
+ uint64_t to;
+ uint64_t flags;
+ };
+ std::vector<BranchStackItemType> stack;
+};
+
// SampleId is optional at the end of a record in binary format. Its content is determined by
// sample_id_all and sample_type in perf_event_attr. To avoid the complexity of referring to
// perf_event_attr each time, we copy sample_id_all and sample_type inside the SampleId structure.
@@ -177,6 +186,8 @@ struct SampleRecord : public Record {
PerfSampleCpuType cpu_data; // Valid if PERF_SAMPLE_CPU.
PerfSamplePeriodType period_data; // Valid if PERF_SAMPLE_PERIOD.
+ PerfSampleBranchStackType branch_stack_data; // Valid if PERF_SAMPLE_BRANCH_STACK.
+
SampleRecord(const perf_event_attr& attr, const perf_event_header* pheader);
protected: