From patchwork Tue Jul 17 02:03:12 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Cross X-Patchwork-Id: 1202751 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id 014FA3FC33 for ; Tue, 17 Jul 2012 02:06:07 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1Sqx8J-0003xn-H4; Tue, 17 Jul 2012 02:03:27 +0000 Received: from mail-yx0-f201.google.com ([209.85.213.201]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1Sqx8D-0003xZ-2R for linux-arm-kernel@lists.infradead.org; Tue, 17 Jul 2012 02:03:22 +0000 Received: by yenl11 with SMTP id l11so632046yen.0 for ; Mon, 16 Jul 2012 19:03:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:x-gm-message-state; bh=hNptvF33bOkb0suvpHpfpCEx0gfwgK2O4FhJfDvYYGo=; b=B7efhAYyJVu64nXK03mmRtm3mAfWpSmorDHKGz0Dng28FGh40X1X5qkD0wgrza8bsJ Og7L3oubSKXI0L4SOpJz8BfMllFZyYZlYtPfJP5/xO6ai3pFGxKKLGTWWfKvnrK7OsnT C+4Ldd4vkkc+YjU5kFHvxzPsLVWagZR1zmNwLv7vubAHwHPEbz6IT1RE/jUE9zqYbzy0 XJQy3FxRe24xS5TCS0TLu/Kt66NeegLM2OMrzct5A1nH6GK51/dx4gdOVjiW4BmCo0Rm asZYHBcbc4SkfxKBDxmT7XmnQOFhdNt5a46yYcNq1nqZWKsQQzYYe99/N7y5fIbH1ZO+ t4pg== Received: by 10.236.189.36 with SMTP id b24mr1430454yhn.9.1342490595745; Mon, 16 Jul 2012 19:03:15 -0700 (PDT) Received: by 10.236.189.36 with SMTP id b24mr1430439yhn.9.1342490595698; Mon, 16 Jul 2012 19:03:15 -0700 (PDT) Received: from wpzn4.hot.corp.google.com (216-239-44-65.google.com [216.239.44.65]) by gmr-mx.google.com with ESMTPS id w40si1840543anp.3.2012.07.16.19.03.15 (version=TLSv1/SSLv3 cipher=AES128-SHA); Mon, 16 Jul 2012 19:03:15 -0700 (PDT) Received: from walnut.mtv.corp.google.com (walnut.mtv.corp.google.com [172.18.104.116]) by wpzn4.hot.corp.google.com (Postfix) with ESMTP id 9498B1E0043; Mon, 16 Jul 2012 19:03:15 -0700 (PDT) Received: by walnut.mtv.corp.google.com (Postfix, from userid 99897) id 36EAB257928; Mon, 16 Jul 2012 19:03:15 -0700 (PDT) From: Colin Cross To: linux-arm-kernel@lists.infradead.org Subject: [PATCH] ARM: ftrace: Trace function entry before updating index Date: Mon, 16 Jul 2012 19:03:12 -0700 Message-Id: <1342490592-20373-1-git-send-email-ccross@android.com> X-Mailer: git-send-email 1.7.7.3 X-Gm-Message-State: ALoCoQl3fnjzVhaI9bXWkuE7cdufvR+0kjiDAvtWf2Cr7GEIgS5WpfDw8HsiKqQ5uNXxHyd5GWm+IhXr1Ro/f5TQt6NnYu10QJF+5qNyyc1fvJVTyUbeATi7b1J/uO+RcZAkGuKV8rXNvGm8CQz1vcgk+KE2LYmnZZgSPNzh0J7e5sWQe824094ErcPmUkAMLohZciEd0VeXRvDVE6Yg7HQU3RjR3YVmaw== X-Spam-Note: CRM114 invocation failed X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.213.201 listed in list.dnswl.org] -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Russell King , Frederic Weisbecker , linux-kernel@vger.kernel.org, Steven Rostedt , Ingo Molnar , Colin Cross X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Commit 722b3c74695377d11d18a52f3da08114d37f3f37 modified x86 ftrace to avoid tracing all functions called from irqs when function graph was used with a filter. Port the same fix to ARM. Cc: Steven Rostedt Signed-off-by: Colin Cross Acked-by: Steven Rostedt --- It looks like the same issue affects blackfin, microblaze, mips, parisc, powerpc, s390, sh, and sparc, but I don't have patches to fix those. arch/arm/kernel/ftrace.c | 17 +++++++++-------- 1 files changed, 9 insertions(+), 8 deletions(-) diff --git a/arch/arm/kernel/ftrace.c b/arch/arm/kernel/ftrace.c index df0bf0c..34e5664 100644 --- a/arch/arm/kernel/ftrace.c +++ b/arch/arm/kernel/ftrace.c @@ -179,19 +179,20 @@ void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr, old = *parent; *parent = return_hooker; - err = ftrace_push_return_trace(old, self_addr, &trace.depth, - frame_pointer); - if (err == -EBUSY) { - *parent = old; - return; - } - trace.func = self_addr; + trace.depth = current->curr_ret_stack + 1; /* Only trace if the calling function expects to */ if (!ftrace_graph_entry(&trace)) { - current->curr_ret_stack--; *parent = old; + return; + } + + err = ftrace_push_return_trace(old, self_addr, &trace.depth, + frame_pointer); + if (err == -EBUSY) { + *parent = old; + return; } }