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

Commit 925c467b authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "tools: perf: build in perf periodic"

parents 70303845 88fad559
Loading
Loading
Loading
Loading
+76 −0
Original line number Diff line number Diff line
perf-periodic(1)
============

NAME
----
perf-periodic - Periodically print the performance counters at given rate

SYNOPSIS
--------
[verse]
'perf periodic' [-e <EVENT> | --event=EVENT] [-p pid] [<options>]

DESCRIPTION
-----------
This command gathers performance counter statistics and periodically prints
out the counter values.


OPTIONS
-------

-e::
--event=::
	Select the PMU event. Selection can be a symbolic event name
	(use 'perf list' to list all events) or a raw PMU
	event (eventsel+umask) in the form of rNNN where NNN is a
	 hexadecimal event descriptor.

-a::
--all-cpus::
        system-wide collection from all CPUs, overrides cpumask

-c cpumask::
Count only on the list of CPUs provided. Multiple CPUs can be provided as a
mask: 1 = cpu0, 3 = cpu0 and cpu1 etc. Default is to count on all CPUs.

-d::
Delta. Display results as a delta from the previous value. Default is to
show the total acculumated value.

-i iterations::
Number of times to iterate. Default 0-forever.

-m operations::
Perform math operations on results. m=multiply, d=divide, a=add, s=subtract,
z=zero, t=transfer, T=total.

-p::
--pid=<pid>::
        stat events on existing process id (comma separated list)

-r fifo_name::
Specify read FIFO name for commands, such as PID to pass pid to connect to.

-s delay::
Time to sleep between each sample, in milliseconds. Default 1000 (1 second).

-v::
Verbose. Show more information (counter open errors etc).

EXAMPLES
--------

$ perf periodic -d -e r3 -e r4 -i 3
 122640 2570103
 108397 2159418
 133372 2826949

$ perf periodic -d -e r3 -e r4 -i 3 -m td
0.032174
0.050263
0.031349

SEE ALSO
--------
linkperf:perf-stat[1]
+3 −3
Original line number Diff line number Diff line
/*
 * Copyright (c) 2011-2012, The Linux Foundation. All rights reserved.
 * Copyright (c) 2011-2013, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -335,7 +335,7 @@ static void do_math_op(struct perf_setup_s *p)
	}
}

int cmd_periodic(int argc, const char **argv, const char *prefix __used)
int cmd_periodic(int argc, const char **argv, const char *prefix __maybe_unused)
{
	int status = 0;
	int c, i;
@@ -344,7 +344,7 @@ int cmd_periodic(int argc, const char **argv, const char *prefix __used)
	FILE *fp;
	int nr_counters = 0;

	evsel_list = perf_evlist__new(NULL, NULL);
	evsel_list = perf_evlist__new();
	if (evsel_list == NULL)
		return -ENOMEM;

+1 −0
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@ perf-kvm mainporcelain common
perf-list			mainporcelain common
perf-lock			mainporcelain common
perf-mem			mainporcelain common
perf-periodic			mainporcelain common
perf-probe			mainporcelain full
perf-record			mainporcelain common
perf-report			mainporcelain common