summaryrefslogtreecommitdiff
path: root/simpleperf/record.h
diff options
context:
space:
mode:
authorYabin Cui <yabinc@google.com>2015-05-05 19:58:07 -0700
committerYabin Cui <yabinc@google.com>2015-05-13 16:16:56 -0700
commit8f6225147c5b6cb2159a7f5cb0dab952ee0759df (patch)
treebfc1ba2394275e2ea87cf2d4ceae09d5323d5a23 /simpleperf/record.h
parent884fc856c79eddf8ac68fd54d75d804116f577e5 (diff)
downloadextras-8f6225147c5b6cb2159a7f5cb0dab952ee0759df.tar.gz
Dump build_id feature in `simpleperf record`.
Bug: 19483574 Change-Id: Ie2acd8a157bca9ad3c01a2e4b37e139aba89670f
Diffstat (limited to 'simpleperf/record.h')
-rw-r--r--simpleperf/record.h31
1 files changed, 29 insertions, 2 deletions
diff --git a/simpleperf/record.h b/simpleperf/record.h
index 4d62784c..83f60db9 100644
--- a/simpleperf/record.h
+++ b/simpleperf/record.h
@@ -20,6 +20,7 @@
#include <string>
#include <vector>
+#include "build_id.h"
#include "perf_event.h"
struct KernelMmap;
@@ -129,8 +130,10 @@ struct MmapRecord : public Record {
}
MmapRecord(const perf_event_attr& attr, const perf_event_header* pheader);
- void DumpData(size_t indent) const override;
std::vector<char> BinaryFormat() const;
+
+ protected:
+ void DumpData(size_t indent) const override;
};
struct CommRecord : public Record {
@@ -143,8 +146,10 @@ struct CommRecord : public Record {
}
CommRecord(const perf_event_attr& attr, const perf_event_header* pheader);
- void DumpData(size_t indent) const override;
std::vector<char> BinaryFormat() const;
+
+ protected:
+ void DumpData(size_t indent) const override;
};
struct ExitRecord : public Record {
@@ -155,6 +160,8 @@ struct ExitRecord : public Record {
} data;
ExitRecord(const perf_event_attr& attr, const perf_event_header* pheader);
+
+ protected:
void DumpData(size_t indent) const override;
};
@@ -171,6 +178,24 @@ struct SampleRecord : public Record {
PerfSamplePeriodType period_data; // Valid if PERF_SAMPLE_PERIOD.
SampleRecord(const perf_event_attr& attr, const perf_event_header* pheader);
+
+ protected:
+ void DumpData(size_t indent) const override;
+};
+
+// BuildIdRecord is defined in user-space, stored in BuildId feature section in record file.
+struct BuildIdRecord : public Record {
+ uint32_t pid;
+ BuildId build_id;
+ std::string filename;
+
+ BuildIdRecord() {
+ }
+
+ BuildIdRecord(const perf_event_header* pheader);
+ std::vector<char> BinaryFormat() const;
+
+ protected:
void DumpData(size_t indent) const override;
};
@@ -181,4 +206,6 @@ MmapRecord CreateMmapRecord(const perf_event_attr& attr, bool in_kernel, uint32_
const std::string& filename);
CommRecord CreateCommRecord(const perf_event_attr& attr, uint32_t pid, uint32_t tid,
const std::string& comm);
+BuildIdRecord CreateBuildIdRecord(bool in_kernel, pid_t pid, const BuildId& build_id,
+ const std::string& filename);
#endif // SIMPLE_PERF_RECORD_H_