summaryrefslogtreecommitdiff
path: root/simpleperf
diff options
context:
space:
mode:
authorYabin Cui <yabinc@google.com>2021-04-13 15:27:44 -0700
committerYabin Cui <yabinc@google.com>2021-04-13 15:27:44 -0700
commitb73063b088bf66a299ac49352fe8e463d68e38a8 (patch)
tree188dd1aeebf2f47be90339d1b1740fe2c68dbf9e /simpleperf
parent6c66522dc41ca30aa4b02be18d955d58b7ee1fc9 (diff)
downloadextras-b73063b088bf66a299ac49352fe8e463d68e38a8.tar.gz
simpleperf: fix linux host test.
Remove check to fix test record_cmd.system_wide_fp_callchain_sampling on linux host. Bug: none Test: run simpleperf_unit_test Change-Id: I30737ff1c19cfca9b8afa0465a2bb1b3783b9365
Diffstat (limited to 'simpleperf')
-rw-r--r--simpleperf/record.cpp2
-rw-r--r--simpleperf/record.h3
2 files changed, 3 insertions, 2 deletions
diff --git a/simpleperf/record.cpp b/simpleperf/record.cpp
index da0a8882..4e8a8822 100644
--- a/simpleperf/record.cpp
+++ b/simpleperf/record.cpp
@@ -845,7 +845,7 @@ std::vector<uint64_t> SampleRecord::GetCallChain(size_t* kernel_ip_count) const
if (ip >= PERF_CONTEXT_MAX) {
switch (ip) {
case PERF_CONTEXT_KERNEL:
- CHECK(in_kernel) << "User space callchain followed by kernel callchain.";
+ in_kernel = true;
break;
case PERF_CONTEXT_USER:
in_kernel = false;
diff --git a/simpleperf/record.h b/simpleperf/record.h
index 99f7121d..0ba8d4aa 100644
--- a/simpleperf/record.h
+++ b/simpleperf/record.h
@@ -237,7 +237,8 @@ struct Record {
static uint32_t header_size() { return sizeof(perf_event_header); }
bool InKernel() const {
- return (header.misc & PERF_RECORD_MISC_CPUMODE_MASK) == PERF_RECORD_MISC_KERNEL;
+ uint16_t cpumode = header.misc & PERF_RECORD_MISC_CPUMODE_MASK;
+ return cpumode == PERF_RECORD_MISC_KERNEL || cpumode == PERF_RECORD_MISC_GUEST_KERNEL;
}
void SetTypeAndMisc(uint32_t type, uint16_t misc) {