All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] perf record: Allow to disable callchains by setting mode to "none"
@ 2016-08-16 10:34 Milian Wolff
  2016-08-16 14:33 ` Milian Wolff
  0 siblings, 1 reply; 3+ messages in thread
From: Milian Wolff @ 2016-08-16 10:34 UTC (permalink / raw)
  To: linux-perf-users; +Cc: acme, Milian Wolff

This change is mostly useful for symmetry purposes. Before, we could:

    --event foo/call-graph=fp/
    --event bar/call-graph=dwarf/
    --event asdf/call-graph=lbr/

Now, we can also use

    --event xyz/call-graph=none/

The latter is equivalent to

    --event xyz

when the `perf record` invocation does not specify a global call-graph
option. If it does, then this patch also allows us to selectively
disable the call-graph for single events.

Signed-off-by: Milian Wolff <milian.wolff@kdab.com>
---
 tools/perf/util/util.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/tools/perf/util/util.c b/tools/perf/util/util.c
index 85c5680..a549fee 100644
--- a/tools/perf/util/util.c
+++ b/tools/perf/util/util.c
@@ -536,6 +536,14 @@ int parse_callchain_record(const char *arg, struct callchain_param *param)
 				pr_err("callchain: No more arguments "
 					"needed for --call-graph lbr\n");
 			break;
+		} else if (!strncmp(name, "none", sizeof("none"))) {
+			if (!strtok_r(NULL, ",", &saveptr)) {
+				param->record_mode = CALLCHAIN_NONE;
+				ret = 0;
+			} else
+				pr_err("callchain: No more arguments "
+					"needed for --call-graph none\n");
+			break;
 		} else {
 			pr_err("callchain: Unknown --call-graph option "
 			       "value: %s\n", arg);
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-08-16 14:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-16 10:34 [PATCH] perf record: Allow to disable callchains by setting mode to "none" Milian Wolff
2016-08-16 14:33 ` Milian Wolff
2016-08-16 14:43   ` Arnaldo Carvalho de Melo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.