public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@redhat.com>
To: kan.liang@intel.com
Cc: acme@kernel.org, a.p.zijlstra@chello.nl, eranian@google.com,
	linux-kernel@vger.kernel.org, mingo@redhat.com, paulus@samba.org,
	ak@linux.intel.com
Subject: Re: [PATCH V2 2/3] perf tool: re-organize thread__resolve_callchain_sample
Date: Thu, 13 Nov 2014 19:21:23 +0100	[thread overview]
Message-ID: <20141113182123.GA6309@krava.redhat.com> (raw)
In-Reply-To: <1415837895-10275-3-git-send-email-kan.liang@intel.com>

On Wed, Nov 12, 2014 at 07:18:14PM -0500, kan.liang@intel.com wrote:

SNIP

> +static inline int __thread__resolve_callchain_sample(struct thread *thread,
> +						     u64 ip, u8 *cpumode,
> +						     struct symbol **parent,
> +						     struct addr_location *root_al)
> +{
> +	struct addr_location al;
> +
> +	if (ip >= PERF_CONTEXT_MAX) {
> +		switch (ip) {
> +		case PERF_CONTEXT_HV:
> +			*cpumode = PERF_RECORD_MISC_HYPERVISOR;
> +			break;
> +		case PERF_CONTEXT_KERNEL:
> +			*cpumode = PERF_RECORD_MISC_KERNEL;
> +			break;
> +		case PERF_CONTEXT_USER:
> +			*cpumode = PERF_RECORD_MISC_USER;
> +			break;
> +		default:
> +			pr_debug("invalid callchain context: "
> +				 "%"PRId64"\n", (s64) ip);
> +			/*
> +			 * It seems the callchain is corrupted.
> +			 * Discard all.
> +			 */
> +			callchain_cursor_reset(&callchain_cursor);
> +			return 1;
> +		}
> +		return 0;
> +	}
> +
> +	al.filtered = 0;
> +	thread__find_addr_location(thread, *cpumode,
> +				   MAP__FUNCTION, ip, &al);
> +	if (al.sym != NULL) {
> +		if (sort__has_parent && !*parent &&
> +		    symbol__match_regex(al.sym, &parent_regex))
> +			*parent = al.sym;
> +		else if (have_ignore_callees && root_al &&
> +		  symbol__match_regex(al.sym, &ignore_callees_regex)) {
> +			/* Treat this symbol as the root,
> +			   forgetting its callees. */
> +			*root_al = al;
> +			callchain_cursor_reset(&callchain_cursor);
> +		}
> +	}
> +
> +	return callchain_cursor_append(&callchain_cursor,
> +				       ip, al.map, al.sym);

you added slightly more than Andi ;-)
http://marc.info/?l=linux-kernel&m=141584439819848&w=2

Any chance you guys could sync on this? ..you're touching the
same code.. Andi, maybe you wouldn't mind having this patch
instead of your change.. looks like the only extra part is the
cpumode resolve.

thanks,
jirka

  reply	other threads:[~2014-11-13 18:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-13  0:18 [PATCH V2 0/3] perf tool: Haswell LBR call stack support (user) kan.liang
2014-11-13  0:18 ` [PATCH V2 1/3] perf tools: enable LBR call stack support kan.liang
2014-11-13  0:18 ` [PATCH V2 2/3] perf tool: re-organize thread__resolve_callchain_sample kan.liang
2014-11-13 18:21   ` Jiri Olsa [this message]
2014-11-13 18:48     ` Andi Kleen
2014-11-14  8:23       ` Jiri Olsa
2014-11-13  0:18 ` [PATCH V2 3/3] perf tools: Construct LBR call chain kan.liang

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=20141113182123.GA6309@krava.redhat.com \
    --to=jolsa@redhat.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@kernel.org \
    --cc=ak@linux.intel.com \
    --cc=eranian@google.com \
    --cc=kan.liang@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=paulus@samba.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