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>
Tue, 3 May 2016 19:42:42 +0000 (15:42 -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 d878e5fa2e1b24d4395f71c384a75318adb30f49..1587af8972e1ccf9ab9360be0dfa3d3efcd4f922 100644 (file)
@@ -22,6 +22,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.03727 seconds and 4 git commands to generate.