diff mbox

[dpdk-dev] eal: reduce/change log severity levels

Message ID 1431709847-5402-1-git-send-email-stephen@networkplumber.org (mailing list archive)
State Accepted, archived
Headers show

Commit Message

Stephen Hemminger May 15, 2015, 5:10 p.m. UTC
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               |  2 +-
 lib/librte_eal/linuxapp/eal/eal_hugepage_info.c | 11 +++++-----
 lib/librte_eal/linuxapp/eal/eal_memory.c        | 27 +++++++++++++------------
 lib/librte_eal/linuxapp/eal/eal_pci_vfio.c      |  2 +-
 lib/librte_eal/linuxapp/eal/eal_timer.c         |  2 +-
 lib/librte_eal/linuxapp/eal/eal_xen_memory.c    |  6 +++---
 6 files changed, 26 insertions(+), 24 deletions(-)

Comments

Thomas Monjalon July 20, 2015, 12:45 a.m. UTC | #1
> 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>

Applied, thanks
diff mbox

Patch

diff --git a/lib/librte_eal/linuxapp/eal/eal.c b/lib/librte_eal/linuxapp/eal/eal.c
index bd770cf..8204102 100644
--- a/lib/librte_eal/linuxapp/eal/eal.c
+++ b/lib/librte_eal/linuxapp/eal/eal.c
@@ -797,7 +797,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());
diff --git a/lib/librte_eal/linuxapp/eal/eal_hugepage_info.c b/lib/librte_eal/linuxapp/eal/eal_hugepage_info.c
index 028e309..b1eb39c 100644
--- a/lib/librte_eal/linuxapp/eal/eal_hugepage_info.c
+++ b/lib/librte_eal/linuxapp/eal/eal_hugepage_info.c
@@ -214,7 +214,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;
 	}
@@ -222,7 +222,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;
 	}
@@ -262,7 +262,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;
@@ -297,8 +297,9 @@  eal_hugepage_info_init(void)
 			if (hpi->hugedir == NULL){
 				int32_t num_pages;
 				if ((num_pages = get_num_hugepages(dirent->d_name)) > 0)
-					RTE_LOG(INFO, EAL, "%u hugepages of size %llu reserved, "\
-							"but no mounted hugetlbfs found for that size\n",
+					RTE_LOG(NOTICE, EAL,
+						"%u hugepages of size %llu reserved, "
+						"but no mounted hugetlbfs found for that size\n",
 							(unsigned)num_pages,
 							(unsigned long long)hpi->hugepage_sz);
 			} else {
diff --git a/lib/librte_eal/linuxapp/eal/eal_memory.c b/lib/librte_eal/linuxapp/eal/eal_memory.c
index 5f9f92e..aa373a8 100644
--- a/lib/librte_eal/linuxapp/eal/eal_memory.c
+++ b/lib/librte_eal/linuxapp/eal/eal_memory.c
@@ -239,7 +239,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){
@@ -255,7 +255,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;
 	}
 
@@ -268,7 +269,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 */
@@ -604,7 +605,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;
 	}
@@ -1001,7 +1002,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;
@@ -1012,7 +1013,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;
 	}
@@ -1218,13 +1219,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);
 			}
 		}
 	}
diff --git a/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c b/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c
index 426953a..284fa9f 100644
--- a/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c
+++ b/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c
@@ -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;
 }
diff --git a/lib/librte_eal/linuxapp/eal/eal_timer.c b/lib/librte_eal/linuxapp/eal/eal_timer.c
index 169c6e1..94909ed 100644
--- a/lib/librte_eal/linuxapp/eal/eal_timer.c
+++ b/lib/librte_eal/linuxapp/eal/eal_timer.c
@@ -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;
 	}
 
diff --git a/lib/librte_eal/linuxapp/eal/eal_xen_memory.c b/lib/librte_eal/linuxapp/eal/eal_xen_memory.c
index 9246f83..d228a9d 100644
--- a/lib/librte_eal/linuxapp/eal/eal_xen_memory.c
+++ b/lib/librte_eal/linuxapp/eal/eal_xen_memory.c
@@ -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;