public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Frederic Weisbecker <fweisbec@gmail.com>
To: David Ahern <dsahern@gmail.com>
Cc: acme@ghostprotocols.net, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] perf script: Print callchains and symbols if they exist - v2
Date: Wed, 20 Nov 2013 14:04:27 +0100	[thread overview]
Message-ID: <20131120130426.GB308@localhost.localdomain> (raw)
In-Reply-To: <1384920457-5986-1-git-send-email-dsahern@gmail.com>

On Tue, Nov 19, 2013 at 09:07:37PM -0700, David Ahern wrote:
> The intent of perf-script is to dump the events and information
> in the file. H/W, S/W and raw events all dump callchains if they
> are present; might as well make that the default for tracepoints
> too.
> 
> v2: Only add options for sym, dso and ip if callchains are present
> 
> Signed-off-by: David Ahern <dsahern@gmail.com>
> Cc: Frederic Weisbecker <fweisbec@gmail.com>

Thanks, looks good, just a few things:

> ---
>  tools/perf/builtin-script.c | 24 ++++++++++++++++++++++++
>  1 file changed, 24 insertions(+)
> 
> diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
> index b392770766dd..9f3ba4404a14 100644
> --- a/tools/perf/builtin-script.c
> +++ b/tools/perf/builtin-script.c
> @@ -280,6 +280,30 @@ static int perf_session__check_output_opt(struct perf_session *session)
>  		set_print_ip_opts(&evsel->attr);
>  	}
>  
> +	/*
> +	 * set default for tracepoints to print symbols only
> +	 * if callchains are present
> +	 */
> +	if (symbol_conf.use_callchain &&
> +	    !output[PERF_TYPE_TRACEPOINT].user_set) {
> +		struct perf_event_attr *attr;
> +
> +		j = PERF_TYPE_TRACEPOINT;
> +		evsel = perf_session__find_first_evtype(session, j);
> +		if (evsel == NULL)
> +			goto out;
> +
> +		attr = &evsel->attr;
> +
> +		if (attr->sample_type & PERF_SAMPLE_CALLCHAIN) {
> +			output[j].fields |= PERF_OUTPUT_IP;
> +			output[j].fields |= PERF_OUTPUT_SYM;
> +			output[j].fields |= PERF_OUTPUT_DSO;
> +			set_print_ip_opts(attr);

We probably want to avoid DSO and IP for most tracepoints. For kernel
tracepoints dso is going to be the kernel anyway and IP is often not that relevant
either.

tracepoint already carries a lot of informations and it's better to avoid any noise.

Thanks.

> +		}
> +	}
> +
> +out:
>  	return 0;
>  }
>  
> -- 
> 1.8.3.4 (Apple Git-47)
> 

  reply	other threads:[~2013-11-20 13:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-20  4:07 [PATCH] perf script: Print callchains and symbols if they exist - v2 David Ahern
2013-11-20 13:04 ` Frederic Weisbecker [this message]
2013-11-20 14:09   ` David Ahern
2013-11-30 12:52 ` [tip:perf/core] perf script: Print callchains and symbols if they exist tip-bot for David Ahern

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=20131120130426.GB308@localhost.localdomain \
    --to=fweisbec@gmail.com \
    --cc=acme@ghostprotocols.net \
    --cc=dsahern@gmail.com \
    --cc=linux-kernel@vger.kernel.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