Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp2764300ybh; Mon, 5 Aug 2019 06:29:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqz+51Yb2b7cWCFgYZUWAwZumjB4VBFXtI+ye0GdTs8u6XMQTnVx1g4YX1gLoJ0kCAMIFKm+ X-Received: by 2002:a17:90a:23a4:: with SMTP id g33mr18740436pje.115.1565011758877; Mon, 05 Aug 2019 06:29:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565011758; cv=none; d=google.com; s=arc-20160816; b=chQYlw3qI4BDU6K+B92UicXAAcNhm0lsoyTnqP13OhYT9+tE2CHqF/cywtFPoKq7FO cSe7xNEkJF5+ONrHKTVhwIrRsCxvswoqdTXae6gC4HmhNxwag76S+uPXdAoxZnm0UWtX Ium31tqaWSseCkqH/yPkb4g00Kzxl1SoDoGpwySJZWpIt+3w+p7RtXF6Yo/Di298s9N9 tRKnOUidhLkY/764utMDmpmAnrLe+qDsqih3FgZbixxaBx3hpOaH9vzm63rNxrWCLSXm QQ4P6dwtyigt1Atbwd8viT/MOgglcLaHS9x/NUp7vywK7GhBnRkFdvPDWUl6P+kkttip CoWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=jsPi4/G2q1Oaj805lqnaEZLVQkBKLEWGAKM+vx8e2+4=; b=dVudcUYAKnCO/uz0QM5JfMW2U0w8QBeFy8Mi9ButRoK80iZPta5Nk1btmu+6r9srz4 JDgcPjS8h77pkATgg8MN5TdtZoYKAi9/GtlVhSHqFWfzjWfq7CKgQrJYPr9Ic8xRZdid s+ELnUxYArL78B6wOHdRfwJyvndxHYR17aeNVclV1n01XY4CINYwwmONHr+c8tmF1vlI Gu4SzKuLRCD0I4uTNP6DgWF6NqxeV81VBk8jwMBGrFU99mrOE/CHjBEAqbzH4MKKfXIr 7Mi0kv+/upYDS6v+Kq3Z4nwnPXrqdxnca+1wgCQeBHQ6/LmafPjHE9vxcYW+vGcM5VPC et8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=tqPYfOjb; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n12si22802316pgh.210.2019.08.05.06.29.03; Mon, 05 Aug 2019 06:29:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=tqPYfOjb; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731114AbfHENY7 (ORCPT + 99 others); Mon, 5 Aug 2019 09:24:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:33414 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731105AbfHENYz (ORCPT ); Mon, 5 Aug 2019 09:24:55 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0E99D2075B; Mon, 5 Aug 2019 13:24:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1565011494; bh=tF5l4vY/ZytGIGsA1ZiECEOzN6+zhjA3RpfxlO/nO/M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tqPYfOjbeW2C0shRLwAz/eh6Pxgw+s4OwsEA6HOp0LQzsSaf1brHczWuwngtG0ziy ssFMCsrnPRV9RqKxvTh/yD0PCq3KhsIAW3OmICFDeiVeyHozKkAkTND/z+RSDI4THt pRvQIkLgQqVBib/jx+BFvDCO+c+SjZHHB9laUS2A= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Changbin Du , "Steven Rostedt (VMware)" Subject: [PATCH 5.2 082/131] fgraph: Remove redundant ftrace_graph_notrace_addr() test Date: Mon, 5 Aug 2019 15:02:49 +0200 Message-Id: <20190805124957.435614683@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190805124951.453337465@linuxfoundation.org> References: <20190805124951.453337465@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Changbin Du commit 6c77221df96177da0520847ce91e33f539fb8b2d upstream. We already have tested it before. The second one should be removed. With this change, the performance should have little improvement. Link: http://lkml.kernel.org/r/20190730140850.7927-1-changbin.du@gmail.com Cc: stable@vger.kernel.org Fixes: 9cd2992f2d6c ("fgraph: Have set_graph_notrace only affect function_graph tracer") Signed-off-by: Changbin Du Signed-off-by: Steven Rostedt (VMware) Signed-off-by: Greg Kroah-Hartman --- kernel/trace/trace_functions_graph.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) --- a/kernel/trace/trace_functions_graph.c +++ b/kernel/trace/trace_functions_graph.c @@ -137,6 +137,13 @@ int trace_graph_entry(struct ftrace_grap if (trace_recursion_test(TRACE_GRAPH_NOTRACE_BIT)) return 0; + /* + * Do not trace a function if it's filtered by set_graph_notrace. + * Make the index of ret stack negative to indicate that it should + * ignore further functions. But it needs its own ret stack entry + * to recover the original index in order to continue tracing after + * returning from the function. + */ if (ftrace_graph_notrace_addr(trace->func)) { trace_recursion_set(TRACE_GRAPH_NOTRACE_BIT); /* @@ -156,16 +163,6 @@ int trace_graph_entry(struct ftrace_grap return 0; /* - * Do not trace a function if it's filtered by set_graph_notrace. - * Make the index of ret stack negative to indicate that it should - * ignore further functions. But it needs its own ret stack entry - * to recover the original index in order to continue tracing after - * returning from the function. - */ - if (ftrace_graph_notrace_addr(trace->func)) - return 1; - - /* * Stop here if tracing_threshold is set. We only write function return * events to the ring buffer. */