summaryrefslogtreecommitdiff
path: root/simpleperf/record_equal_test.h
diff options
context:
space:
mode:
authorYabin Cui <yabinc@google.com>2016-05-25 14:08:05 -0700
committerYabin Cui <yabinc@google.com>2016-05-31 14:16:14 -0700
commitb42129797f17f990ea5a88c6bdc7446000cc361c (patch)
treecbc62824b5cd6bbaa0e012b21529d240fa0a868c /simpleperf/record_equal_test.h
parentc8642b2dcfd60f12a0cdbd1f9361967d264d2a3a (diff)
downloadextras-b42129797f17f990ea5a88c6bdc7446000cc361c.tar.gz
simpleperf: record kernel symbols in perf.data.
To better support kernel profiling, record kernel symbols in perf.data when necessary. An option --no-dump-kernel-symbols is added in record command to always avoid recording kernel symbols. The way to handle all zero /proc/modules and /proc/kallsyms is improved. Add Better support in finding symbols for kernel modules. Bug: 27403614 Change-Id: I470151c54f8a45ad1c101c1b94490e33d7fd7485
Diffstat (limited to 'simpleperf/record_equal_test.h')
-rw-r--r--simpleperf/record_equal_test.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/simpleperf/record_equal_test.h b/simpleperf/record_equal_test.h
index 03768dc5..a15fad20 100644
--- a/simpleperf/record_equal_test.h
+++ b/simpleperf/record_equal_test.h
@@ -31,13 +31,15 @@ static void CheckBuildIdRecordDataEqual(const BuildIdRecord& r1, const BuildIdRe
}
static void CheckRecordEqual(const Record& r1, const Record& r2) {
- ASSERT_EQ(0, memcmp(&r1.header, &r2.header, sizeof(r1.header)));
+ ASSERT_EQ(r1.type(), r2.type());
+ ASSERT_EQ(r1.misc(), r2.misc());
+ ASSERT_EQ(r1.size(), r2.size());
ASSERT_EQ(0, memcmp(&r1.sample_id, &r2.sample_id, sizeof(r1.sample_id)));
- if (r1.header.type == PERF_RECORD_MMAP) {
+ if (r1.type() == PERF_RECORD_MMAP) {
CheckMmapRecordDataEqual(static_cast<const MmapRecord&>(r1), static_cast<const MmapRecord&>(r2));
- } else if (r1.header.type == PERF_RECORD_COMM) {
+ } else if (r1.type() == PERF_RECORD_COMM) {
CheckCommRecordDataEqual(static_cast<const CommRecord&>(r1), static_cast<const CommRecord&>(r2));
- } else if (r1.header.type == PERF_RECORD_BUILD_ID) {
+ } else if (r1.type() == PERF_RECORD_BUILD_ID) {
CheckBuildIdRecordDataEqual(static_cast<const BuildIdRecord&>(r1),
static_cast<const BuildIdRecord&>(r2));
}