[3/3] examples/vm_power_manager: do not use EAL logtype
Checks
Commit Message
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
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>
>
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;
> }
>
@@ -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;
}