[v2,2/3] examples/vm_power_manager: do not use EAL logtype

Message ID 20240216033743.150800-3-stephen@networkplumber.org (mailing list archive)
State Superseded, archived
Delegated to: David Marchand
Headers
Series replace use of EAL logtype in applications |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Stephen Hemminger Feb. 16, 2024, 3:36 a.m. UTC
  Be consistent for all the error printouts and use fprintf().
The EAL logtype is reserved for internal use by EAL.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: David Hunt <david.hunt@intel.com>
Acked-by: Huisong Li <lihuisong@huawei.com>
---
 examples/vm_power_manager/main.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)
  

Patch

diff --git a/examples/vm_power_manager/main.c b/examples/vm_power_manager/main.c
index b159291d77ce..c14138202004 100644
--- a/examples/vm_power_manager/main.c
+++ b/examples/vm_power_manager/main.c
@@ -17,7 +17,6 @@ 
 #include <rte_common.h>
 #include <rte_eal.h>
 #include <rte_launch.h>
-#include <rte_log.h>
 #include <rte_per_lcore.h>
 #include <rte_lcore.h>
 #include <rte_ethdev.h>
@@ -425,8 +424,7 @@  main(int argc, char **argv)
 
 	lcore_id = rte_get_next_lcore(-1, 1, 0);
 	if (lcore_id == RTE_MAX_LCORE) {
-		RTE_LOG(ERR, EAL, "A minimum of three cores are required to run "
-				"application\n");
+		fprintf(stderr, "A minimum of three cores are required to run application\n");
 		return 0;
 	}
 	printf("Running channel monitor on lcore id %d\n", lcore_id);
@@ -434,16 +432,15 @@  main(int argc, char **argv)
 
 	lcore_id = rte_get_next_lcore(lcore_id, 1, 0);
 	if (lcore_id == RTE_MAX_LCORE) {
-		RTE_LOG(ERR, EAL, "A minimum of three cores are required to run "
-				"application\n");
+		fprintf(stderr, "A minimum of three cores are required to run application\n");
 		return 0;
 	}
 	if (power_manager_init() < 0) {
-		printf("Unable to initialize power manager\n");
+		fprintf(stderr, "Unable to initialize power manager\n");
 		return -1;
 	}
 	if (channel_manager_init(CHANNEL_MGR_DEFAULT_HV_PATH) < 0) {
-		printf("Unable to initialize channel manager\n");
+		fprintf(stderr, "Unable to initialize channel manager\n");
 		return -1;
 	}