Use printf_debug/verbose in so-info
authorAntoine Busque <abusque@efficios.com>
Thu, 21 Apr 2016 05:02:27 +0000 (01:02 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 21 Apr 2016 18:21:24 +0000 (14:21 -0400)
Signed-off-by: Antoine Busque <abusque@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
lib/Makefile.am
lib/so-info.c

index 33e1256f77d6817a667f7590fa4ee4913399a03a..f8324a923b24446b70a320893bb5e402b08f9c03 100644 (file)
@@ -24,6 +24,7 @@ libdebuginfo_la_SOURCES = debuginfo.c \
                          crc32.c \
                          utils.c
 libdebuginfo_la_LDFLAGS = -lelf -ldw
+libdebuginfo_la_LIBADD = libbabeltrace.la
 endif
 
 libbabeltrace_la_LIBADD = \
index 239320d9c30cf5582d5e4034bef4b7ff1a4fba4c..a5c386049811e531daa82443348854457c50a2bb 100644 (file)
@@ -55,8 +55,8 @@ int so_info_init(void)
        int ret = 0;
 
        if (elf_version(EV_CURRENT) == EV_NONE) {
-               fprintf(stderr, "ELF library initialization failed: %s\n",
-                       elf_errmsg(-1));
+               printf_debug("ELF library initialization failed: %s\n",
+                               elf_errmsg(-1));
                ret = -1;
        }
 
@@ -492,18 +492,18 @@ int so_info_set_elf_file(struct so_info *so)
 
        elf_fd = open(so->elf_path, O_RDONLY);
        if (elf_fd < 0) {
-               fprintf(stderr, "Failed to open %s\n", so->elf_path);
+               printf_verbose("Failed to open %s\n", so->elf_path);
                goto error;
        }
 
        elf_file = elf_begin(elf_fd, ELF_C_READ, NULL);
        if (!elf_file) {
-               fprintf(stderr, "elf_begin failed: %s\n", elf_errmsg(-1));
+               printf_debug("elf_begin failed: %s\n", elf_errmsg(-1));
                goto error;
        }
 
        if (elf_kind(elf_file) != ELF_K_ELF) {
-               fprintf(stderr, "Error: %s is not an ELF object\n",
+               printf_verbose("Error: %s is not an ELF object\n",
                                so->elf_path);
                goto error;
        }
This page took 0.029634 seconds and 4 git commands to generate.