diff options
author | Andreas Gampe <agampe@google.com> | 2018-03-13 20:44:27 -0700 |
---|---|---|
committer | Andreas Gampe <agampe@google.com> | 2018-03-14 10:46:46 -0700 |
commit | 00403d4da0ea34cc0cc10f302cd1e1ad26afcfe1 (patch) | |
tree | b20214520d6a3cd710fd0f101bdfaa2224f37fd3 | |
parent | 31b9b7d606175019b9629e99248757adc93df402 (diff) | |
download | perf_data_converter-00403d4da0ea34cc0cc10f302cd1e1ad26afcfe1.tar.gz |
PerfDataConverter: Skip SAMPLE_REGS_USER & SAMPLE_STACK_USER
Skip this data for now.
Bug: 74644084
Test: mmma external/perf_data_converter/src/quipper
Test: quipper_unit_tests
Change-Id: Idab4c4133e9692db7cc8513e3dfa57be32fe3edf
-rw-r--r-- | src/quipper/sample_info_reader.cc | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/src/quipper/sample_info_reader.cc b/src/quipper/sample_info_reader.cc index 34f78b1..5abd683 100644 --- a/src/quipper/sample_info_reader.cc +++ b/src/quipper/sample_info_reader.cc @@ -267,16 +267,35 @@ size_t ReadPerfSampleFromData(const event_t& event, // { u64 abi; # enum perf_sample_regs_abi // u64 regs[weight(mask)]; } && PERF_SAMPLE_REGS_USER if (sample_fields & PERF_SAMPLE_REGS_USER) { - LOG(ERROR) << "PERF_SAMPLE_REGS_USER is not yet supported."; - return reader.Tell(); + VLOG(1) << "Skipping PERF_SAMPLE_REGS_USER data."; + u64 abi; + if (!reader.ReadUint64(&abi)) { + return false; + } + size_t weight = abi == 0 ? 0 : __builtin_popcountll(attr.sample_regs_user); + u64 regs[64]; + if (weight > 0 && !reader.ReadData(weight * sizeof(u64), regs)) { + return false; + } } // { u64 size; // char data[size]; // u64 dyn_size; } && PERF_SAMPLE_STACK_USER if (sample_fields & PERF_SAMPLE_STACK_USER) { - LOG(ERROR) << "PERF_SAMPLE_STACK_USER is not yet supported."; - return reader.Tell(); + VLOG(1) << "Skipping PERF_SAMPLE_STACK_USER data."; + u64 size; + if (!reader.ReadUint64(&size)) { + return false; + } + if (size != 0) { + std::unique_ptr<char[]> data(new char[size]); + if (!reader.ReadData(size, data.get())) { + return false; + } + u64 dyn_size; + reader.ReadUint64(&dyn_size); + } } // { u64 weight; } && PERF_SAMPLE_WEIGHT |