perf annotate: Initialize the priv are in symbol__new()
We need to initializa some fields (right now just a mutex) when we allocate the per symbol annotation struct, so do it at the symbol constructor instead of (ab)using the filter mechanism for that. This way we remove one of the few cases we have for that symbol filter, which will eventually led to removing it. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Wang Nan <wangnan0@huawei.com> Link: http://lkml.kernel.org/n/tip-cvz34avlz1lez888lob95390@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
@@ -491,13 +491,6 @@ static struct ins *ins__find(const char *name)
|
||||
return bsearch(name, instructions, nmemb, sizeof(struct ins), ins__key_cmp);
|
||||
}
|
||||
|
||||
int symbol__annotate_init(struct map *map __maybe_unused, struct symbol *sym)
|
||||
{
|
||||
struct annotation *notes = symbol__annotation(sym);
|
||||
pthread_mutex_init(¬es->lock, NULL);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int symbol__alloc_hist(struct symbol *sym)
|
||||
{
|
||||
struct annotation *notes = symbol__annotation(sym);
|
||||
|
Reference in New Issue
Block a user