[dpdk-dev] rte_log simplification using constructor scheme

Thomas Monjalon thomas at monjalon.net
Mon Jun 8 22:25:23 CEST 2020


27/05/2020 18:05, Jerin Kollanukkaran:
> +#define RTE_LOG_REGISTER(type, name, level)                            \
> +int type;                                                              \
> +RTE_INIT(__##type)                                                     \
> +{                                                                      \
> +       type = rte_log_register(RTE_STR(name));                         \
> +       if (type >= 0)                                                  \
> +               rte_log_set_level(type, RTE_LOG_##level);               \
> +}

We should consider using rte_log_register_type_and_pick_level()
which works for drivers loaded later in the init sequence.
I feel rte_log_register() could be deprecated.

The other question around log level is about the default level.
Do we want to allow having different default log levels per log type?




More information about the dev mailing list