From: Namhyung Kim <namhyung@kernel.org>
To: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Ingo Molnar <mingo@kernel.org>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Jiri Olsa <jolsa@kernel.org>, LKML <linux-kernel@vger.kernel.org>,
David Ahern <dsahern@gmail.com>,
Stephane Eranian <eranian@google.com>,
Andi Kleen <andi@firstfloor.org>
Subject: [PATCH 1/3] perf sched timehist: Mark schedule function in callchains
Date: Thu, 24 Nov 2016 10:11:12 +0900 [thread overview]
Message-ID: <20161124011114.7102-1-namhyung@kernel.org> (raw)
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
next reply other threads:[~2016-11-24 1:11 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-24 1:11 Namhyung Kim [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20161124011114.7102-1-namhyung@kernel.org \
--to=namhyung@kernel.org \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@kernel.org \
--cc=andi@firstfloor.org \
--cc=dsahern@gmail.com \
--cc=eranian@google.com \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox