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

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

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/github-robot: build success github build: passed
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/intel-Functional success Functional PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-compile-arm64-testing success Testing PASS
ci/iol-sample-apps-testing success Testing PASS

Commit Message

Stephen Hemminger Dec. 11, 2023, 5:23 p.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>
---
 examples/vm_power_manager/main.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)
  

Comments

Hunt, David Dec. 12, 2023, 11:24 a.m. UTC | #1
On 11/12/2023 17:23, Stephen Hemminger wrote:
> 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>
> ---
>   examples/vm_power_manager/main.c | 11 ++++-------
>   1 file changed, 4 insertions(+), 7 deletions(-)
>
> 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


--snip--


Acked-by: David Hunt <david.hunt@intel.com>



>
  
lihuisong (C) Dec. 12, 2023, 11:53 a.m. UTC | #2
Acked-by: Huisong Li <lihuisong@huawei.com>

在 2023/12/12 1:23, Stephen Hemminger 写道:
> 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>
> ---
>   examples/vm_power_manager/main.c | 11 ++++-------
>   1 file changed, 4 insertions(+), 7 deletions(-)
>
> 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;
>   	}
>
  

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;
 	}