mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: James Clark <james.clark@linaro.org>
To: Namhyung Kim <namhyung@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>,
	Adrian Hunter <adrian.hunter@intel.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	linux-perf-users@vger.kernel.org,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Ian Rogers <irogers@google.com>,
	Kan Liang <kan.liang@linux.intel.com>
Subject: Re: [PATCH 2/3] perf ftrace: Add --graph-opts option to profile subcommand
Date: Tue, 7 Jan 2025 14:48:58 +0000	[thread overview]
Message-ID: <d6cc9e4b-7a38-4673-9c2a-d97301a7fdfa@linaro.org> (raw)
In-Reply-To: <20250103231630.928815-2-namhyung@kernel.org>



On 03/01/2025 11:16 pm, Namhyung Kim wrote:
> Like trace subcommand, it should be able to pass some options to control
> the tracing behavior for the function graph tracer.  But some options
> are limited in order to maintain the internal behavior.
> 
> For example, it can limit the function call depth like below:
> 
>    # perf ftrace profile --graph-opts depth=5 -- myprog
> 
> Signed-off-by: Namhyung Kim <namhyung@kernel.org>
> ---
>   tools/perf/Documentation/perf-ftrace.txt | 8 ++++++++
>   tools/perf/builtin-ftrace.c              | 4 ++++
>   2 files changed, 12 insertions(+)
> 

Reviewed-by: James Clark <james.clark@linaro.org>

> diff --git a/tools/perf/Documentation/perf-ftrace.txt b/tools/perf/Documentation/perf-ftrace.txt
> index 16b067eb5d84746d..4a69a1135f07341b 100644
> --- a/tools/perf/Documentation/perf-ftrace.txt
> +++ b/tools/perf/Documentation/perf-ftrace.txt
> @@ -205,6 +205,14 @@ OPTIONS for 'perf ftrace profile'
>   	Sort the result by the given field.  Available values are:
>   	total, avg, max, count, name.  Default is 'total'.
>   
> +--graph-opts::
> +	List of options allowed to set:
> +
> +	  - nosleep-time - Measure on-CPU time only for function_graph tracer.
> +	  - noirqs       - Ignore functions that happen inside interrupt.
> +	  - thresh=<n>   - Setup trace duration threshold in microseconds.
> +	  - depth=<n>    - Set max depth for function graph tracer to follow.
> +
>   
>   SEE ALSO
>   --------
> diff --git a/tools/perf/builtin-ftrace.c b/tools/perf/builtin-ftrace.c
> index 0ac2b20b272bd790..d747cca2403e494e 100644
> --- a/tools/perf/builtin-ftrace.c
> +++ b/tools/perf/builtin-ftrace.c
> @@ -1072,6 +1072,7 @@ static int prepare_func_profile(struct perf_ftrace *ftrace)
>   {
>   	ftrace->tracer = "function_graph";
>   	ftrace->graph_tail = 1;
> +	ftrace->graph_verbose = 0;
>   
>   	ftrace->profile_hash = hashmap__new(profile_hash, profile_equal, NULL);
>   	if (ftrace->profile_hash == NULL)
> @@ -1660,6 +1661,9 @@ int cmd_ftrace(int argc, const char **argv)
>   	OPT_CALLBACK('s', "sort", &profile_sort, "key",
>   		     "Sort result by key: total (default), avg, max, count, name.",
>   		     parse_sort_key),
> +	OPT_CALLBACK(0, "graph-opts", &ftrace, "options",
> +		     "Graph tracer options, available options: nosleep-time,noirqs,thresh=<n>,depth=<n>",
> +		     parse_graph_tracer_opts),
>   	OPT_PARENT(common_options),
>   	};
>   	const struct option *options = ftrace_options;


  reply	other threads:[~2025-01-07 14:49 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-03 23:16 [PATCH 1/3] perf ftrace: Add --stats option to latency subcommand Namhyung Kim
2025-01-03 23:16 ` [PATCH 2/3] perf ftrace: Add --graph-opts option to profile subcommand Namhyung Kim
2025-01-07 14:48   ` James Clark [this message]
2025-01-03 23:16 ` [PATCH 3/3] perf test: Update ftrace test to use --graph-opts Namhyung Kim
2025-01-07 14:49   ` James Clark
2025-01-06 17:14 ` [PATCH 1/3] perf ftrace: Add --stats option to latency subcommand James Clark
2025-01-06 21:36   ` Namhyung Kim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d6cc9e4b-7a38-4673-9c2a-d97301a7fdfa@linaro.org \
    --to=james.clark@linaro.org \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=irogers@google.com \
    --cc=jolsa@kernel.org \
    --cc=kan.liang@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®