lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:	Sat, 16 Apr 2016 02:18:32 -0700
From:	tip-bot for Arnaldo Carvalho de Melo <tipbot@...or.com>
To:	linux-tip-commits@...r.kernel.org
Cc:	acme@...hat.com, mingo@...nel.org, linux-kernel@...r.kernel.org,
	wangnan0@...wei.com, milian.wolff@...b.com, dsahern@...il.com,
	tglx@...utronix.de, adrian.hunter@...el.com, namhyung@...nel.org,
	jolsa@...nel.org, hpa@...or.com
Subject: [tip:perf/core] perf trace: Add --max-stack knob

Commit-ID:  c6d4a494a207a336b45e52a44550150964daf1ce
Gitweb:     http://git.kernel.org/tip/c6d4a494a207a336b45e52a44550150964daf1ce
Author:     Arnaldo Carvalho de Melo <acme@...hat.com>
AuthorDate: Thu, 14 Apr 2016 18:29:08 -0300
Committer:  Arnaldo Carvalho de Melo <acme@...hat.com>
CommitDate: Thu, 14 Apr 2016 19:46:58 -0300

perf trace: Add --max-stack knob

Similar to the one in the other tools (report, script, top).

Cc: Adrian Hunter <adrian.hunter@...el.com>
Cc: David Ahern <dsahern@...il.com>
Cc: Jiri Olsa <jolsa@...nel.org>
Cc: Milian Wolff <milian.wolff@...b.com>
Cc: Namhyung Kim <namhyung@...nel.org>
Cc: Wang Nan <wangnan0@...wei.com>
Link: http://lkml.kernel.org/n/tip-lh7kk5a5t3erwxw31ah0cgar@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
---
 tools/perf/Documentation/perf-trace.txt | 9 +++++++++
 tools/perf/builtin-trace.c              | 9 ++++++++-
 2 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/tools/perf/Documentation/perf-trace.txt b/tools/perf/Documentation/perf-trace.txt
index 1bbcf30..2ee0c4f 100644
--- a/tools/perf/Documentation/perf-trace.txt
+++ b/tools/perf/Documentation/perf-trace.txt
@@ -129,6 +129,15 @@ the thread executes on the designated CPUs. Default is to monitor all CPUs.
 --event::
 	Trace other events, see 'perf list' for a complete list.
 
+--max-stack::
+        Set the stack depth limit when parsing the callchain, anything
+        beyond the specified depth will be ignored. Note that at this point
+        this is just about the presentation part, i.e. the kernel is still
+        not limiting, the overhead of callchains needs to be set via the
+        knobs in --call-graph dwarf.
+
+        Default: 127
+
 --proc-map-timeout::
 	When processing pre-existing threads /proc/XXX/mmap, it may take a long time,
 	because the file may be huge. A time out is needed in such cases.
diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
index 5e5a95e..39a1589 100644
--- a/tools/perf/builtin-trace.c
+++ b/tools/perf/builtin-trace.c
@@ -46,6 +46,7 @@
 #include <linux/audit.h>
 #include <sys/ptrace.h>
 #include <linux/random.h>
+#include <linux/stringify.h>
 
 #ifndef O_CLOEXEC
 # define O_CLOEXEC		02000000
@@ -106,6 +107,7 @@ struct trace {
 		u64		vfs_getname,
 				proc_getname;
 	} stats;
+	unsigned int		max_stack;
 	bool			not_ev_qualifier;
 	bool			live;
 	bool			full_time;
@@ -1892,7 +1894,7 @@ static int trace__fprintf_callchain(struct trace *trace, struct perf_evsel *evse
 
 	if (machine__resolve(trace->host, &al, sample) < 0 ||
 	    thread__resolve_callchain(al.thread, &callchain_cursor, evsel,
-				      sample, NULL, NULL, scripting_max_stack)) {
+				      sample, NULL, NULL, trace->max_stack)) {
 		pr_err("Problem processing %s callchain, skipping...\n",
 			perf_evsel__name(evsel));
 		return 0;
@@ -3029,6 +3031,7 @@ int cmd_trace(int argc, const char **argv, const char *prefix __maybe_unused)
 		.show_comm = true,
 		.trace_syscalls = true,
 		.kernel_syscallchains = false,
+		.max_stack = PERF_MAX_STACK_DEPTH,
 	};
 	const char *output_name = NULL;
 	const char *ev_qualifier_str = NULL;
@@ -3079,6 +3082,10 @@ int cmd_trace(int argc, const char **argv, const char *prefix __maybe_unused)
 		     &record_parse_callchain_opt),
 	OPT_BOOLEAN(0, "kernel-syscall-graph", &trace.kernel_syscallchains,
 		    "Show the kernel callchains on the syscall exit path"),
+	OPT_UINTEGER(0, "max-stack", &trace.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)),
 	OPT_UINTEGER(0, "proc-map-timeout", &trace.opts.proc_map_timeout,
 			"per thread proc mmap processing timeout in ms"),
 	OPT_END()

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ