Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp335453pxa; Fri, 14 Aug 2020 05:51:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxO1RH0B0wkAjE4xc0lBkTiN6KZy53dgZTLpT4FULysCCtyJDX0BL4zR+NojBr754XnMMV7 X-Received: by 2002:a17:906:eceb:: with SMTP id qt11mr2113015ejb.519.1597409475170; Fri, 14 Aug 2020 05:51:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597409475; cv=none; d=google.com; s=arc-20160816; b=JWbFZV0tNiJLzgAyZwThvDaXQ9EbWDiU+t4cdHo0x4WVBQyDxAc62c1qf6CPbMMlw5 5mK8GfQSF7dMSJwHklRFVT5ChvjszUbmEvNCBxHD366cTr8S+7ghf81R8gZar74fB7Tx Y6VfEQNIflKntjiYTjijUPrVjUMbkSurUZyo60/CYimdT0cCENqTTuVxT21eGBsbx2Sk 1/dSvvXXQ4EgZIcO/Ge8z+PYjfTPQXLnBlHqIhen0ht8wBS+k/kmKMa3bSU3O75VW86Y p9IwYouCn4O5SRdVrFzEBU5Ew4KWgOTwUlpA2SUlVLZh6pAgjlvZ/WbIxwivyYeAtx+Z 6d4A== 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=ChMffxKk8teYCQQ+imH3/t7fpRdTkS1e5zXXF8aYYoc=; b=WZJrtST+Y163uVDCILcP6hju+JZHnCRMu7OqGxNgKoXy8QnvmU6eRFA0THxgUeJOKv ZDfgm/OjFoR86IbAluWmL86c0ZBsytpZw1gY82DA2mOJWms25ru+hD66NbMffO2CtoG3 KxlK3SmK+cRtTR2+p7ngJF4UKhSRDwiGmbF6n/4F0ObI9PlA7JzP/GwY/UXX/U0dN0wi DcW5D8QytPXMkTvI/odq8pIoITer2INM1qGizvEZ39m5A6oTd4gYYzFyGaVVt+MbAmhR TiuCipQ9N1zRuv1hOH34wlEVMF0OZVQ8CNAH9XWSb7jHfj8MLTOG5zSDxPIVo8eZiPFU qmJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="X36Byv/Q"; 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 y7si4882100ejr.228.2020.08.14.05.50.51; Fri, 14 Aug 2020 05:51:15 -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="X36Byv/Q"; 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 S1728139AbgHNM2Y (ORCPT + 99 others); Fri, 14 Aug 2020 08:28:24 -0400 Received: from mail.kernel.org ([198.145.29.99]:49962 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726313AbgHNM2L (ORCPT ); Fri, 14 Aug 2020 08:28:11 -0400 Received: from quaco.ghostprotocols.net (177.207.136.251.dynamic.adsl.gvt.net.br [177.207.136.251]) (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 3878E20866; Fri, 14 Aug 2020 12:28:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597408090; bh=P7av6s6abXr/7wGMfslLn8S1fP4ii34kLGB77dbKxL4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=X36Byv/QPmZ8n9I/VjyV2N334zGlawYGTDj76Y+bG1WkvGfn1zR4BvxvcUjfqaeuB qKOCOipvUmpScTWFVPuU+AFaev57FVpYJDc+AGR6tDN7nt8Tj6gRf/w3KL5/bcOX/c o4axnltwC0ZJgIsEGcHTqfeTjdJEStQBZgtwAKN0= Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 81AE040D3D; Fri, 14 Aug 2020 09:28:07 -0300 (-03) Date: Fri, 14 Aug 2020 09:28:07 -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 v8 11/18] perf ftrace: add support for tracing option 'irq-info' Message-ID: <20200814122807.GB13995@kernel.org> References: <20200808023141.14227-1-changbin.du@gmail.com> <20200808023141.14227-12-changbin.du@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200808023141.14227-12-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 Sat, Aug 08, 2020 at 10:31:34AM +0800, Changbin Du escreveu: > This adds support to display irq context info for function tracer. To do > this, just specify a '--func-opts irq-info' option. Applied, ditto about adding an example to perf-ftrace.txt > Signed-off-by: Changbin Du > --- > tools/perf/Documentation/perf-ftrace.txt | 1 + > tools/perf/builtin-ftrace.c | 21 ++++++++++++++++++++- > 2 files changed, 21 insertions(+), 1 deletion(-) > > diff --git a/tools/perf/Documentation/perf-ftrace.txt b/tools/perf/Documentation/perf-ftrace.txt > index fca55ac55ff3..37ea3ea97922 100644 > --- a/tools/perf/Documentation/perf-ftrace.txt > +++ b/tools/perf/Documentation/perf-ftrace.txt > @@ -79,6 +79,7 @@ OPTIONS > --func-opts:: > List of options allowed to set: > call-graph - Display kernel stack trace for function tracer. > + irq-info - Display irq context info for function tracer. > > -G:: > --graph-funcs=:: > diff --git a/tools/perf/builtin-ftrace.c b/tools/perf/builtin-ftrace.c > index b4c821be4fb5..d1241febe143 100644 > --- a/tools/perf/builtin-ftrace.c > +++ b/tools/perf/builtin-ftrace.c > @@ -44,6 +44,7 @@ struct perf_ftrace { > unsigned long percpu_buffer_size; > bool inherit; > int func_stack_trace; > + int func_irq_info; > int graph_nosleep_time; > int graph_noirqs; > }; > @@ -209,6 +210,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("irq-info", "0"); > } > > static int reset_tracing_files(struct perf_ftrace *ftrace __maybe_unused) > @@ -296,6 +298,17 @@ static int set_tracing_func_stack_trace(struct perf_ftrace *ftrace) > return 0; > } > > +static int set_tracing_func_irqinfo(struct perf_ftrace *ftrace) > +{ > + if (!ftrace->func_irq_info) > + return 0; > + > + if (write_tracing_option_file("irq-info", "1") < 0) > + return -1; > + > + return 0; > +} > + > static int reset_tracing_cpu(void) > { > struct perf_cpu_map *cpumap = perf_cpu_map__new(NULL); > @@ -471,6 +484,11 @@ static int __cmd_ftrace(struct perf_ftrace *ftrace, int argc, const char **argv) > goto out_reset; > } > > + if (set_tracing_func_irqinfo(ftrace) < 0) { > + pr_err("failed to set tracing option irq-info\n"); > + goto out_reset; > + } > + > if (set_tracing_filters(ftrace) < 0) { > pr_err("failed to set tracing filters\n"); > goto out_reset; > @@ -660,6 +678,7 @@ static int parse_func_tracer_opts(const struct option *opt, > struct perf_ftrace *ftrace = (struct perf_ftrace *) opt->value; > struct sublevel_option func_tracer_opts[] = { > { .name = "call-graph", .value_ptr = &ftrace->func_stack_trace }, > + { .name = "irq-info", .value_ptr = &ftrace->func_irq_info }, > { .name = NULL, } > }; > > @@ -742,7 +761,7 @@ int cmd_ftrace(int argc, const char **argv) > OPT_CALLBACK('N', "notrace-funcs", &ftrace.notrace, "func", > "do not trace given functions", parse_filter_func), > OPT_CALLBACK(0, "func-opts", &ftrace, "options", > - "function tracer options, available options: call-graph", > + "function tracer options, available options: call-graph,irq-info", > parse_func_tracer_opts), > OPT_CALLBACK('G', "graph-funcs", &ftrace.graph_funcs, "func", > "trace given functions using function_graph tracer", > -- > 2.25.1 > -- - Arnaldo