lkml.org 
[lkml]   [2015]   [Jul]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH] tools lib traceevent: Allow setting an alternative symbol resolver
On Thu, 23 Jul 2015 12:04:33 -0300
Arnaldo Carvalho de Melo <acme@kernel.org> wrote:

>
> +static struct func_map *
> +find_func(struct pevent *pevent, unsigned long long addr)
> +{
> + static struct func_map map;

I know there's other cases of static variables in functions, but I plan
on cleaning that up in the future.

Can you make that map belong to the pevent itself? In case there's two
pevent's going parallel, I don't want one to overwrite the other. The
pevent code is not re-entrant, but I would like to make it so for
different pevents.

-- Steve


> +
> + if (!function_resolver.function)
> + return __find_func(pevent, addr);
> +
> + map.mod = NULL;
> + map.addr = addr;
> + map.func = function_resolver.function(function_resolver.priv, &map.addr, &map.mod);
> + if (map.func == NULL)
> + return NULL;
> +
> + return &map;
> +}
> +


\
 
 \ /
  Last update: 2015-07-23 18:41    [from the cache]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and my Meterkast|Read the blog