Skip to content

Commit

Permalink
perf evlist: Fix id pos in perf_evlist__open()
Browse files Browse the repository at this point in the history
Ensure the id_pos is correct when perf_evlist__open() is used.

This fixes a problem introduced in 7556257 that broke 'perf kvm stat
live' in that this tool wasn't updated to use the sample_type bits
setting helpers.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Tested-by: David Ahern <dsahern@gmail.com>
Acked-by: David Ahern <dsahern@gmail.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
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 <a.p.zijlstra@chello.nl>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/1378496412-2424-2-git-send-email-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 Sep 9, 2013
1 parent ccf53ea commit 733cd2f
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tools/perf/util/evlist.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,16 @@ void perf_evlist__set_id_pos(struct perf_evlist *evlist)
evlist->is_pos = first->is_pos;
}

static void perf_evlist__update_id_pos(struct perf_evlist *evlist)
{
struct perf_evsel *evsel;

list_for_each_entry(evsel, &evlist->entries, node)
perf_evsel__calc_id_pos(evsel);

perf_evlist__set_id_pos(evlist);
}

static void perf_evlist__purge(struct perf_evlist *evlist)
{
struct perf_evsel *pos, *n;
Expand Down Expand Up @@ -920,6 +930,8 @@ int perf_evlist__open(struct perf_evlist *evlist)
struct perf_evsel *evsel;
int err;

perf_evlist__update_id_pos(evlist);

list_for_each_entry(evsel, &evlist->entries, node) {
err = perf_evsel__open(evsel, evlist->cpus, evlist->threads);
if (err < 0)
Expand Down

0 comments on commit 733cd2f

Please sign in to comment.