All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] perf sched timehist: Mark schedule function in callchains
@ 2016-11-24  1:11 Namhyung Kim
  2016-11-24  1:11 ` [PATCH 2/3] perf tools: Add option to skip ignore symbol when printing callchains Namhyung Kim
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Namhyung Kim @ 2016-11-24  1:11 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Ingo Molnar, Peter Zijlstra, Jiri Olsa, LKML, David Ahern,
	Stephane Eranian, Andi Kleen

The sched_switch event always captured from the scheduler function.  So
it'd be great omit them from the callchain.  This patch marks the
functions to be omitted by later patch.

Cc: David Ahern <dsahern@gmail.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
 tools/perf/builtin-sched.c | 21 +++++++++++++++++++++
 tools/perf/util/symbol.h   |  1 +
 2 files changed, 22 insertions(+)

diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c
index 829468defa07..cd14189d3943 100644
--- a/tools/perf/builtin-sched.c
+++ b/tools/perf/builtin-sched.c
@@ -1965,7 +1965,28 @@ static bool is_idle_sample(struct perf_sched *sched,
 
 		return false;
 	}
+
 	callchain_cursor_commit(cursor);
+
+	while (true) {
+		struct callchain_cursor_node *node;
+		struct symbol *sym;
+
+		node = callchain_cursor_current(cursor);
+		if (node == NULL)
+			break;
+
+		sym = node->sym;
+		if (sym && sym->name) {
+			if (!strcmp(sym->name, "schedule") ||
+			    !strcmp(sym->name, "__schedule") ||
+			    !strcmp(sym->name, "preempt_schedule"))
+				sym->ignore = 1;
+		}
+
+		callchain_cursor_advance(cursor);
+	}
+
 	return false;
 }
 
diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h
index dec7e2d44885..1bcbefc0c325 100644
--- a/tools/perf/util/symbol.h
+++ b/tools/perf/util/symbol.h
@@ -58,6 +58,7 @@ struct symbol {
 	u16		namelen;
 	u8		binding;
 	u8		idle:1;
+	u8		ignore:1;
 	u8		arch_sym;
 	char		name[0];
 };
-- 
2.10.0

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

end of thread, other threads:[~2016-11-26  3:38 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-24  1:11 [PATCH 1/3] perf sched timehist: Mark schedule function in callchains Namhyung Kim
2016-11-24  1:11 ` [PATCH 2/3] perf tools: Add option to skip ignore symbol when printing callchains Namhyung Kim
2016-11-25 17:19   ` [tip:perf/core] perf callchain: " tip-bot for Namhyung Kim
2016-11-24  1:11 ` [PATCH 3/3] perf sched timehist: Enlarge max stack depth by 2 Namhyung Kim
2016-11-25 17:20   ` [tip:perf/core] " tip-bot for Namhyung Kim
2016-11-24  3:13 ` [PATCH 1/3] perf sched timehist: Mark schedule function in callchains David Ahern
2016-11-24  6:30   ` Namhyung Kim
2016-11-26  3:38     ` David Ahern
2016-11-25 13:43 ` Arnaldo Carvalho de Melo
2016-11-25 17:19 ` [tip:perf/core] " tip-bot for Namhyung Kim

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.