aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-test.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2011-01-21 10:46:41 -0500
committerArnaldo Carvalho de Melo <acme@redhat.com>2011-01-24 10:17:56 -0500
commitd0dd74e853a0a6f37e8061d6d50be41c7034c54c (patch)
tree1292a98711611cbc4595785ed17605f20a90800c /tools/perf/builtin-test.c
parentfd78260b5376173faeb17127bd63b3c99a8e8bfb (diff)
perf tools: Move event__parse_sample to evsel.c
To avoid linking more stuff in the python binding I'm working on, future csets will make the sample type be taken from the evsel itself, but for that we need to first have one file per cpu and per sample_type, not a single perf.data file. Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Mike Galbraith <efault@gmx.de> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Cc: Tom Zanussi <tzanussi@gmail.com> LKML-Reference: <new-submission> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/builtin-test.c')
-rw-r--r--tools/perf/builtin-test.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/tools/perf/builtin-test.c b/tools/perf/builtin-test.c
index dc91ee06a37c..231e3e21810c 100644
--- a/tools/perf/builtin-test.c
+++ b/tools/perf/builtin-test.c
@@ -10,7 +10,6 @@
10#include "util/evlist.h" 10#include "util/evlist.h"
11#include "util/parse-options.h" 11#include "util/parse-options.h"
12#include "util/parse-events.h" 12#include "util/parse-events.h"
13#include "util/session.h"
14#include "util/symbol.h" 13#include "util/symbol.h"
15#include "util/thread_map.h" 14#include "util/thread_map.h"
16 15
@@ -457,7 +456,6 @@ static int test__basic_mmap(void)
457 int err = -1; 456 int err = -1;
458 event_t *event; 457 event_t *event;
459 struct thread_map *threads; 458 struct thread_map *threads;
460 struct perf_session session;
461 struct cpu_map *cpus; 459 struct cpu_map *cpus;
462 struct perf_evlist *evlist; 460 struct perf_evlist *evlist;
463 struct perf_event_attr attr = { 461 struct perf_event_attr attr = {
@@ -521,13 +519,6 @@ static int test__basic_mmap(void)
521 attr.wakeup_events = 1; 519 attr.wakeup_events = 1;
522 attr.sample_period = 1; 520 attr.sample_period = 1;
523 521
524 /*
525 * FIXME: use evsel->attr.sample_type in event__parse_sample.
526 * This will nicely remove the requirement that we have
527 * all the events with the same sample_type.
528 */
529 session.sample_type = attr.sample_type;
530
531 for (i = 0; i < nsyscalls; ++i) { 522 for (i = 0; i < nsyscalls; ++i) {
532 attr.config = ids[i]; 523 attr.config = ids[i];
533 evsels[i] = perf_evsel__new(&attr, i); 524 evsels[i] = perf_evsel__new(&attr, i);
@@ -567,7 +558,7 @@ static int test__basic_mmap(void)
567 goto out_munmap; 558 goto out_munmap;
568 } 559 }
569 560
570 event__parse_sample(event, &session, &sample); 561 event__parse_sample(event, attr.sample_type, false, &sample);
571 evsel = perf_evlist__id2evsel(evlist, sample.id); 562 evsel = perf_evlist__id2evsel(evlist, sample.id);
572 if (evsel == NULL) { 563 if (evsel == NULL) {
573 pr_debug("event with id %" PRIu64 564 pr_debug("event with id %" PRIu64