mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-23 07:12:09 +00:00
perf machine: Add symbol filter to struct machine
The symbol filter needs to be applied machine-wide, so add it to struct machine. Currently tools pass the symbol filter as a parameter to various map-related functions. However a need to load a map can occur anywhere in the code, at which point the filter is needed. Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/r/1375961547-30267-2-git-send-email-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
parent
93ea01c29d
commit
611a5ce8aa
2 changed files with 25 additions and 0 deletions
|
@ -25,6 +25,8 @@ int machine__init(struct machine *machine, const char *root_dir, pid_t pid)
|
|||
machine->kmaps.machine = machine;
|
||||
machine->pid = pid;
|
||||
|
||||
machine->symbol_filter = NULL;
|
||||
|
||||
machine->root_dir = strdup(root_dir);
|
||||
if (machine->root_dir == NULL)
|
||||
return -ENOMEM;
|
||||
|
@ -95,6 +97,7 @@ void machines__init(struct machines *machines)
|
|||
{
|
||||
machine__init(&machines->host, "", HOST_KERNEL_ID);
|
||||
machines->guests = RB_ROOT;
|
||||
machines->symbol_filter = NULL;
|
||||
}
|
||||
|
||||
void machines__exit(struct machines *machines)
|
||||
|
@ -118,6 +121,8 @@ struct machine *machines__add(struct machines *machines, pid_t pid,
|
|||
return NULL;
|
||||
}
|
||||
|
||||
machine->symbol_filter = machines->symbol_filter;
|
||||
|
||||
while (*p != NULL) {
|
||||
parent = *p;
|
||||
pos = rb_entry(parent, struct machine, rb_node);
|
||||
|
@ -133,6 +138,21 @@ struct machine *machines__add(struct machines *machines, pid_t pid,
|
|||
return machine;
|
||||
}
|
||||
|
||||
void machines__set_symbol_filter(struct machines *machines,
|
||||
symbol_filter_t symbol_filter)
|
||||
{
|
||||
struct rb_node *nd;
|
||||
|
||||
machines->symbol_filter = symbol_filter;
|
||||
machines->host.symbol_filter = symbol_filter;
|
||||
|
||||
for (nd = rb_first(&machines->guests); nd; nd = rb_next(nd)) {
|
||||
struct machine *machine = rb_entry(nd, struct machine, rb_node);
|
||||
|
||||
machine->symbol_filter = symbol_filter;
|
||||
}
|
||||
}
|
||||
|
||||
struct machine *machines__find(struct machines *machines, pid_t pid)
|
||||
{
|
||||
struct rb_node **p = &machines->guests.rb_node;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue