diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-05-23 12:25:52 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-05-23 12:25:52 -0400 |
commit | 19504828b4bee5e471bcd35e214bc6fd0d380692 (patch) | |
tree | 30d4ffb6783daf9fadd47548c035646d3f0f073e /tools/perf/builtin-test.c | |
parent | 57d19e80f459dd845fb3cfeba8e6df8471bac142 (diff) | |
parent | 3cb6d1540880e767d911b79eb49578de2190f428 (diff) |
Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
perf tools: Fix sample size bit operations
perf tools: Fix ommitted mmap data update on remap
watchdog: Change the default timeout and configure nmi watchdog period based on watchdog_thresh
watchdog: Disable watchdog when thresh is zero
watchdog: Only disable/enable watchdog if neccessary
watchdog: Fix rounding bug in get_sample_period()
perf tools: Propagate event parse error handling
perf tools: Robustify dynamic sample content fetch
perf tools: Pre-check sample size before parsing
perf tools: Move evlist sample helpers to evlist area
perf tools: Remove junk code in mmap size handling
perf tools: Check we are able to read the event size on mmap
Diffstat (limited to 'tools/perf/builtin-test.c')
-rw-r--r-- | tools/perf/builtin-test.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/tools/perf/builtin-test.c b/tools/perf/builtin-test.c index 2f9a337b182f..b67186228c89 100644 --- a/tools/perf/builtin-test.c +++ b/tools/perf/builtin-test.c | |||
@@ -474,6 +474,7 @@ static int test__basic_mmap(void) | |||
474 | unsigned int nr_events[nsyscalls], | 474 | unsigned int nr_events[nsyscalls], |
475 | expected_nr_events[nsyscalls], i, j; | 475 | expected_nr_events[nsyscalls], i, j; |
476 | struct perf_evsel *evsels[nsyscalls], *evsel; | 476 | struct perf_evsel *evsels[nsyscalls], *evsel; |
477 | int sample_size = perf_sample_size(attr.sample_type); | ||
477 | 478 | ||
478 | for (i = 0; i < nsyscalls; ++i) { | 479 | for (i = 0; i < nsyscalls; ++i) { |
479 | char name[64]; | 480 | char name[64]; |
@@ -558,7 +559,13 @@ static int test__basic_mmap(void) | |||
558 | goto out_munmap; | 559 | goto out_munmap; |
559 | } | 560 | } |
560 | 561 | ||
561 | perf_event__parse_sample(event, attr.sample_type, false, &sample); | 562 | err = perf_event__parse_sample(event, attr.sample_type, sample_size, |
563 | false, &sample); | ||
564 | if (err) { | ||
565 | pr_err("Can't parse sample, err = %d\n", err); | ||
566 | goto out_munmap; | ||
567 | } | ||
568 | |||
562 | evsel = perf_evlist__id2evsel(evlist, sample.id); | 569 | evsel = perf_evlist__id2evsel(evlist, sample.id); |
563 | if (evsel == NULL) { | 570 | if (evsel == NULL) { |
564 | pr_debug("event with id %" PRIu64 | 571 | pr_debug("event with id %" PRIu64 |