lkml.org 
[lkml]   [2014]   [Oct]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 04/16] perf tools: Add a thread stack for synthesizing call chains
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


\
 
 \ /
  Last update: 2014-10-29 10:21    [W:0.258 / U:0.312 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site