summaryrefslogtreecommitdiff
path: root/simpleperf/cmd_dumprecord_test.cpp
diff options
context:
space:
mode:
authorYabin Cui <yabinc@google.com>2020-06-29 11:56:37 -0700
committerYabin Cui <yabinc@google.com>2020-06-30 18:23:40 -0700
commit97de9a03f593d7a5c87106b5ec9989cac75438b1 (patch)
tree917060781e0188881f71405cb90601f28e18a4dc /simpleperf/cmd_dumprecord_test.cpp
parentca45f27a1f9142a5fbc108e810a6febe9f6529ce (diff)
downloadextras-97de9a03f593d7a5c87106b5ec9989cac75438b1.tar.gz
simpleperf: dump tracepoint fields in dump cmd.
This is to provide an easy way to show tracepoint fields on device. Also split DumpDataSection() into multiple small functions. Bug: 159157626 Test: run simpleperf_unit_test. Change-Id: Id0d8c6246179b5d62fb80ef512bb726d02d1cb29
Diffstat (limited to 'simpleperf/cmd_dumprecord_test.cpp')
-rw-r--r--simpleperf/cmd_dumprecord_test.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/simpleperf/cmd_dumprecord_test.cpp b/simpleperf/cmd_dumprecord_test.cpp
index 76afc1ca..e8632b87 100644
--- a/simpleperf/cmd_dumprecord_test.cpp
+++ b/simpleperf/cmd_dumprecord_test.cpp
@@ -45,6 +45,14 @@ TEST(cmd_dump, dump_callchain_of_sample_records) {
ASSERT_NE(data.find("__ioctl (/system/lib64/libc.so[+70b6c])"), std::string::npos);
}
+TEST(cmd_dump, dump_tracepoint_fields_of_sample_records) {
+ CaptureStdout capture;
+ ASSERT_TRUE(capture.Start());
+ ASSERT_TRUE(DumpCmd()->Run({GetTestData("perf_with_tracepoint_event.data")}));
+ std::string data = capture.Finish();
+ ASSERT_NE(data.find("prev_comm: sleep"), std::string::npos);
+}
+
TEST(cmd_dump, etm_data) {
CaptureStdout capture;
ASSERT_TRUE(capture.Start());