summaryrefslogtreecommitdiffstats
path: root/tools/perf/util/evsel.h
diff options
context:
space:
mode:
authorAndi Kleen2013-08-22 01:47:26 +0200
committerIngo Molnar2013-10-04 10:06:07 +0200
commit4cabc3d1cb6a46f581a2628d1d11c483d5f300e5 (patch)
tree5daa1d88dd0cfa62433f7d6149f5f96c6a3fc33d /tools/perf/util/evsel.h
parentperf: Enforce 1 as lower limit for perf_event_max_sample_rate (diff)
downloadkernel-qcow2-linux-4cabc3d1cb6a46f581a2628d1d11c483d5f300e5.tar.gz
kernel-qcow2-linux-4cabc3d1cb6a46f581a2628d1d11c483d5f300e5.tar.xz
kernel-qcow2-linux-4cabc3d1cb6a46f581a2628d1d11c483d5f300e5.zip
tools/perf/stat: Add perf stat --transaction
Add support to perf stat to print the basic transactional execution statistics: Total cycles, Cycles in Transaction, Cycles in aborted transsactions using the in_tx and in_tx_checkpoint qualifiers. Transaction Starts and Elision Starts, to compute the average transaction length. This is a reasonable overview over the success of the transactions. Also support architectures that have a transaction aborted cycles counter like POWER8. Since that is awkward to handle in the kernel abstract handle both cases here. Enable with a new --transaction / -T option. This requires measuring these events in a group, since they depend on each other. This is implemented by using TM sysfs events exported by the kernel Signed-off-by: Andi Kleen <ak@linux.intel.com> Acked-by: Arnaldo Carvalho de Melo <acme@infradead.org> Signed-off-by: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/1377128846-977-5-git-send-email-andi@firstfloor.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'tools/perf/util/evsel.h')
-rw-r--r--tools/perf/util/evsel.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h
index 4a7bdc713bab..5aa68cddc7d9 100644
--- a/tools/perf/util/evsel.h
+++ b/tools/perf/util/evsel.h
@@ -197,6 +197,12 @@ static inline bool perf_evsel__match2(struct perf_evsel *e1,
(e1->attr.config == e2->attr.config);
}
+#define perf_evsel__cmp(a, b) \
+ ((a) && \
+ (b) && \
+ (a)->attr.type == (b)->attr.type && \
+ (a)->attr.config == (b)->attr.config)
+
int __perf_evsel__read_on_cpu(struct perf_evsel *evsel,
int cpu, int thread, bool scale);