[PATCH V13 04/12] perf tools: remove references to struct ip_event
struct ip_event assumes fixed positions for ip, pid and tid. That is no longer true with the addition of PERF_SAMPLE_IDENTIFIER. The information is anyway in struct sample, so use that instead. Signed-off-by: Adrian Hunter Acked-by: Namhyung Kim --- tools/perf/builtin-inject.c | 4 ++-- tools/perf/builtin-kmem.c | 4 ++-- tools/perf/builtin-mem.c | 2 +- tools/perf/builtin-script.c | 4 ++-- tools/perf/builtin-top.c | 11 ++- tools/perf/tests/hists_link.c | 20 tools/perf/util/build-id.c| 8 tools/perf/util/event.c | 6 +++--- tools/perf/util/event.h | 11 --- tools/perf/util/evsel.c | 4 ++-- tools/perf/util/session.c | 8 +--- 11 files changed, 35 insertions(+), 47 deletions(-) diff --git a/tools/perf/builtin-inject.c b/tools/perf/builtin-inject.c index 0d4ae1d..ffacd46 100644 --- a/tools/perf/builtin-inject.c +++ b/tools/perf/builtin-inject.c @@ -198,7 +198,7 @@ static int perf_event__inject_buildid(struct perf_tool *tool, cpumode = event->header.misc & PERF_RECORD_MISC_CPUMODE_MASK; - thread = machine__findnew_thread(machine, event->ip.pid, event->ip.pid); + thread = machine__findnew_thread(machine, sample->pid, sample->pid); if (thread == NULL) { pr_err("problem processing %d event, skipping it.\n", event->header.type); @@ -206,7 +206,7 @@ static int perf_event__inject_buildid(struct perf_tool *tool, } thread__find_addr_map(thread, machine, cpumode, MAP__FUNCTION, - event->ip.ip, ); + sample->ip, ); if (al.map != NULL) { if (!al.map->dso->hit) { diff --git a/tools/perf/builtin-kmem.c b/tools/perf/builtin-kmem.c index c324778..c2dff9c 100644 --- a/tools/perf/builtin-kmem.c +++ b/tools/perf/builtin-kmem.c @@ -305,8 +305,8 @@ static int process_sample_event(struct perf_tool *tool __maybe_unused, struct perf_evsel *evsel, struct machine *machine) { - struct thread *thread = machine__findnew_thread(machine, event->ip.pid, - event->ip.pid); + struct thread *thread = machine__findnew_thread(machine, sample->pid, + sample->pid); if (thread == NULL) { pr_debug("problem processing %d event, skipping it.\n", diff --git a/tools/perf/builtin-mem.c b/tools/perf/builtin-mem.c index 706a1fa..791b432 100644 --- a/tools/perf/builtin-mem.c +++ b/tools/perf/builtin-mem.c @@ -94,7 +94,7 @@ dump_raw_samples(struct perf_tool *tool, symbol_conf.field_sep, sample->tid, symbol_conf.field_sep, - event->ip.ip, + sample->ip, symbol_conf.field_sep, sample->addr, symbol_conf.field_sep, diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c index d82712f..93a34ce 100644 --- a/tools/perf/builtin-script.c +++ b/tools/perf/builtin-script.c @@ -501,8 +501,8 @@ static int process_sample_event(struct perf_tool *tool __maybe_unused, struct machine *machine) { struct addr_location al; - struct thread *thread = machine__findnew_thread(machine, event->ip.pid, - event->ip.tid); + struct thread *thread = machine__findnew_thread(machine, sample->pid, + sample->tid); if (thread == NULL) { pr_debug("problem processing %d event, skipping it.\n", diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c index e37521f..2122141 100644 --- a/tools/perf/builtin-top.c +++ b/tools/perf/builtin-top.c @@ -689,7 +689,7 @@ static void perf_event__process_sample(struct perf_tool *tool, { struct perf_top *top = container_of(tool, struct perf_top, tool); struct symbol *parent = NULL; - u64 ip = event->ip.ip; + u64 ip = sample->ip; struct addr_location al; int err; @@ -699,10 +699,10 @@ static void perf_event__process_sample(struct perf_tool *tool, if (!seen) seen = intlist__new(NULL); - if (!intlist__has_entry(seen, event->ip.pid)) { + if (!intlist__has_entry(seen, sample->pid)) { pr_err("Can't find guest [%d]'s kernel information\n", - event->ip.pid); - intlist__add(seen, event->ip.pid); + sample->pid); + intlist__add(seen, sample->pid); } return; } @@ -836,7 +836,8 @@ static void perf_top__mmap_read_idx(struct perf_top *top, int idx) break;
[PATCH V13 04/12] perf tools: remove references to struct ip_event
struct ip_event assumes fixed positions for ip, pid and tid. That is no longer true with the addition of PERF_SAMPLE_IDENTIFIER. The information is anyway in struct sample, so use that instead. Signed-off-by: Adrian Hunter adrian.hun...@intel.com Acked-by: Namhyung Kim namhy...@kernel.org --- tools/perf/builtin-inject.c | 4 ++-- tools/perf/builtin-kmem.c | 4 ++-- tools/perf/builtin-mem.c | 2 +- tools/perf/builtin-script.c | 4 ++-- tools/perf/builtin-top.c | 11 ++- tools/perf/tests/hists_link.c | 20 tools/perf/util/build-id.c| 8 tools/perf/util/event.c | 6 +++--- tools/perf/util/event.h | 11 --- tools/perf/util/evsel.c | 4 ++-- tools/perf/util/session.c | 8 +--- 11 files changed, 35 insertions(+), 47 deletions(-) diff --git a/tools/perf/builtin-inject.c b/tools/perf/builtin-inject.c index 0d4ae1d..ffacd46 100644 --- a/tools/perf/builtin-inject.c +++ b/tools/perf/builtin-inject.c @@ -198,7 +198,7 @@ static int perf_event__inject_buildid(struct perf_tool *tool, cpumode = event-header.misc PERF_RECORD_MISC_CPUMODE_MASK; - thread = machine__findnew_thread(machine, event-ip.pid, event-ip.pid); + thread = machine__findnew_thread(machine, sample-pid, sample-pid); if (thread == NULL) { pr_err(problem processing %d event, skipping it.\n, event-header.type); @@ -206,7 +206,7 @@ static int perf_event__inject_buildid(struct perf_tool *tool, } thread__find_addr_map(thread, machine, cpumode, MAP__FUNCTION, - event-ip.ip, al); + sample-ip, al); if (al.map != NULL) { if (!al.map-dso-hit) { diff --git a/tools/perf/builtin-kmem.c b/tools/perf/builtin-kmem.c index c324778..c2dff9c 100644 --- a/tools/perf/builtin-kmem.c +++ b/tools/perf/builtin-kmem.c @@ -305,8 +305,8 @@ static int process_sample_event(struct perf_tool *tool __maybe_unused, struct perf_evsel *evsel, struct machine *machine) { - struct thread *thread = machine__findnew_thread(machine, event-ip.pid, - event-ip.pid); + struct thread *thread = machine__findnew_thread(machine, sample-pid, + sample-pid); if (thread == NULL) { pr_debug(problem processing %d event, skipping it.\n, diff --git a/tools/perf/builtin-mem.c b/tools/perf/builtin-mem.c index 706a1fa..791b432 100644 --- a/tools/perf/builtin-mem.c +++ b/tools/perf/builtin-mem.c @@ -94,7 +94,7 @@ dump_raw_samples(struct perf_tool *tool, symbol_conf.field_sep, sample-tid, symbol_conf.field_sep, - event-ip.ip, + sample-ip, symbol_conf.field_sep, sample-addr, symbol_conf.field_sep, diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c index d82712f..93a34ce 100644 --- a/tools/perf/builtin-script.c +++ b/tools/perf/builtin-script.c @@ -501,8 +501,8 @@ static int process_sample_event(struct perf_tool *tool __maybe_unused, struct machine *machine) { struct addr_location al; - struct thread *thread = machine__findnew_thread(machine, event-ip.pid, - event-ip.tid); + struct thread *thread = machine__findnew_thread(machine, sample-pid, + sample-tid); if (thread == NULL) { pr_debug(problem processing %d event, skipping it.\n, diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c index e37521f..2122141 100644 --- a/tools/perf/builtin-top.c +++ b/tools/perf/builtin-top.c @@ -689,7 +689,7 @@ static void perf_event__process_sample(struct perf_tool *tool, { struct perf_top *top = container_of(tool, struct perf_top, tool); struct symbol *parent = NULL; - u64 ip = event-ip.ip; + u64 ip = sample-ip; struct addr_location al; int err; @@ -699,10 +699,10 @@ static void perf_event__process_sample(struct perf_tool *tool, if (!seen) seen = intlist__new(NULL); - if (!intlist__has_entry(seen, event-ip.pid)) { + if (!intlist__has_entry(seen, sample-pid)) { pr_err(Can't find guest [%d]'s kernel information\n, - event-ip.pid); - intlist__add(seen, event-ip.pid); + sample-pid); + intlist__add(seen, sample-pid); } return; } @@ -836,7 +836,8 @@ static void perf_top__mmap_read_idx(struct perf_top *top, int idx)