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

Commit 4cb93446 authored by Arnaldo Carvalho de Melo's avatar Arnaldo Carvalho de Melo
Browse files

perf tools: Set the maximum allowed stack from /proc/sys/kernel/perf_event_max_stack

There is an upper limit to what tooling considers a valid callchain,
and it was tied to the hardcoded value in the kernel,
PERF_MAX_STACK_DEPTH (127), now that this can be tuned via a sysctl,
make it read it and use that as the upper limit, falling back to
PERF_MAX_STACK_DEPTH for kernels where this sysctl isn't present.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Brendan Gregg <brendan.d.gregg@gmail.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Milian Wolff <milian.wolff@kdab.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-yjqsd30nnkogvj5oyx9ghir9@git.kernel.org


Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent c5dfd78e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -248,7 +248,7 @@ OPTIONS
	Note that when using the --itrace option the synthesized callchain size
	will override this value if the synthesized callchain size is bigger.

	Default: 127
	Default: /proc/sys/kernel/perf_event_max_stack when present, 127 otherwise.

-G::
--inverted::
+1 −1
Original line number Diff line number Diff line
@@ -267,7 +267,7 @@ include::itrace.txt[]
        Note that when using the --itrace option the synthesized callchain size
        will override this value if the synthesized callchain size is bigger.

        Default: 127
        Default: /proc/sys/kernel/perf_event_max_stack when present, 127 otherwise.

--ns::
	Use 9 decimal places when displaying time (i.e. show the nanoseconds)
+1 −1
Original line number Diff line number Diff line
@@ -177,7 +177,7 @@ Default is to monitor all CPUS.
	between information loss and faster processing especially for
	workloads that can have a very long callchain stack.

	Default: 127
	Default: /proc/sys/kernel/perf_event_max_stack when present, 127 otherwise.

--ignore-callees=<regex>::
        Ignore callees of the function(s) matching the given regex.
+1 −1
Original line number Diff line number Diff line
@@ -143,7 +143,7 @@ the thread executes on the designated CPUs. Default is to monitor all CPUs.
        Implies '--call-graph dwarf' when --call-graph not present on the
        command line, on systems where DWARF unwinding was built in.

        Default: 127
        Default: /proc/sys/kernel/perf_event_max_stack when present, 127 otherwise.

--min-stack::
        Set the stack depth limit when parsing the callchain, anything
+2 −2
Original line number Diff line number Diff line
@@ -691,7 +691,7 @@ int cmd_report(int argc, const char **argv, const char *prefix __maybe_unused)
			.ordered_events	 = true,
			.ordering_requires_timestamps = true,
		},
		.max_stack		 = PERF_MAX_STACK_DEPTH,
		.max_stack		 = sysctl_perf_event_max_stack,
		.pretty_printing_style	 = "normal",
		.socket_filter		 = -1,
	};
@@ -744,7 +744,7 @@ int cmd_report(int argc, const char **argv, const char *prefix __maybe_unused)
	OPT_INTEGER(0, "max-stack", &report.max_stack,
		    "Set the maximum stack depth when parsing the callchain, "
		    "anything beyond the specified depth will be ignored. "
		    "Default: " __stringify(PERF_MAX_STACK_DEPTH)),
		    "Default: kernel.perf_event_max_stack or " __stringify(PERF_MAX_STACK_DEPTH)),
	OPT_BOOLEAN('G', "inverted", &report.inverted_callchain,
		    "alias for inverted call graph"),
	OPT_CALLBACK(0, "ignore-callees", NULL, "regex",
Loading