simpleperf: add AuxRecord and AUXTRACE feature section.

In the kernel, each time generating a block of etm data, it also
generates a PERF_RECORD_AUX record. An Aux record contains a timestamp
showing when a block of etm data is generated. It can be used to
synchronize etm data with other records (like mmap and comm records).

So we want to parse etm data each time seeing an Aux record (as in dump
cmd). It needs to know etm data locations in perf.data without reading
the whole file. To fulfill that, this CL also adds AUXTRACE feature section,
in the same format as in linux perf.

Also dump AUX records and their corresponding etm data in dump cmd.

Bug: 135204414
Test: run simpleperf_unit_test.
Test: run `simpleperf record -e cs-etm xxx` && `perf report -D --stdio`.

Change-Id: Ifae716a10fefe0f3d4822a0214384b40ada9da45
diff --git a/simpleperf/cmd_dumprecord_test.cpp b/simpleperf/cmd_dumprecord_test.cpp
index a2a50ce..12aadb1 100644
--- a/simpleperf/cmd_dumprecord_test.cpp
+++ b/simpleperf/cmd_dumprecord_test.cpp
@@ -44,3 +44,13 @@
   ASSERT_NE(data.find("[kernel.kallsyms][+ffffffc000086b4a]"), std::string::npos);
   ASSERT_NE(data.find("__ioctl (/system/lib64/libc.so[+70b6c])"), std::string::npos);
 }
+
+TEST(cmd_dump, etm_data) {
+  CaptureStdout capture;
+  ASSERT_TRUE(capture.Start());
+  ASSERT_TRUE(DumpCmd()->Run({GetTestData(PERF_DATA_ETM_TEST_LOOP)}));
+  std::string data = capture.Finish();
+  ASSERT_NE(data.find("record aux:"), std::string::npos);
+  ASSERT_NE(data.find("aux_data:"), std::string::npos);
+  ASSERT_NE(data.find("feature section for auxtrace:"), std::string::npos);
+}