From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936356AbcKXBLU (ORCPT ); Wed, 23 Nov 2016 20:11:20 -0500 Received: from LGEAMRELO13.lge.com ([156.147.23.53]:55888 "EHLO lgeamrelo13.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S936186AbcKXBLT (ORCPT ); Wed, 23 Nov 2016 20:11:19 -0500 X-Original-SENDERIP: 156.147.1.121 X-Original-MAILFROM: namhyung@kernel.org X-Original-SENDERIP: 10.177.227.17 X-Original-MAILFROM: namhyung@kernel.org From: Namhyung Kim To: Arnaldo Carvalho de Melo Cc: Ingo Molnar , Peter Zijlstra , Jiri Olsa , LKML , David Ahern , Stephane Eranian , Andi Kleen Subject: [PATCH 1/3] perf sched timehist: Mark schedule function in callchains Date: Thu, 24 Nov 2016 10:11:12 +0900 Message-Id: <20161124011114.7102-1-namhyung@kernel.org> X-Mailer: git-send-email 2.10.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Signed-off-by: Namhyung Kim --- 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