summaryrefslogtreecommitdiff
path: root/tools/perf/util/probe-event.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2015-05-29 20:19:02 +0200
committerIngo Molnar <mingo@kernel.org>2015-05-29 20:19:02 +0200
commit5c9b9bc67c684e40b3a5e7e9facde0fb7200cd8c (patch)
tree754aa0939698ea7cc04587ee0b10be323fc9c64d /tools/perf/util/probe-event.c
parentf1942b96b4b44c1ab0e0b82fef93ba7e1fada7af (diff)
parented426915900db3c58c410b8b38f6ff0e46bf6c96 (diff)
Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core
Pull perf/core improvements and fixes from Arnaldo Carvalho de Melo: User visible changes: - Make Ctrl-C stop processing on TUI, allowing interrupting the load of big perf.data files (Namhyung Kim) - Fix 'perf annotate' -i option, which is currently ignored (Martin Liška) - Add ARM64 perf_regs_load to support libunwind and enable testing (Wang Nan) Infrastructure changes: - Fix thread ref-counting in db-export (Adrian Hunter) - Fix compiler warning about may be accessing uninitialized (Arnaldo Carvalho de Melo) - No need to have two lists for user and kernel DSOs, unify them (Arnaldo Carvalho de Melo) - Function namespace consistency fixups (Arnaldo Carvalho de Melo) - Do not fail on missing Build file, fixing the build on MIPS (Jiri Olsa) - Fix up syscall tests, making those tests pass on ARM64 (Riku Voipio) - Fix 'function unused' warning in 'perf probe' (Wang Nan) Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/probe-event.c')
-rw-r--r--tools/perf/util/probe-event.c66
1 files changed, 34 insertions, 32 deletions
diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
index b0b8a8080009..d27edef5eb5b 100644
--- a/tools/perf/util/probe-event.c
+++ b/tools/perf/util/probe-event.c
@@ -200,38 +200,6 @@ static void put_target_map(struct map *map, bool user)
}
-static int kernel_get_module_dso(const char *module, struct dso **pdso)
-{
- struct dso *dso;
- struct map *map;
- const char *vmlinux_name;
- int ret = 0;
-
- if (module) {
- list_for_each_entry(dso, &host_machine->kernel_dsos.head,
- node) {
- if (strncmp(dso->short_name + 1, module,
- dso->short_name_len - 2) == 0)
- goto found;
- }
- pr_debug("Failed to find module %s.\n", module);
- return -ENOENT;
- }
-
- map = host_machine->vmlinux_maps[MAP__FUNCTION];
- dso = map->dso;
-
- vmlinux_name = symbol_conf.vmlinux_name;
- dso->load_errno = 0;
- if (vmlinux_name)
- ret = dso__load_vmlinux(dso, map, vmlinux_name, false, NULL);
- else
- ret = dso__load_vmlinux_path(dso, map, NULL);
-found:
- *pdso = dso;
- return ret;
-}
-
static int convert_exec_to_group(const char *exec, char **result)
{
char *ptr1, *ptr2, *exec_copy;
@@ -279,6 +247,40 @@ static void clear_probe_trace_events(struct probe_trace_event *tevs, int ntevs)
}
#ifdef HAVE_DWARF_SUPPORT
+
+static int kernel_get_module_dso(const char *module, struct dso **pdso)
+{
+ struct dso *dso;
+ struct map *map;
+ const char *vmlinux_name;
+ int ret = 0;
+
+ if (module) {
+ list_for_each_entry(dso, &host_machine->dsos.head, node) {
+ if (!dso->kernel)
+ continue;
+ if (strncmp(dso->short_name + 1, module,
+ dso->short_name_len - 2) == 0)
+ goto found;
+ }
+ pr_debug("Failed to find module %s.\n", module);
+ return -ENOENT;
+ }
+
+ map = host_machine->vmlinux_maps[MAP__FUNCTION];
+ dso = map->dso;
+
+ vmlinux_name = symbol_conf.vmlinux_name;
+ dso->load_errno = 0;
+ if (vmlinux_name)
+ ret = dso__load_vmlinux(dso, map, vmlinux_name, false, NULL);
+ else
+ ret = dso__load_vmlinux_path(dso, map, NULL);
+found:
+ *pdso = dso;
+ return ret;
+}
+
/*
* Some binaries like glibc have special symbols which are on the symbol
* table, but not in the debuginfo. If we can find the address of the