Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d1302522 authored by Frederic Weisbecker's avatar Frederic Weisbecker Committed by Ingo Molnar
Browse files

perf tools: Add an option to multiplex counters in a single channel



Add an option to multiplex counters output in the channel of
the group leader, ie: the first counter opened:

	-M --multiplex

The effect is better serialized samples. This is especially
useful for tracepoint samples that need to be well serialized
for their post-processing.

Also make use of this option in 'perf sched'.

Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent f977bb49
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -48,6 +48,7 @@ static int call_graph = 0;
static int			inherit_stat			= 0;
static int			no_samples			= 0;
static int			sample_address			= 0;
static int			multiplex			= 0;

static long			samples;
static struct timeval		last_read;
@@ -485,6 +486,9 @@ static void create_counter(int counter, int cpu, pid_t pid)
		exit(-1);
	}

	if (multiplex && fd[nr_cpu][counter] != group_fd)
		ioctl(fd[nr_cpu][counter], PERF_COUNTER_IOC_SET_OUTPUT, group_fd);

	ioctl(fd[nr_cpu][counter], PERF_COUNTER_IOC_ENABLE);
}

@@ -681,6 +685,8 @@ static const struct option options[] = {
		    "Sample addresses"),
	OPT_BOOLEAN('n', "no-samples", &no_samples,
		    "don't sample"),
	OPT_BOOLEAN('M', "multiplex", &multiplex,
		    "multiplex counter output in a single channel"),
	OPT_END()
};

+2 −0
Original line number Diff line number Diff line
@@ -1660,6 +1660,8 @@ static const char *record_args[] = {
	"record",
	"-a",
	"-R",
	"-M",
	"-g",
	"-c", "1",
	"-e", "sched:sched_switch:r",
	"-e", "sched:sched_stat_wait:r",