Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp863382ybk; Wed, 20 May 2020 14:04:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxjrShZBv6uzeNgpSmpbEM3jSTAik7s3zrZSlJlg7iInYgRfha0MgM/i1Sb2ar1v9GQiR+o X-Received: by 2002:a17:906:82d9:: with SMTP id a25mr859010ejy.43.1590008688759; Wed, 20 May 2020 14:04:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590008688; cv=none; d=google.com; s=arc-20160816; b=hCVWGAUb46wdJ+uupNJ4eEqmkLvYpljDUkkQF8wd+kedGi5nTPrBRHzGpuWMoC/kXr qb01jc3pKVZ2FZPA8DT/I7IJu3JUthoGFchcJKePx4Xb9oeSKvN2lQGaEagmb9mYYdJ9 PugAe99oDByEt9NMG5qyVyLq5sU2wnLpMavBDpZd/V/GExPgGDYwv3dpZg7nD7wyahJv xVCzdFS7FKM6lrkhTjQ1miZS70jt/060C61bH4Dw3L1jN3UrpZ3+3E8U4Ohm25vJgWmO glcApRFMA44XAhw/tUc0oGqxWWowchtqSGnRqbw099cleQKsna/7s86ZeDRBPAAjk6SQ v7bA== 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=ODglELCWNhZLPjmcR5tfBV8Crz4pvpEqXExhgWmifB8=; b=SLLknTLmM4oJRuTsbw11QKzhkycg0xlo4kbAr3xtkT3OvrxjHCryG4ULln3Vtl0Oqh 9PQnH1UiJJmD61Hx9RuoYblpImX/KmcBRKlZzek9WfiZvbrcEaYASlLlNd9iaG4yZSGU o7Q0t3VDLiJ/EqttaZ9w/SMEh01zzCjYBoA+OQ3CnoGcM4OUWp2H3qQM0VGn3wxMOnLE LDTkxPTbFXNm9qBiI5JjIkTJn065DdRYEpYcZuF2ylQyLjY1wIsAdZ5Snl6zHbOcO7hn BjdlBUx/s7qbIlaV6V54Frn/DxRN/pgu2xRVYZdYVWlvKHyHbykBxmrZYlovv2ObnKGb 4GtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=qdMfq2ot; 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 ca1si2212361ejb.42.2020.05.20.14.04.25; Wed, 20 May 2020 14:04:48 -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=qdMfq2ot; 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 S1728148AbgETVDC (ORCPT + 99 others); Wed, 20 May 2020 17:03:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:60754 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727067AbgETVDB (ORCPT ); Wed, 20 May 2020 17:03:01 -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 BAB012075F; Wed, 20 May 2020 21:03:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1590008580; bh=uyf+wpnbvMCA+KKkDsZ57pe3xA1JZhzPoaS/ZNfJBhs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=qdMfq2otSnPS3ILIDB3TxZLHbeGCXVEAT5JP4khm2Gfj6z4kpOZjT/wh8hSvNJlqS kJuejX07yPIK6MgcKceR8ukxoKQPMfFoxa3vVYr34LpSTUI9ZjLEqbh5NtBCiUOBNW RRjv6dTZwn34gPEs+JIxCl6Dpwi1v6jNcfmfC9a0= Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id E839240AFD; Wed, 20 May 2020 18:02:57 -0300 (-03) Date: Wed, 20 May 2020 18:02:57 -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 08/19] perf ftrace: add option -l/--long-info to show more info Message-ID: <20200520210257.GV32678@kernel.org> References: <20200510150628.16610-1-changbin.du@gmail.com> <20200510150628.16610-9-changbin.du@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200510150628.16610-9-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:17PM +0800, Changbin Du escreveu: > Sometimes we want ftrace display more and longer information about trace. Humm, -v? Or that would bring too much stuff from other parts of perf? I guess so, perhaps as an option to the function-graph tracer, one that combines, as you do, several options provided by that tracer? - Arnaldo > $ sudo perf ftrace -G -l > 6800.190937 | 4) <...>-7683 | 2.072 us | mutex_unlock(); > 6800.190941 | 4) <...>-7683 | 2.171 us | __fsnotify_parent(); > 6800.190943 | 4) <...>-7683 | 1.497 us | fsnotify(); > 6800.190944 | 4) <...>-7683 | 0.775 us | __sb_end_write(); > 6800.190945 | 4) <...>-7683 | 0.854 us | fpregs_assert_state_consistent(); > 6800.190947 | 4) <...>-7683 | | do_syscall_64() { > 6800.190948 | 4) <...>-7683 | | __x64_sys_close() { > 6800.190948 | 4) <...>-7683 | | __close_fd() { > 6800.190948 | 4) <...>-7683 | 0.322 us | _raw_spin_lock(); > 6800.190949 | 4) <...>-7683 | | filp_close() { > 6800.190949 | 4) <...>-7683 | 0.320 us | dnotify_flush(); > 6800.190950 | 4) <...>-7683 | 0.325 us | locks_remove_posix(); > > Signed-off-by: Changbin Du > --- > tools/perf/builtin-ftrace.c | 28 ++++++++++++++++++++++++++++ > 1 file changed, 28 insertions(+) > > diff --git a/tools/perf/builtin-ftrace.c b/tools/perf/builtin-ftrace.c > index b16600a16efa..f11f2d3431b0 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 long_info; > }; > > struct filter_entry { > @@ -190,6 +191,9 @@ 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-proc", "0"); > + write_tracing_option_file("funcgraph-abstime", "0"); > + write_tracing_option_file("irq-info", "0"); > } > > static int reset_tracing_files(struct perf_ftrace *ftrace __maybe_unused) > @@ -371,6 +375,23 @@ static int set_tracing_funcgraph_irqs(struct perf_ftrace *ftrace) > return 0; > } > > +static int set_tracing_long_info(struct perf_ftrace *ftrace) > +{ > + if (!ftrace->long_info) > + return 0; > + > + if (write_tracing_option_file("funcgraph-proc", "1") < 0) > + return -1; > + > + if (write_tracing_option_file("funcgraph-abstime", "1") < 0) > + return -1; > + > + if (write_tracing_option_file("irq-info", "1") < 0) > + return -1; > + > + return 0; > +} > + > static int __cmd_ftrace(struct perf_ftrace *ftrace, int argc, const char **argv) > { > char *trace_file; > @@ -449,6 +470,11 @@ static int __cmd_ftrace(struct perf_ftrace *ftrace, int argc, const char **argv) > goto out_reset; > } > > + if (set_tracing_long_info(ftrace) < 0) { > + pr_err("failed to set tracing option funcgraph-proc/funcgraph-abstime/irq-info\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; > @@ -588,6 +614,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('l', "long-info", &ftrace.long_info, > + "Show process names, PIDs, timestamps, irq-info if available"), > OPT_END() > }; > > -- > 2.25.1 > -- - Arnaldo