eal/linux: change log severity levels
authorStephen Hemminger <stephen@networkplumber.org>
Fri, 15 May 2015 17:10:47 +0000 (10:10 -0700)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Mon, 20 Jul 2015 00:47:38 +0000 (02:47 +0200)
Change the log level of startup messages. Anything that is
just normal activity (like getting virtual areas) is changed
to debug level. Anything that is a failure should be NOTICE
or ERR severity.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
lib/librte_eal/linuxapp/eal/eal.c
lib/librte_eal/linuxapp/eal/eal_hugepage_info.c
lib/librte_eal/linuxapp/eal/eal_memory.c
lib/librte_eal/linuxapp/eal/eal_pci_vfio.c
lib/librte_eal/linuxapp/eal/eal_timer.c
lib/librte_eal/linuxapp/eal/eal_xen_memory.c

index 8809f57..43efd9e 100644 (file)
@@ -829,7 +829,7 @@ rte_eal_init(int argc, char **argv)
        rte_eal_mcfg_complete();
 
        TAILQ_FOREACH(solib, &solib_list, next) {
-               RTE_LOG(INFO, EAL, "open shared lib %s\n", solib->name);
+               RTE_LOG(DEBUG, EAL, "open shared lib %s\n", solib->name);
                solib->lib_handle = dlopen(solib->name, RTLD_NOW);
                if (solib->lib_handle == NULL)
                        RTE_LOG(WARNING, EAL, "%s\n", dlerror());
index cdaa47b..18858e2 100644 (file)
@@ -205,7 +205,7 @@ clear_hugedir(const char * hugedir)
        /* open directory */
        dir = opendir(hugedir);
        if (!dir) {
-               RTE_LOG(INFO, EAL, "Unable to open hugepage directory %s\n",
+               RTE_LOG(ERR, EAL, "Unable to open hugepage directory %s\n",
                                hugedir);
                goto error;
        }
@@ -213,7 +213,7 @@ clear_hugedir(const char * hugedir)
 
        dirent = readdir(dir);
        if (!dirent) {
-               RTE_LOG(INFO, EAL, "Unable to read hugepage directory %s\n",
+               RTE_LOG(ERR, EAL, "Unable to read hugepage directory %s\n",
                                hugedir);
                goto error;
        }
@@ -253,7 +253,7 @@ error:
        if (dir)
                closedir(dir);
 
-       RTE_LOG(INFO, EAL, "Error while clearing hugepage dir: %s\n",
+       RTE_LOG(ERR, EAL, "Error while clearing hugepage dir: %s\n",
                strerror(errno));
 
        return -1;
@@ -308,7 +308,7 @@ eal_hugepage_info_init(void)
 
                        num_pages = get_num_hugepages(dirent->d_name);
                        if (num_pages > 0)
-                               RTE_LOG(INFO, EAL,
+                               RTE_LOG(NOTICE, EAL,
                                        "%" PRIu32 " hugepages of size "
                                        "%" PRIu64 " reserved, but no mounted "
                                        "hugetlbfs found for that size\n",
index 80ee78f..d529016 100644 (file)
@@ -245,7 +245,7 @@ get_virtual_area(size_t *size, size_t hugepage_sz)
        }
        else addr = NULL;
 
-       RTE_LOG(INFO, EAL, "Ask a virtual area of 0x%zx bytes\n", *size);
+       RTE_LOG(DEBUG, EAL, "Ask a virtual area of 0x%zx bytes\n", *size);
 
        fd = open("/dev/zero", O_RDONLY);
        if (fd < 0){
@@ -261,7 +261,8 @@ get_virtual_area(size_t *size, size_t hugepage_sz)
 
        if (addr == MAP_FAILED) {
                close(fd);
-               RTE_LOG(INFO, EAL, "Cannot get a virtual area\n");
+               RTE_LOG(ERR, EAL, "Cannot get a virtual area: %s\n",
+                       strerror(errno));
                return NULL;
        }
 
@@ -274,7 +275,7 @@ get_virtual_area(size_t *size, size_t hugepage_sz)
        aligned_addr &= (~(hugepage_sz - 1));
        addr = (void *)(aligned_addr);
 
-       RTE_LOG(INFO, EAL, "Virtual area found at %p (size = 0x%zx)\n",
+       RTE_LOG(DEBUG, EAL, "Virtual area found at %p (size = 0x%zx)\n",
                addr, *size);
 
        /* increment offset */
@@ -610,7 +611,7 @@ find_numasocket(struct hugepage_file *hugepg_tbl, struct hugepage_info *hpi)
 
        f = fopen("/proc/self/numa_maps", "r");
        if (f == NULL) {
-               RTE_LOG(INFO, EAL, "cannot open /proc/self/numa_maps,"
+               RTE_LOG(NOTICE, EAL, "cannot open /proc/self/numa_maps,"
                                " consider that all memory is in socket_id 0\n");
                return 0;
        }
@@ -1007,7 +1008,7 @@ calc_num_pages_per_socket(uint64_t * memory,
                                        0x100000);
                        available = requested -
                                        ((unsigned) (memory[socket] / 0x100000));
-                       RTE_LOG(INFO, EAL, "Not enough memory available on socket %u! "
+                       RTE_LOG(ERR, EAL, "Not enough memory available on socket %u! "
                                        "Requested: %uMB, available: %uMB\n", socket,
                                        requested, available);
                        return -1;
@@ -1018,7 +1019,7 @@ calc_num_pages_per_socket(uint64_t * memory,
        if (total_mem > 0) {
                requested = (unsigned) (internal_config.memory / 0x100000);
                available = requested - (unsigned) (total_mem / 0x100000);
-               RTE_LOG(INFO, EAL, "Not enough memory available! Requested: %uMB,"
+               RTE_LOG(ERR, EAL, "Not enough memory available! Requested: %uMB,"
                                " available: %uMB\n", requested, available);
                return -1;
        }
@@ -1227,13 +1228,13 @@ rte_eal_hugepage_init(void)
        for (i = 0; i < (int) internal_config.num_hugepage_sizes; i++) {
                for (j = 0; j < RTE_MAX_NUMA_NODES; j++) {
                        if (used_hp[i].num_pages[j] > 0) {
-                               RTE_LOG(INFO, EAL,
-                                               "Requesting %u pages of size %uMB"
-                                               " from socket %i\n",
-                                               used_hp[i].num_pages[j],
-                                               (unsigned)
-                                                       (used_hp[i].hugepage_sz / 0x100000),
-                                               j);
+                               RTE_LOG(DEBUG, EAL,
+                                       "Requesting %u pages of size %uMB"
+                                       " from socket %i\n",
+                                       used_hp[i].num_pages[j],
+                                       (unsigned)
+                                       (used_hp[i].hugepage_sz / 0x100000),
+                                       j);
                        }
                }
        }
index 6127f5f..cf5ac50 100644 (file)
@@ -899,7 +899,7 @@ pci_vfio_enable(void)
        if (vfio_cfg.vfio_container_fd != -1)
                vfio_cfg.vfio_enabled = 1;
        else
-               RTE_LOG(INFO, EAL, "VFIO support could not be initialized\n");
+               RTE_LOG(NOTICE, EAL, "VFIO support could not be initialized\n");
 
        return 0;
 }
index 169c6e1..94909ed 100644 (file)
@@ -188,7 +188,7 @@ rte_eal_hpet_init(int make_default)
        int fd, ret;
 
        if (internal_config.no_hpet) {
-               RTE_LOG(INFO, EAL, "HPET is disabled\n");
+               RTE_LOG(NOTICE, EAL, "HPET is disabled\n");
                return -1;
        }
 
index 9246f83..d228a9d 100644 (file)
@@ -86,7 +86,7 @@ xen_get_virtual_area(size_t *size, size_t mem_size)
        int fd;
        long aligned_addr;
 
-       RTE_LOG(INFO, EAL, "Ask a virtual area of 0x%zu bytes\n", *size);
+       RTE_LOG(DEBUG, EAL, "Ask a virtual area of 0x%zu bytes\n", *size);
 
        fd = open("/dev/zero", O_RDONLY);
        if (fd < 0){
@@ -102,7 +102,7 @@ xen_get_virtual_area(size_t *size, size_t mem_size)
 
        if (addr == MAP_FAILED) {
                close(fd);
-               RTE_LOG(INFO, EAL, "Cannot get a virtual area\n");
+               RTE_LOG(ERR, EAL, "Cannot get a virtual area\n");
                return NULL;
        }
 
@@ -114,7 +114,7 @@ xen_get_virtual_area(size_t *size, size_t mem_size)
        aligned_addr = RTE_ALIGN_CEIL(aligned_addr, mem_size);
         addr = (void *)(aligned_addr);
 
-       RTE_LOG(INFO, EAL, "Virtual area found at %p (size = 0x%zx)\n",
+       RTE_LOG(DEBUG, EAL, "Virtual area found at %p (size = 0x%zx)\n",
                addr, *size);
 
        return addr;