diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2012-12-10 13:29:12 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2012-12-11 15:12:58 -0500 |
commit | 3a5afaec593954a399967155db47f72cb8828a6a (patch) | |
tree | ba35db914dcfb07555da7217125db11d2cc9676a | |
parent | 7a5a5ca5fe3df8636c96b49591c23baf7c415dd4 (diff) |
perf evsel: No need to always ask for PERF_FORMAT_ID in read_format
Instead make perf_evlist__confir_attrs use perf_evsel__set_sample_id()
when having more than one event, that way only if we have multiple
events we'll ask to have the event ids returned when we read its file
descriptors.
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 <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-xuho5hrrxy2ky0cjpr80hyfp@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r-- | tools/perf/tests/attr/base-record | 2 | ||||
-rw-r--r-- | tools/perf/tests/attr/test-record-group | 2 | ||||
-rw-r--r-- | tools/perf/tests/attr/test-record-group1 | 2 | ||||
-rw-r--r-- | tools/perf/util/evlist.c | 2 | ||||
-rw-r--r-- | tools/perf/util/evsel.c | 3 |
5 files changed, 7 insertions, 4 deletions
diff --git a/tools/perf/tests/attr/base-record b/tools/perf/tests/attr/base-record index f1485d8e6a0b..f9d04643109e 100644 --- a/tools/perf/tests/attr/base-record +++ b/tools/perf/tests/attr/base-record | |||
@@ -7,7 +7,7 @@ size=96 | |||
7 | config=0 | 7 | config=0 |
8 | sample_period=4000 | 8 | sample_period=4000 |
9 | sample_type=263 | 9 | sample_type=263 |
10 | read_format=7 | 10 | read_format=3 |
11 | disabled=1 | 11 | disabled=1 |
12 | inherit=1 | 12 | inherit=1 |
13 | pinned=0 | 13 | pinned=0 |
diff --git a/tools/perf/tests/attr/test-record-group b/tools/perf/tests/attr/test-record-group index a6599e9a19d3..0df34cab3e42 100644 --- a/tools/perf/tests/attr/test-record-group +++ b/tools/perf/tests/attr/test-record-group | |||
@@ -6,12 +6,14 @@ args = --group -e cycles,instructions kill >/dev/null 2>&1 | |||
6 | fd=1 | 6 | fd=1 |
7 | group_fd=-1 | 7 | group_fd=-1 |
8 | sample_type=327 | 8 | sample_type=327 |
9 | read_format=7 | ||
9 | 10 | ||
10 | [event-2:base-record] | 11 | [event-2:base-record] |
11 | fd=2 | 12 | fd=2 |
12 | group_fd=1 | 13 | group_fd=1 |
13 | config=1 | 14 | config=1 |
14 | sample_type=327 | 15 | sample_type=327 |
16 | read_format=7 | ||
15 | mmap=0 | 17 | mmap=0 |
16 | comm=0 | 18 | comm=0 |
17 | enable_on_exec=0 | 19 | enable_on_exec=0 |
diff --git a/tools/perf/tests/attr/test-record-group1 b/tools/perf/tests/attr/test-record-group1 index 5a8359da38af..18bd926ff6cb 100644 --- a/tools/perf/tests/attr/test-record-group1 +++ b/tools/perf/tests/attr/test-record-group1 | |||
@@ -6,6 +6,7 @@ args = -e '{cycles,instructions}' kill >/tmp/krava 2>&1 | |||
6 | fd=1 | 6 | fd=1 |
7 | group_fd=-1 | 7 | group_fd=-1 |
8 | sample_type=327 | 8 | sample_type=327 |
9 | read_format=7 | ||
9 | 10 | ||
10 | [event-2:base-record] | 11 | [event-2:base-record] |
11 | fd=2 | 12 | fd=2 |
@@ -13,6 +14,7 @@ group_fd=1 | |||
13 | type=0 | 14 | type=0 |
14 | config=1 | 15 | config=1 |
15 | sample_type=327 | 16 | sample_type=327 |
17 | read_format=7 | ||
16 | mmap=0 | 18 | mmap=0 |
17 | comm=0 | 19 | comm=0 |
18 | enable_on_exec=0 | 20 | enable_on_exec=0 |
diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c index 265565942ae5..5a0878d3a038 100644 --- a/tools/perf/util/evlist.c +++ b/tools/perf/util/evlist.c | |||
@@ -61,7 +61,7 @@ void perf_evlist__config_attrs(struct perf_evlist *evlist, | |||
61 | perf_evsel__config(evsel, opts); | 61 | perf_evsel__config(evsel, opts); |
62 | 62 | ||
63 | if (evlist->nr_entries > 1) | 63 | if (evlist->nr_entries > 1) |
64 | perf_evsel__set_sample_bit(evsel, ID); | 64 | perf_evsel__set_sample_id(evsel); |
65 | } | 65 | } |
66 | } | 66 | } |
67 | 67 | ||
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index 9dde7e933be9..e62d3aef9cd6 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c | |||
@@ -466,8 +466,7 @@ void perf_evsel__config(struct perf_evsel *evsel, | |||
466 | attr->sample_id_all = opts->sample_id_all_missing ? 0 : 1; | 466 | attr->sample_id_all = opts->sample_id_all_missing ? 0 : 1; |
467 | attr->inherit = !opts->no_inherit; | 467 | attr->inherit = !opts->no_inherit; |
468 | attr->read_format = PERF_FORMAT_TOTAL_TIME_ENABLED | | 468 | attr->read_format = PERF_FORMAT_TOTAL_TIME_ENABLED | |
469 | PERF_FORMAT_TOTAL_TIME_RUNNING | | 469 | PERF_FORMAT_TOTAL_TIME_RUNNING; |
470 | PERF_FORMAT_ID; | ||
471 | 470 | ||
472 | perf_evsel__set_sample_bit(evsel, IP); | 471 | perf_evsel__set_sample_bit(evsel, IP); |
473 | perf_evsel__set_sample_bit(evsel, TID); | 472 | perf_evsel__set_sample_bit(evsel, TID); |