aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-test.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2012-08-01 19:15:52 -0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2012-08-01 19:15:52 -0300
commit7f3be652c1a8866251bfba9ea8b02067328f5db9 (patch)
tree27bd48d04f7db733b6c980afb55eed0719ac3725 /tools/perf/builtin-test.c
parentperf evsel: Precalculate the sample size (diff)
downloadlinux-dev-7f3be652c1a8866251bfba9ea8b02067328f5db9.tar.xz
linux-dev-7f3be652c1a8866251bfba9ea8b02067328f5db9.zip
perf session: Use perf_evlist__sample_type more extensively
Removing perf_session->sample_type, as it can be obtained from the evsel/evlist. 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-mnt1zwlik7sp7z6ljc9kyefg@git.kernel.org 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.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/tools/perf/builtin-test.c b/tools/perf/builtin-test.c
index 2ea5fe4cc940..e5032ed2f259 100644
--- a/tools/perf/builtin-test.c
+++ b/tools/perf/builtin-test.c
@@ -661,7 +661,7 @@ static int test__PERF_RECORD(void)
const char *cmd = "sleep";
const char *argv[] = { cmd, "1", NULL, };
char *bname;
- u64 sample_type, prev_time = 0;
+ u64 prev_time = 0;
bool found_cmd_mmap = false,
found_libc_mmap = false,
found_vdso_mmap = false,
@@ -757,12 +757,6 @@ static int test__PERF_RECORD(void)
}
/*
- * We'll need these two to parse the PERF_SAMPLE_* fields in each
- * event.
- */
- sample_type = perf_evlist__sample_type(evlist);
-
- /*
* Now that all is properly set up, enable the events, they will
* count just on workload.pid, which will start...
*/
@@ -787,7 +781,7 @@ static int test__PERF_RECORD(void)
if (type < PERF_RECORD_MAX)
nr_events[type]++;
- err = perf_event__parse_sample(event, sample_type,
+ err = perf_event__parse_sample(event, evsel->attr.sample_type,
evsel->sample_size, true,
&sample, false);
if (err < 0) {