mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 17:47:41 +02:00
perf srcline: Introduce inline_node__clear_frames()
Introduce inline_node__clear_frames() to clean up partial allocations. This is a prerequisite for error handling in libdw inline unwinding. Signed-off-by: Ian Rogers <irogers@google.com> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: James Clark <james.clark@linaro.org> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Masami Hiramatsu <mhiramat@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Zecheng Li <zli94@ncsu.edu> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
parent
17e9b4243e
commit
674dea094e
|
|
@ -429,10 +429,13 @@ struct inline_node *dso__parse_addr_inlines(struct dso *dso, u64 addr,
|
|||
return addr2inlines(dso_name, addr, dso, sym);
|
||||
}
|
||||
|
||||
void inline_node__delete(struct inline_node *node)
|
||||
void inline_node__clear_frames(struct inline_node *node)
|
||||
{
|
||||
struct inline_list *ilist, *tmp;
|
||||
|
||||
if (node == NULL)
|
||||
return;
|
||||
|
||||
list_for_each_entry_safe(ilist, tmp, &node->val, list) {
|
||||
list_del_init(&ilist->list);
|
||||
zfree_srcline(&ilist->srcline);
|
||||
|
|
@ -441,7 +444,11 @@ void inline_node__delete(struct inline_node *node)
|
|||
symbol__delete(ilist->symbol);
|
||||
free(ilist);
|
||||
}
|
||||
}
|
||||
|
||||
void inline_node__delete(struct inline_node *node)
|
||||
{
|
||||
inline_node__clear_frames(node);
|
||||
free(node);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -47,6 +47,7 @@ struct inline_node *dso__parse_addr_inlines(struct dso *dso, u64 addr,
|
|||
struct symbol *sym);
|
||||
/* free resources associated to the inline node list */
|
||||
void inline_node__delete(struct inline_node *node);
|
||||
void inline_node__clear_frames(struct inline_node *node);
|
||||
|
||||
/* insert the inline node list into the DSO, which will take ownership */
|
||||
void inlines__tree_insert(struct rb_root_cached *tree,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user