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

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

perf tools: Fix usage of max_stack sysctl

We cannot limit processing stacks from the current value of the sysctl,
as we may be processing perf.data files, possibly from other machines.

Instead use the old PERF_MAX_STACK_DEPTH, the sysctl default, that can
be overriden using --max-stack or equivalent.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Brendan Gregg <brendan.d.gregg@gmail.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: He Kuang <hekuang@huawei.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Milian Wolff <milian.wolff@kdab.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Vince Weaver <vincent.weaver@maine.edu>
Cc: Wang Nan <wangnan0@huawei.com>
Cc: Zefan Li <lizefan@huawei.com>
Fixes: 4cb93446 ("perf tools: Set the maximum allowed stack from /proc/sys/kernel/perf_event_max_stack")
Link: http://lkml.kernel.org/n/tip-eqeutsr7n7wy0c36z24ytvii@git.kernel.org


Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent bf8bddbf
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: /proc/sys/kernel/perf_event_max_stack when present, 127 otherwise.
	Default: 127

-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: /proc/sys/kernel/perf_event_max_stack when present, 127 otherwise.
        Default: 127

--ns::
	Use 9 decimal places when displaying time (i.e. show the nanoseconds)
+2 −1
Original line number Diff line number Diff line
@@ -143,7 +143,8 @@ 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: /proc/sys/kernel/perf_event_max_stack when present, 127 otherwise.
        Default: /proc/sys/kernel/perf_event_max_stack when present for
                 live sessions (without --input/-i), 127 otherwise.

--min-stack::
        Set the stack depth limit when parsing the callchain, anything
+1 −1
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		 = sysctl_perf_event_max_stack,
		.max_stack		 = PERF_MAX_STACK_DEPTH,
		.pretty_printing_style	 = "normal",
		.socket_filter		 = -1,
	};
+0 −2
Original line number Diff line number Diff line
@@ -2067,8 +2067,6 @@ int cmd_script(int argc, const char **argv, const char *prefix __maybe_unused)
		NULL
	};

	scripting_max_stack = sysctl_perf_event_max_stack;

	setup_scripting();

	argc = parse_options_subcommand(argc, argv, options, script_subcommands, script_usage,
Loading