Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp864868ybk; Wed, 20 May 2020 14:07:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyNkGs5nUjhOXNVhB08gUZs8U9bG3HP/QY35Jxb+eSRhUxM0aVvd+GKFATs+0sPF25NzgLr X-Received: by 2002:a50:9f85:: with SMTP id c5mr5207461edf.72.1590008826486; Wed, 20 May 2020 14:07:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590008826; cv=none; d=google.com; s=arc-20160816; b=DfJa7qs5bIQ8oMnBi5EzSOukg5YC2cZtarmnpdSwZ+zSIIFKcsn4rLS0bVHvHnia56 XkHCsaWRaBoEt+07S87IQ8oesOts0ruACHwK4cIQhjuziDutCF0ZrNbJg3yMvw4PgFHl 0bQiV4kDPztJvL5Y5/GDL9LaEB7pPEbknj+fCqr3nS2KixScos5R/HeB7B2hG7YdBGaP 2rAa1IcPtZx3MkCg+YSYs7BO5zdn3AmBYRfqLGYOtO7H0zm/zu4KUctHwEecA8U5hFUj 7HIuWA+QwP6ArA32gS8kD6pwFRXeM+BR12neOTsN1HaphwxvQ5QRzq271cmrmA80MDf7 /WEw== 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=hQn7FThgdmbSZh0CGywf/h4OwmXaw6/znv/oWNh5ENc=; b=xkAz35qY50C7H6Xk1dIsRSjvl+hMCEOCrHgNwfDeKIfK061cDp70MB4UoEeo+jplOX v6f++XKW9jL/98IkhXv0gIRgG2RH9VJVtOETx2wrPN3D1Mm0IhD+IKP0MTqu30FZndK6 GGOiAYim/AxESc4Gc/AiKWfE9WqRzmY44o7OL9DcvEvmWxA2pJITAKgtrJAvPX4u3n+2 15fEQQZIsnbzqO4eRyG6Q5p6TrFAtXFpTce+IBzhLUIXv+Zjb4+mGcKWVyFaM0stRu48 g1+h26iGlE6cUCEoej3kOv6AkucW/crj0Z1W6MaVf2VHzELseGxHWnLdejT2nxAbRogB wr1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=MGjhZcuc; 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 b5si2073354edu.182.2020.05.20.14.06.44; Wed, 20 May 2020 14:07:06 -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=MGjhZcuc; 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 S1728292AbgETVDX (ORCPT + 99 others); Wed, 20 May 2020 17:03:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:60882 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727018AbgETVDW (ORCPT ); Wed, 20 May 2020 17:03:22 -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 1AD152075F; Wed, 20 May 2020 21:03:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1590008602; bh=3QQqkiL/Wq+P9b7IHABz7d6wo/sD34RjgCJ5hpdImVk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=MGjhZcuclXtGTWVSKJFfCcKa75Etu3LP8o0Fz8qJD761gGPHPgLGBentj8K0+4jqM bFiHwFnnNfpK3OzXvy/di5CFU4uxmRujFsWL5y7z+auGMeesXhdzxKObcy5QCLFMMI pRGAoBhaswvgNd6Re3ixYMAgu4eXm9IqeiF32eeQ= Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 22C8140AFD; Wed, 20 May 2020 18:03:20 -0300 (-03) Date: Wed, 20 May 2020 18:03: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 10/19] perf ftrace: add support for trace option funcgraph-tail Message-ID: <20200520210320.GX32678@kernel.org> References: <20200510150628.16610-1-changbin.du@gmail.com> <20200510150628.16610-11-changbin.du@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200510150628.16610-11-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:19PM +0800, Changbin Du escreveu: > This adds an option '--funcgraph-tail' for function graph tracer. 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 20bc14d6c5fb..2ef5d1c4b23c 100644 > --- a/tools/perf/builtin-ftrace.c > +++ b/tools/perf/builtin-ftrace.c > @@ -42,6 +42,7 @@ struct perf_ftrace { > bool func_stack_trace; > bool nosleep_time; > bool nofuncgraph_irqs; > + bool funcgraph_tail; > bool long_info; > unsigned tracing_thresh; > }; > @@ -192,6 +193,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"); > + write_tracing_option_file("funcgraph-tail", "0"); > write_tracing_option_file("funcgraph-proc", "0"); > write_tracing_option_file("funcgraph-abstime", "0"); > write_tracing_option_file("irq-info", "0"); > @@ -411,6 +413,17 @@ static int set_tracing_thresh(struct perf_ftrace *ftrace) > return 0; > } > > +static int set_tracing_funcgraph_tail(struct perf_ftrace *ftrace) > +{ > + if (!ftrace->funcgraph_tail) > + return 0; > + > + if (write_tracing_option_file("funcgraph-tail", "1") < 0) > + return -1; > + > + return 0; > +} > + > static int __cmd_ftrace(struct perf_ftrace *ftrace, int argc, const char **argv) > { > char *trace_file; > @@ -499,6 +512,11 @@ static int __cmd_ftrace(struct perf_ftrace *ftrace, int argc, const char **argv) > goto out_reset; > } > > + if (set_tracing_funcgraph_tail(ftrace) < 0) { > + pr_err("failed to set tracing option funcgraph-tail\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; > @@ -638,6 +656,8 @@ int cmd_ftrace(int argc, const char **argv) > "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_BOOLEAN(0, "funcgraph-tail", &ftrace.funcgraph_tail, > + "Show function tails comment (function_graph only)"), > OPT_BOOLEAN('l', "long-info", &ftrace.long_info, > "Show process names, PIDs, timestamps, irq-info if available"), > OPT_UINTEGER(0, "tracing-thresh", &ftrace.tracing_thresh, > -- > 2.25.1 > -- - Arnaldo