[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20141117135757.GA21532@krava.brq.redhat.com>
Date: Mon, 17 Nov 2014 14:57:57 +0100
From: Jiri Olsa <jolsa@...hat.com>
To: kan.liang@...el.com
Cc: acme@...nel.org, a.p.zijlstra@...llo.nl, eranian@...gle.com,
linux-kernel@...r.kernel.org, mingo@...hat.com, paulus@...ba.org,
ak@...ux.intel.com
Subject: Re: [PATCH V3 2/3] perf tool: Move cpumode resolve code to
add_callchain_ip
On Fri, Nov 14, 2014 at 08:44:11AM -0500, kan.liang@...el.com wrote:
> From: Kan Liang <kan.liang@...el.com>
SNIP
> --- a/tools/perf/util/machine.c
> +++ b/tools/perf/util/machine.c
> @@ -1384,11 +1384,35 @@ struct mem_info *sample__resolve_mem(struct perf_sample *sample,
> static int add_callchain_ip(struct thread *thread,
> struct symbol **parent,
> struct addr_location *root_al,
> - int cpumode,
> + u8 cpumode,
> u64 ip)
> {
> 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;
extra whitespace ^^^^^^^
> + }
> +
> al.filtered = 0;
> al.sym = NULL;
> thread__find_addr_location(thread, cpumode, MAP__FUNCTION,
SNIP
> - * Discard all.
> - */
> - callchain_cursor_reset(&callchain_cursor);
> - return 0;
> - }
> - continue;
> - }
> -
> err = add_callchain_ip(thread, parent, root_al,
> cpumode, ip);
hm, why do we need to pass cpumode in here? it should be handled within
add_callchain_ip in add_callchain_ip function, right?
jirka
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists