diff options
author | Adrian Hunter <adrian.hunter@intel.com> | 2013-09-06 15:40:11 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2013-09-09 14:51:44 -0400 |
commit | 733cd2fe197a0c696c54916f7395451c0da9b867 (patch) | |
tree | 8b7b21e9bfa11bfca1d4ea18e50bb114e8f93840 /tools | |
parent | ccf53eac2097fb47bc40875ffb22c2d10fa8c46c (diff) |
perf evlist: Fix id pos in perf_evlist__open()
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>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/perf/util/evlist.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c index 7101283ac3c5..f9f77bee0b1b 100644 --- a/tools/perf/util/evlist.c +++ b/tools/perf/util/evlist.c | |||
@@ -64,6 +64,16 @@ void perf_evlist__set_id_pos(struct perf_evlist *evlist) | |||
64 | evlist->is_pos = first->is_pos; | 64 | evlist->is_pos = first->is_pos; |
65 | } | 65 | } |
66 | 66 | ||
67 | static void perf_evlist__update_id_pos(struct perf_evlist *evlist) | ||
68 | { | ||
69 | struct perf_evsel *evsel; | ||
70 | |||
71 | list_for_each_entry(evsel, &evlist->entries, node) | ||
72 | perf_evsel__calc_id_pos(evsel); | ||
73 | |||
74 | perf_evlist__set_id_pos(evlist); | ||
75 | } | ||
76 | |||
67 | static void perf_evlist__purge(struct perf_evlist *evlist) | 77 | static void perf_evlist__purge(struct perf_evlist *evlist) |
68 | { | 78 | { |
69 | struct perf_evsel *pos, *n; | 79 | struct perf_evsel *pos, *n; |
@@ -920,6 +930,8 @@ int perf_evlist__open(struct perf_evlist *evlist) | |||
920 | struct perf_evsel *evsel; | 930 | struct perf_evsel *evsel; |
921 | int err; | 931 | int err; |
922 | 932 | ||
933 | perf_evlist__update_id_pos(evlist); | ||
934 | |||
923 | list_for_each_entry(evsel, &evlist->entries, node) { | 935 | list_for_each_entry(evsel, &evlist->entries, node) { |
924 | err = perf_evsel__open(evsel, evlist->cpus, evlist->threads); | 936 | err = perf_evsel__open(evsel, evlist->cpus, evlist->threads); |
925 | if (err < 0) | 937 | if (err < 0) |