Skip to content

Commit

Permalink
perf tools: Add missing 'abi' member to 'struct regs_dump'
Browse files Browse the repository at this point in the history
And store the parsed value there.  Note that the 'abi' is 0 (no
registers), 1 (32-bit registers) or 2 (64-bit registers), but the
registers are anyway copied one-by-one as 64-bit values onto the event
i.e. see 'perf_output_sample_regs()'

Acked-by: Jiri Olsa <jolsa@redhat.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Namhyung Kim <namhyung@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/1377591794-30553-9-git-send-email-adrian.hunter@intel.com
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
  • Loading branch information
Adrian Hunter authored and Arnaldo Carvalho de Melo committed Aug 29, 2013
1 parent 7556257 commit 5b95a4a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
1 change: 1 addition & 0 deletions tools/perf/util/event.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ struct sample_event {
};

struct regs_dump {
u64 abi;
u64 *regs;
};

Expand Down
7 changes: 3 additions & 4 deletions tools/perf/util/evsel.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 5b95a4a

Please sign in to comment.