aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/evsel.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2013-11-04 15:14:04 -0500
committerIngo Molnar <mingo@kernel.org>2013-11-04 15:14:04 -0500
commit87968f94fbea47df334502a0db645833ce8a848b (patch)
treea8acb87cf151aed23aa0f64d2f78567b6eaffc75 /tools/perf/util/evsel.c
parent2a3ede8cb2ddee5885518e4232aca13056f9a6e0 (diff)
parent6d862b8c14ba539c7c87ffc77f2e1d6dc9630c4d (diff)
Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core
Pull perf/core improvements and fixes from Arnaldo Carvalho de Melo: * Add new COMM infrastructure, further improving histogram processing, from Frédéric Weisbecker, one fix from Namhyung Kim. * Enhance option parse error message, showing just the help lines of the options affected, from Namhyung Kim. * Fixup PERF_SAMPLE_TRANSACTION handling in sample synthesizing and 'perf test', from Adrian Hunter. * Set up output options for in-stream attributes, from Adrian Hunter. * Fix 32-bit cross build, from Adrian Hunter. * Fix libunwind build and feature detection for 32-bit build, from Adrian Hunter. * Always use perf_evsel__set_sample_bit to set sample_type, from Adrian Hunter. perf evlist: Add a debug print if event buffer mmap fails * Add missing data.h into LIB_H headers, fix from Jiri Olsa. * libtraceevent updates from upstream trace-cmd repo, from Steven Rostedt. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'tools/perf/util/evsel.c')
-rw-r--r--tools/perf/util/evsel.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index 3a334f001997..5280820ed389 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -663,7 +663,7 @@ void perf_evsel__config(struct perf_evsel *evsel,
663 } 663 }
664 664
665 if (opts->sample_address) 665 if (opts->sample_address)
666 attr->sample_type |= PERF_SAMPLE_DATA_SRC; 666 perf_evsel__set_sample_bit(evsel, DATA_SRC);
667 667
668 if (opts->no_delay) { 668 if (opts->no_delay) {
669 attr->watermark = 0; 669 attr->watermark = 0;
@@ -675,13 +675,13 @@ void perf_evsel__config(struct perf_evsel *evsel,
675 } 675 }
676 676
677 if (opts->sample_weight) 677 if (opts->sample_weight)
678 attr->sample_type |= PERF_SAMPLE_WEIGHT; 678 perf_evsel__set_sample_bit(evsel, WEIGHT);
679 679
680 attr->mmap = track; 680 attr->mmap = track;
681 attr->comm = track; 681 attr->comm = track;
682 682
683 if (opts->sample_transaction) 683 if (opts->sample_transaction)
684 attr->sample_type |= PERF_SAMPLE_TRANSACTION; 684 perf_evsel__set_sample_bit(evsel, TRANSACTION);
685 685
686 /* 686 /*
687 * XXX see the function comment above 687 * XXX see the function comment above
@@ -1051,6 +1051,8 @@ retry_open:
1051 group_fd, flags); 1051 group_fd, flags);
1052 if (FD(evsel, cpu, thread) < 0) { 1052 if (FD(evsel, cpu, thread) < 0) {
1053 err = -errno; 1053 err = -errno;
1054 pr_debug2("perf_event_open failed, error %d\n",
1055 err);
1054 goto try_fallback; 1056 goto try_fallback;
1055 } 1057 }
1056 set_rlimit = NO_CHANGE; 1058 set_rlimit = NO_CHANGE;
@@ -1479,6 +1481,7 @@ int perf_evsel__parse_sample(struct perf_evsel *evsel, union perf_event *event,
1479 1481
1480 data->transaction = 0; 1482 data->transaction = 0;
1481 if (type & PERF_SAMPLE_TRANSACTION) { 1483 if (type & PERF_SAMPLE_TRANSACTION) {
1484 OVERFLOW_CHECK_u64(array);
1482 data->transaction = *array; 1485 data->transaction = *array;
1483 array++; 1486 array++;
1484 } 1487 }
@@ -1575,6 +1578,9 @@ size_t perf_event__sample_event_size(const struct perf_sample *sample, u64 type,
1575 if (type & PERF_SAMPLE_DATA_SRC) 1578 if (type & PERF_SAMPLE_DATA_SRC)
1576 result += sizeof(u64); 1579 result += sizeof(u64);
1577 1580
1581 if (type & PERF_SAMPLE_TRANSACTION)
1582 result += sizeof(u64);
1583
1578 return result; 1584 return result;
1579} 1585}
1580 1586
@@ -1748,6 +1754,11 @@ int perf_event__synthesize_sample(union perf_event *event, u64 type,
1748 array++; 1754 array++;
1749 } 1755 }
1750 1756
1757 if (type & PERF_SAMPLE_TRANSACTION) {
1758 *array = sample->transaction;
1759 array++;
1760 }
1761
1751 return 0; 1762 return 0;
1752} 1763}
1753 1764