Skip to content

Commit 3178e37

Browse files
drivers: use dedicated logtypes
When a driver dedicated logtype exists, use it instead of the generic PMD logtype. This has been done partially automatically with: $ for file in $(git grep -l RTE_LOG.*PMD.*fmt drivers/'**.h' \ :^drivers/common/cnxk/roc_platform.h) do tail=${file#drivers/*/*/} dir=${file%%$tail} ! git grep -q RTE_LOGTYPE_ $dir || \ { echo $dir already done; continue; } git grep -hE '^extern int .*log.*;$' $file | \ sed -ne 's/^extern int \([^ ;]*\);$/\1/p' | \ while read logtype do git grep -q 'RTE_LOG_REGISTER\(_DEFAULT\|\)('$logtype',' || \ [ "$logtype" != "${logtype%%driver}" ] || \ { echo Skipped $logtype; continue; } abbrev=$(echo $logtype | sed -e 's/_logtype//' | tr '[a-z]' '[A-Z]') sed -i -e 's/^\(extern int '$logtype'.*\)$/\1\n#define RTE_LOGTYPE_' \ $abbrev' '$logtype'/' $file sed -i -e 's/\(RTE_LOG.*, \)PMD,/\1'$abbrev',/' $file break done done Then a manual update for: - common/cpt, - common/dpaax, - common/idpf, - mempool/dpaa, - net/bnxt, - net/octeon_ep, - raw/ifpga, - vdpa/ifc, Signed-off-by: David Marchand <[email protected]> Reviewed-by: Stephen Hemminger <[email protected]> Reviewed-by: Maxime Coquelin <[email protected]>
1 parent de69a5d commit 3178e37

File tree

38 files changed

+85
-48
lines changed

38 files changed

+85
-48
lines changed

drivers/baseband/la12xx/bbdev_la12xx_pmd_logs.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#define _BBDEV_LA12XX_PMD_LOGS_H_
77

88
extern int bbdev_la12xx_logtype;
9+
#define RTE_LOGTYPE_BBDEV_LA12XX bbdev_la12xx_logtype
910

1011
#define rte_bbdev_log(level, fmt, ...) \
1112
rte_log(RTE_LOG_ ## level, bbdev_la12xx_logtype, fmt "\n", \
@@ -23,6 +24,6 @@ extern int bbdev_la12xx_logtype;
2324

2425
/* DP Logs, toggled out at compile time if level lower than current level */
2526
#define rte_bbdev_dp_log(level, fmt, args...) \
26-
RTE_LOG_DP(level, PMD, fmt, ## args)
27+
RTE_LOG_DP(level, BBDEV_LA12XX, fmt, ## args)
2728

2829
#endif /* _BBDEV_LA12XX_PMD_LOGS_H_ */

drivers/common/cpt/cpt_pmd_logs.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
* otx*_cryptodev.h file would define the CPT_LOGTYPE macro for the
1616
* platform.
1717
*/
18+
#define RTE_LOGTYPE_CPT CPT_LOGTYPE
19+
1820
#define CPT_PMD_DRV_LOG_RAW(level, fmt, args...) \
1921
rte_log(RTE_LOG_ ## level, CPT_LOGTYPE, \
2022
"cpt: %s(): " fmt "\n", __func__, ##args)
@@ -30,11 +32,9 @@
3032

3133
/*
3234
* DP logs, toggled out at compile time if level lower than current level.
33-
* DP logs would be logged under 'PMD' type. So for dynamic logging, the
34-
* level of 'pmd' has to be used.
3535
*/
3636
#define CPT_LOG_DP(level, fmt, args...) \
37-
RTE_LOG_DP(level, PMD, fmt "\n", ## args)
37+
RTE_LOG_DP(level, CPT, fmt "\n", ## args)
3838

3939
#define CPT_LOG_DP_DEBUG(fmt, args...) \
4040
CPT_LOG_DP(DEBUG, fmt, ## args)

drivers/common/dpaax/caamflib/compat.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
#include <rte_byteorder.h>
2121
#include <rte_common.h>
2222

23+
#include "dpaax_logs.h"
24+
2325
#ifndef __BYTE_ORDER__
2426
#error "Undefined endianness"
2527
#endif
@@ -44,7 +46,7 @@
4446
#define pr_msg(l, fmt, ...) do { } while (0)
4547
#else
4648
#define pr_msg(l, fmt, ...) \
47-
RTE_LOG(l, PMD, "%s(): " fmt "\n", __func__, ##__VA_ARGS__)
49+
RTE_LOG(l, DPAAX_LOGGER, "%s(): " fmt "\n", __func__, ##__VA_ARGS__)
4850
#endif
4951

5052
#if !defined(pr_debug)

drivers/common/dpaax/dpaax_logs.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include <rte_log.h>
99

1010
extern int dpaax_logger;
11+
#define RTE_LOGTYPE_DPAAX_LOGGER dpaax_logger
1112

1213
#ifdef RTE_LIBRTE_DPAAX_DEBUG
1314
#define DPAAX_HWWARN(cond, fmt, args...) \

drivers/common/dpaax/version.map

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ INTERNAL {
66
dpaax_iova_table_p;
77
dpaax_iova_table_populate;
88
dpaax_iova_table_update;
9+
dpaax_logger;
910
of_device_is_available;
1011
of_device_is_compatible;
1112
of_find_compatible_node;

drivers/common/idpf/idpf_common_logs.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include <rte_log.h>
99

1010
extern int idpf_common_logtype;
11+
#define RTE_LOGTYPE_IDPF_COMMON idpf_common_logtype
1112

1213
#define DRV_LOG_RAW(level, ...) \
1314
rte_log(RTE_LOG_ ## level, \
@@ -23,7 +24,7 @@ extern int idpf_common_logtype;
2324
#ifdef RTE_LIBRTE_IDPF_DEBUG_RX
2425
#define RX_LOG(level, ...) \
2526
RTE_LOG(level, \
26-
PMD, \
27+
IDPF_COMMON, \
2728
RTE_FMT("%s(): " \
2829
RTE_FMT_HEAD(__VA_ARGS__,) "\n", \
2930
__func__, \
@@ -35,7 +36,7 @@ extern int idpf_common_logtype;
3536
#ifdef RTE_LIBRTE_IDPF_DEBUG_TX
3637
#define TX_LOG(level, ...) \
3738
RTE_LOG(level, \
38-
PMD, \
39+
IDPF_COMMON, \
3940
RTE_FMT("%s(): " \
4041
RTE_FMT_HEAD(__VA_ARGS__,) "\n", \
4142
__func__, \

drivers/crypto/caam_jr/caam_jr_log.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include <rte_log.h>
99

1010
extern int caam_jr_logtype;
11+
#define RTE_LOGTYPE_CAAM_JR caam_jr_logtype
1112

1213
#define CAAM_JR_LOG(level, fmt, args...) \
1314
rte_log(RTE_LOG_ ## level, caam_jr_logtype, "caam_jr: " \
@@ -28,7 +29,7 @@ extern int caam_jr_logtype;
2829

2930
/* DP Logs, toggled out at compile time if level lower than current level */
3031
#define CAAM_JR_DP_LOG(level, fmt, args...) \
31-
RTE_LOG_DP(level, PMD, fmt "\n", ## args)
32+
RTE_LOG_DP(level, CAAM_JR, fmt "\n", ## args)
3233

3334
#define CAAM_JR_DP_DEBUG(fmt, args...) \
3435
CAAM_JR_DP_LOG(DEBUG, fmt, ## args)

drivers/crypto/dpaa2_sec/dpaa2_sec_logs.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#define _DPAA2_SEC_LOGS_H_
1010

1111
extern int dpaa2_logtype_sec;
12+
#define RTE_LOGTYPE_DPAA2_SEC dpaa2_logtype_sec
1213

1314
#define DPAA2_SEC_LOG(level, fmt, args...) \
1415
rte_log(RTE_LOG_ ## level, dpaa2_logtype_sec, "dpaa2_sec: " \
@@ -29,7 +30,7 @@ extern int dpaa2_logtype_sec;
2930

3031
/* DP Logs, toggled out at compile time if level lower than current level */
3132
#define DPAA2_SEC_DP_LOG(level, fmt, args...) \
32-
RTE_LOG_DP(level, PMD, fmt, ## args)
33+
RTE_LOG_DP(level, DPAA2_SEC, fmt, ## args)
3334

3435
#define DPAA2_SEC_DP_DEBUG(fmt, args...) \
3536
DPAA2_SEC_DP_LOG(DEBUG, fmt, ## args)

drivers/crypto/dpaa_sec/dpaa_sec_log.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#define _DPAA_SEC_LOG_H_
1010

1111
extern int dpaa_logtype_sec;
12+
#define RTE_LOGTYPE_DPAA_SEC dpaa_logtype_sec
1213

1314
#define DPAA_SEC_LOG(level, fmt, args...) \
1415
rte_log(RTE_LOG_ ## level, dpaa_logtype_sec, "dpaa_sec: " \
@@ -29,7 +30,7 @@ extern int dpaa_logtype_sec;
2930

3031
/* DP Logs, toggled out at compile time if level lower than current level */
3132
#define DPAA_SEC_DP_LOG(level, fmt, args...) \
32-
RTE_LOG_DP(level, PMD, fmt, ## args)
33+
RTE_LOG_DP(level, DPAA_SEC, fmt, ## args)
3334

3435
#define DPAA_SEC_DP_DEBUG(fmt, args...) \
3536
DPAA_SEC_DP_LOG(DEBUG, fmt, ## args)

drivers/dma/dpaa/dpaa_qdma_logs.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#define __DPAA_QDMA_LOGS_H__
77

88
extern int dpaa_qdma_logtype;
9+
#define RTE_LOGTYPE_DPAA_QDMA dpaa_qdma_logtype
910

1011
#define DPAA_QDMA_LOG(level, fmt, args...) \
1112
rte_log(RTE_LOG_ ## level, dpaa_qdma_logtype, "dpaa_qdma: " \
@@ -26,7 +27,7 @@ extern int dpaa_qdma_logtype;
2627

2728
/* DP Logs, toggled out at compile time if level lower than current level */
2829
#define DPAA_QDMA_DP_LOG(level, fmt, args...) \
29-
RTE_LOG_DP(level, PMD, "dpaa_qdma: " fmt "\n", ## args)
30+
RTE_LOG_DP(level, DPAA_QDMA, "dpaa_qdma: " fmt "\n", ## args)
3031

3132
#define DPAA_QDMA_DP_DEBUG(fmt, args...) \
3233
DPAA_QDMA_DP_LOG(DEBUG, fmt, ## args)

0 commit comments

Comments
 (0)