public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@redhat•com>
To: Sukadev Bhattiprolu <sukadev@linux•vnet.ibm.com>
Cc: linuxppc-dev@ozlabs•org, Anton Blanchard <anton@au1•ibm.com>,
	linux-kernel@vger•kernel.org,
	Arnaldo Carvalho de Melo <acme@kernel•org>,
	michael@ellerman•id.au, Ulrich.Weigand@de•ibm.com,
	Maynard Johnson <mpjohn@us•ibm.com>
Subject: Re: [PATCH v4 1/2]: Allow architectures to skip a callchain entry
Date: Wed, 18 Jun 2014 15:39:37 +0200	[thread overview]
Message-ID: <20140618133937.GC9865@krava.brq.redhat.com> (raw)
In-Reply-To: <20140606032109.GA16600@us.ibm.com>

On Thu, Jun 05, 2014 at 08:21:09PM -0700, Sukadev Bhattiprolu wrote:

SNIP

> index 7409ac8..3f97cf2 100644
> --- a/tools/perf/util/machine.c
> +++ b/tools/perf/util/machine.c
> @@ -1288,8 +1288,10 @@ static int machine__resolve_callchain_sample(struct machine *machine,
>  {
>  	u8 cpumode = PERF_RECORD_MISC_USER;
>  	int chain_nr = min(max_stack, (int)chain->nr);
> +	enum chain_order order = callchain_param.order;
>  	int i;
>  	int err;
> +	int skip_idx;
>  
>  	callchain_cursor_reset(&callchain_cursor);
>  
> @@ -1298,14 +1300,13 @@ static int machine__resolve_callchain_sample(struct machine *machine,
>  		return 0;
>  	}
>  
> +	skip_idx = arch_skip_callchain_idx(machine, thread, chain);
> +
>  	for (i = 0; i < chain_nr; i++) {
>  		u64 ip;
>  		struct addr_location al;
>  
> -		if (callchain_param.order == ORDER_CALLEE)
> -			ip = chain->ips[i];
> -		else
> -			ip = chain->ips[chain->nr - i - 1];
> +		ip = next_callchain_ip(chain, order, i, skip_idx);

hum, I still dont see a point of adding new user
enum API (PERF_CONTEXT_IGNORE) when we can just do:

		#ifdef HAVE_SKIP_CALLCHAIN_IDX
			if (idx == skip_idx)
				continue;
		#endif

		if (callchain_param.order == ORDER_CALLEE)
			ip = chain->ips[i];
		else
			ip = chain->ips[chain->nr - i - 1];


jirka

>  
>  		if (ip >= PERF_CONTEXT_MAX) {
>  			switch (ip) {
> @@ -1318,6 +1319,8 @@ static int machine__resolve_callchain_sample(struct machine *machine,
>  			case PERF_CONTEXT_USER:
>  				cpumode = PERF_RECORD_MISC_USER;
>  				break;
> +			case PERF_CONTEXT_IGNORE:
> +				break;
>  			default:
>  				pr_debug("invalid callchain context: "
>  					 "%"PRId64"\n", (s64) ip);
> -- 
> 1.7.9.5
> 

      parent reply	other threads:[~2014-06-18 13:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-06  3:21 [PATCH v4 1/2]: Allow architectures to skip a callchain entry Sukadev Bhattiprolu
2014-06-06  3:22 ` [PATCH v4 2/2]: powerpc/perf: Adjust callchain based on DWARF debug info Sukadev Bhattiprolu
2014-06-18 13:39 ` Jiri Olsa [this message]

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=20140618133937.GC9865@krava.brq.redhat.com \
    --to=jolsa@redhat$(echo .)com \
    --cc=Ulrich.Weigand@de$(echo .)ibm.com \
    --cc=acme@kernel$(echo .)org \
    --cc=anton@au1$(echo .)ibm.com \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=linuxppc-dev@ozlabs$(echo .)org \
    --cc=michael@ellerman$(echo .)id.au \
    --cc=mpjohn@us$(echo .)ibm.com \
    --cc=sukadev@linux$(echo .)vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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