diff options
author | Andreas Gampe <agampe@google.com> | 2018-03-14 22:16:01 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2018-03-14 22:16:01 +0000 |
commit | 456202c21774f4619b954ad398b855ca83098ed4 (patch) | |
tree | b20214520d6a3cd710fd0f101bdfaa2224f37fd3 | |
parent | ad6a33e81d36ec63c0dcc56cded7d2ea72ccd6ce (diff) | |
parent | 146fc353c34c6f800b070925d1bf4946623a4755 (diff) | |
download | perf_data_converter-456202c21774f4619b954ad398b855ca83098ed4.tar.gz |
PerfDataConverter: Skip SAMPLE_REGS_USER & SAMPLE_STACK_USER am: 00403d4da0
am: 146fc353c3
Change-Id: I53a1809b07fbec889b820e302a7569dcc4a62f3c
-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 |