diff --git a/tools/perf/util/event.h b/tools/perf/util/event.h index 491333910cf1025cd08a97714a97d7824c91a615..f959801ac9e4bc602912bb163a9d539cf696bebd 100644 --- a/tools/perf/util/event.h +++ b/tools/perf/util/event.h @@ -62,6 +62,7 @@ struct sample_event { }; struct regs_dump { + u64 abi; u64 *regs; }; diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index db4e431cb6ca38f45844718542183eeb355d6e60..11841881cef971312d9b5fce4418e66845934875 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c @@ -1416,13 +1416,12 @@ int perf_evsel__parse_sample(struct perf_evsel *evsel, union perf_event *event, } if (type & PERF_SAMPLE_REGS_USER) { - u64 avail; - /* First u64 tells us if we have any regs in sample. */ OVERFLOW_CHECK_u64(array); - avail = *array++; + data->user_regs.abi = *array; + array++; - if (avail) { + if (data->user_regs.abi) { u64 regs_user = evsel->attr.sample_regs_user; sz = hweight_long(regs_user) * sizeof(u64);