Re: [PATCH 04/16] perf tools: Add a thread stack for synthesizing call chains

From: Jiri Olsa
Date: Wed Oct 29 2014 - 05:04:18 EST


On Thu, Oct 23, 2014 at 01:45:12PM +0300, Adrian Hunter wrote:

SNIP

> + while (i--) {
> + if (ts->stack[i].ret_addr == ret_addr) {
> + ts->cnt = i;
> + return;
> + }
> + }
> + }
> +}
> +
> +void thread_stack__event(struct thread *thread, u32 flags, u64 from_ip,
> + u64 to_ip, u16 insn_len, u64 trace_nr)
> +{
> + if (!thread)
> + return;
> +
> + if (!thread->ts) {
> + thread->ts = thread_stack__new();
> + if (!thread->ts)
> + return;

should the function return 'int' then..? So the allocation
error gets handled properly.

jirka
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/