Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp862715ybk; Wed, 20 May 2020 14:03:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzsNKJQj4Hrg3cLgLD0b1HbYt9ujibKP7mYx2Q42d1qrz3DgRsCyakTToEYC0KokEDUk+Y4 X-Received: by 2002:a17:906:580e:: with SMTP id m14mr825005ejq.447.1590008629390; Wed, 20 May 2020 14:03:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590008629; cv=none; d=google.com; s=arc-20160816; b=uBL+PnpoiDLp1wJOHT5MwXbzrU80gxAVZcHWt+OgBjSJvRi/MX9Xz7nWn9wuTX6fWq 0URmsJh9PgoIVPh4FTlI8GT2f2Oram6DMl4/eF4lUqujy5/SNa0wWv96Cx0K+pCJ5K9U 4mb7ry7PASTDzgHvYG1aRFY+RaLcJewSaD2Opp57rQwrVKiYiUlDm2Ho9O9VHKWcKYzU 4B+Th/7AgKgNPn1cfyhKhVwUOJQsIODiAcZDrzhC4/alv88rqUwUcUh6Rc8ri2CZy61q Y3jMJElWVZatjPO/4BpNxVYdsCZwcoCQNbt4W27uR8w8A3Td5+Bct+e6HwpgNj4spT68 5wAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=70EgzgqatVuBKOFbNT6n2rv6RVOahFx1OwKcmqmA3aE=; b=SX8JI1tStfUpIbAjVqV7Kqe2EUCNqkaGIvYopqUQjSxZttUeG49P0OaWt9y5dPQWQE /fhPA2Cj5hRpang1vO4g++9Ceetqvgf9TJAdB7FQ87XS4QK/9vH35ETIMeE/6O6Ewdgv dON8wTXxFZ7FiCuBcQI3/HqiZSV1Zr2eTlXUVEMIMrSJ63SauFMA7A4dWQTfQZTEBCL0 1oOCzLkJV7ioljUeLVInafyoDc2/cdj9rDDW8V2YXeiaU4jYfCBB7M2Q5akIjMbHxcVr 0zINjuowJPxToiIKFJQehIlKRn66XD4OtqQ6H4SE8zReVoQIF3ofa/yfSOCwfaFjIQ1A w4hA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=eR++PXJo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k11si2238608edj.518.2020.05.20.14.03.26; Wed, 20 May 2020 14:03:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=eR++PXJo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728267AbgETVBY (ORCPT + 99 others); Wed, 20 May 2020 17:01:24 -0400 Received: from mail.kernel.org ([198.145.29.99]:60158 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727083AbgETVBX (ORCPT ); Wed, 20 May 2020 17:01:23 -0400 Received: from quaco.ghostprotocols.net (unknown [179.97.37.151]) (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 BE59C20829; Wed, 20 May 2020 21:01:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1590008482; bh=DXBohV2cwrznWunItONX0BOZAXRxsaxcI8aYj2nW/Io=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=eR++PXJopPFqFOEUk8v15A8bB4GjT4YG0dNnx7uPaq6UrlST1IYf8owl4TRao9PTO 2mxEXBUjPGDFoSwul4MC5zrnIl0CMTEuZbvZwFE2BP/cg8eZ0Lv3mY3TIclw5O443T u7uuvWf8xUWCW14ftKidrWF+5C+hwonZjSDusmmI= Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id C701840AFD; Wed, 20 May 2020 18:01:20 -0300 (-03) Date: Wed, 20 May 2020 18:01:20 -0300 From: Arnaldo Carvalho de Melo To: Changbin Du Cc: Jiri Olsa , Peter Zijlstra , Ingo Molnar , Namhyung Kim , Steven Rostedt , linux-kernel@vger.kernel.org Subject: Re: [PATCH 07/19] perf ftrace: add support for trace option funcgraph-irqs Message-ID: <20200520210120.GU32678@kernel.org> References: <20200510150628.16610-1-changbin.du@gmail.com> <20200510150628.16610-8-changbin.du@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200510150628.16610-8-changbin.du@gmail.com> X-Url: http://acmel.wordpress.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Sun, May 10, 2020 at 11:06:16PM +0800, Changbin Du escreveu: > This adds an option '--nofuncgraph-irqs' to filter out functions executed > in irq context. Ditto > Signed-off-by: Changbin Du > --- > tools/perf/builtin-ftrace.c | 20 ++++++++++++++++++++ > 1 file changed, 20 insertions(+) > > diff --git a/tools/perf/builtin-ftrace.c b/tools/perf/builtin-ftrace.c > index d3fcf3b0b792..b16600a16efa 100644 > --- a/tools/perf/builtin-ftrace.c > +++ b/tools/perf/builtin-ftrace.c > @@ -41,6 +41,7 @@ struct perf_ftrace { > int graph_depth; > bool func_stack_trace; > bool nosleep_time; > + bool nofuncgraph_irqs; > }; > > struct filter_entry { > @@ -188,6 +189,7 @@ static void reset_tracing_options(struct perf_ftrace *ftrace __maybe_unused) > { > write_tracing_option_file("func_stack_trace", "0"); > write_tracing_option_file("sleep-time", "1"); > + write_tracing_option_file("funcgraph-irqs", "1"); > } > > static int reset_tracing_files(struct perf_ftrace *ftrace __maybe_unused) > @@ -358,6 +360,17 @@ static int set_tracing_sleep_time(struct perf_ftrace *ftrace) > return 0; > } > > +static int set_tracing_funcgraph_irqs(struct perf_ftrace *ftrace) > +{ > + if (!ftrace->nofuncgraph_irqs) > + return 0; > + > + if (write_tracing_option_file("funcgraph-irqs", "0") < 0) > + return -1; > + > + return 0; > +} > + > static int __cmd_ftrace(struct perf_ftrace *ftrace, int argc, const char **argv) > { > char *trace_file; > @@ -431,6 +444,11 @@ static int __cmd_ftrace(struct perf_ftrace *ftrace, int argc, const char **argv) > goto out_reset; > } > > + if (set_tracing_funcgraph_irqs(ftrace) < 0) { > + pr_err("failed to set tracing option funcgraph-irqs\n"); > + goto out_reset; > + } > + > if (write_tracing_file("current_tracer", ftrace->tracer) < 0) { > pr_err("failed to set current_tracer to %s\n", ftrace->tracer); > goto out_reset; > @@ -568,6 +586,8 @@ int cmd_ftrace(int argc, const char **argv) > "Max depth for function graph tracer"), > OPT_BOOLEAN(0, "nosleep-time", &ftrace.nosleep_time, > "Measure on-CPU time only (function_graph only)"), > + OPT_BOOLEAN(0, "nofuncgraph-irqs", &ftrace.nofuncgraph_irqs, > + "Ignore functions that happen inside interrupt (function_graph only)"), > OPT_END() > }; > > -- > 2.25.1 > -- - Arnaldo