diff options
Diffstat (limited to 'simpleperf/report_lib_interface.cpp')
-rw-r--r-- | simpleperf/report_lib_interface.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/simpleperf/report_lib_interface.cpp b/simpleperf/report_lib_interface.cpp index c7a606c9..e3af8a88 100644 --- a/simpleperf/report_lib_interface.cpp +++ b/simpleperf/report_lib_interface.cpp @@ -285,8 +285,13 @@ Event* ReportLib::GetEventOfCurrentSample() { event_attrs_.push_back(attr); } } - size_t attr_index = - record_file_reader_->GetAttrIndexOfRecord(current_record_.get()); + size_t attr_index; + if (trace_offcpu_) { + // For trace-offcpu, we don't want to show event sched:sched_switch. + attr_index = 0; + } else { + attr_index = record_file_reader_->GetAttrIndexOfRecord(current_record_.get()); + } current_event_.name = event_attrs_[attr_index].name.c_str(); update_flag_ |= UPDATE_FLAG_OF_EVENT; } |