[sysprof/wip/chergert/path-resolver] tests: make resolving path match elf resolver
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [sysprof/wip/chergert/path-resolver] tests: make resolving path match elf resolver
- Date: Tue, 21 Sep 2021 22:39:56 +0000 (UTC)
commit 5b6377ee7892509402765b1f57ccf01321fca737
Author: Christian Hergert <chergert redhat com>
Date: Tue Sep 21 15:39:47 2021 -0700
tests: make resolving path match elf resolver
Just use the ev->filename if we didn't translate the path (so we can avoid
extra string copies).
src/tests/list-maps.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/tests/list-maps.c b/src/tests/list-maps.c
index b485eef..9296fb4 100644
--- a/src/tests/list-maps.c
+++ b/src/tests/list-maps.c
@@ -65,10 +65,10 @@ list_maps (const char *filename)
const SysprofCaptureMap *ev = sysprof_capture_reader_read_map (reader);
g_autofree char *resolved = _sysprof_elf_symbol_resolver_resolve_path (SYSPROF_ELF_SYMBOL_RESOLVER
(resolver), ev->frame.pid, ev->filename);
const char *kind = _sysprof_elf_symbol_resolver_get_pid_kind (SYSPROF_ELF_SYMBOL_RESOLVER
(resolver), ev->frame.pid);
- ino_t inode = read_inode (resolved);
+ ino_t inode = read_inode (resolved ? resolved : ev->filename);
g_print ("PID %u (%s): ", ev->frame.pid, kind);
- g_print ("%s => %s", ev->filename, resolved ? resolved : "(NULL)");
+ g_print ("%s => %s", ev->filename, resolved ? resolved : ev->filename);
if (inode == (ino_t)-1)
g_print (" (missing)");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]