Skip to content

Commit

Permalink
Fix issue google#43 on newer machines
Browse files Browse the repository at this point in the history
  • Loading branch information
tcwanggoogle committed Nov 26, 2018
1 parent ec86f82 commit e5d5080
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 1 addition & 2 deletions chromiumos-wide-profiling/perf_parser.cc
Expand Up @@ -181,8 +181,7 @@ bool PerfParser::ProcessEvents() {
case PERF_RECORD_THROTTLE:
case PERF_RECORD_UNTHROTTLE:
case PERF_RECORD_READ:
case PERF_RECORD_MAX:
case PERF_RECORD_FINISHED_ROUND:
case PERF_RECORD_USER_TYPE_START ... PERF_RECORD_HEADER_MAX:
VLOG(1) << "Parsed event type: " << event.header.type
<< ". Doing nothing.";
break;
Expand Down
6 changes: 6 additions & 0 deletions chromiumos-wide-profiling/perf_reader.cc
Expand Up @@ -992,6 +992,12 @@ bool PerfReader::ReadPerfSampleInfo(const event_t& event,
struct perf_sample* sample) const {
CHECK(sample);

unsigned type = event.header.type;
/* Ignore events added by perf record */
if (type >= PERF_RECORD_USER_TYPE_START &&
type < PERF_RECORD_HEADER_MAX)
return true;

if (!IsSupportedEventType(event.header.type)) {
LOG(ERROR) << "Unsupported event type " << event.header.type;
return false;
Expand Down

0 comments on commit e5d5080

Please sign in to comment.