Commit 475eeab9 authored by Andi Kleen's avatar Andi Kleen Committed by Ingo Molnar
Browse files

tools/perf: Add support for record transaction flags



Add support for recording and displaying the transaction flags.
They are essentially a new sort key. Also display them
in a nice way to the user.

Signed-off-by: default avatarAndi Kleen <ak@linux.intel.com>
Acked-by: default avatarJiri Olsa <jolsa@redhat.com>
Signed-off-by: default avatarPeter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1379688044-14173-6-git-send-email-andi@firstfloor.org


Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent 0126d493
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -179,12 +179,14 @@ is enabled for all the sampling events. The sampled branch type is the same for
The various filters must be specified as a comma separated list: --branch-filter any_ret,u,k
Note that this feature may not be available on all processors.

-W::
--weight::
Enable weightened sampling. An additional weight is recorded per sample and can be
displayed with the weight and local_weight sort keys.  This currently works for TSX
abort events and some memory events in precise mode on modern Intel CPUs.

--transaction::
Record transaction flags for transaction related events.

SEE ALSO
--------
linkperf:perf-stat[1], linkperf:perf-list[1]
+4 −0
Original line number Diff line number Diff line
@@ -72,6 +72,10 @@ OPTIONS
	- cpu: cpu number the task ran at the time of sample
	- srcline: filename and line number executed at the time of sample.  The
	DWARF debugging info must be provided.
	- weight: Event specific weight, e.g. memory latency or transaction
	abort cost. This is the global weight.
	- local_weight: Local weight version of the weight above.
	- transaction: Transaction abort flags.

	By default, comm, dso and symbol keys are used.
	(i.e. --sort comm,dso,symbol)
+1 −1
Original line number Diff line number Diff line
@@ -113,7 +113,7 @@ Default is to monitor all CPUS.
-s::
--sort::
	Sort by key(s): pid, comm, dso, symbol, parent, srcline, weight,
	local_weight, abort, in_tx
	local_weight, abort, in_tx, transaction

-n::
--show-nr-samples::
+1 −1
Original line number Diff line number Diff line
@@ -63,7 +63,7 @@ static int perf_evsel__add_sample(struct perf_evsel *evsel,
		return 0;
	}

	he = __hists__add_entry(&evsel->hists, al, NULL, 1, 1);
	he = __hists__add_entry(&evsel->hists, al, NULL, 1, 1, 0);
	if (he == NULL)
		return -ENOMEM;

+5 −3
Original line number Diff line number Diff line
@@ -304,9 +304,10 @@ static int formula_fprintf(struct hist_entry *he, struct hist_entry *pair,

static int hists__add_entry(struct hists *self,
			    struct addr_location *al, u64 period,
			    u64 weight)
			    u64 weight, u64 transaction)
{
	if (__hists__add_entry(self, al, NULL, period, weight) != NULL)
	if (__hists__add_entry(self, al, NULL, period, weight, transaction)
	    != NULL)
		return 0;
	return -ENOMEM;
}
@@ -328,7 +329,8 @@ static int diff__process_sample_event(struct perf_tool *tool __maybe_unused,
	if (al.filtered)
		return 0;

	if (hists__add_entry(&evsel->hists, &al, sample->period, sample->weight)) {
	if (hists__add_entry(&evsel->hists, &al, sample->period,
			     sample->weight, sample->transaction)) {
		pr_warning("problem incrementing symbol period, skipping event\n");
		return -1;
	}
Loading