RDMA/rxe: Add function name to the logs
Subsystems (2)
PATCH 1/1 RDMA/rxe: Add function name to the logs
From: Zhu Yanjun <[email protected]>
Add the function names to the pr_ logs. As such, if some bugs occur, with function names, it is easy to locate the bugs.
--- drivers/infiniband/sw/rxe/rxe.h | 2 +- drivers/infiniband/sw/rxe/rxe_queue.h | 16 ++++------------ 2 files changed, 5 insertions(+), 13 deletions(-)
drivers/infiniband/sw/rxe/rxe.h +1 -1
@@ -10,7 +10,7 @@#ifdef pr_fmt#undef pr_fmt#endif -#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#define pr_fmt (fmt) KBUILD_MODNAME ": %s: " fmt, __func__#include <linux/skbuff.h>
drivers/infiniband/sw/rxe/rxe_queue.h +4 -12
@@ -184,9 +184,7 @@ static inline void queue_advance_producer(struct rxe_queue *q,switch (type) {case QUEUE_TYPE_FROM_CLIENT :/* used by rxe, client owns the index */ -if (WARN_ON (1 )) -pr_warn ("%s: attempt to advance client index\n" , - __func__); +WARN_ON (1 );break ;case QUEUE_TYPE_TO_CLIENT :/* used by rxe which owns the index */
@@ -205,9 +203,7 @@ static inline void queue_advance_producer(struct rxe_queue *q,break ;case QUEUE_TYPE_TO_ULP :/* used by ulp, rxe owns the index */ -if (WARN_ON (1 )) -pr_warn ("%s: attempt to advance driver index\n" , - __func__); +WARN_ON (1 );break ; } }
@@ -227,15 +223,11 @@ static inline void queue_advance_consumer(struct rxe_queue *q,break ;case QUEUE_TYPE_TO_CLIENT :/* used by rxe, client owns the index */ -if (WARN_ON (1 )) -pr_warn ("%s: attempt to advance client index\n" , - __func__); +WARN_ON (1 );break ;case QUEUE_TYPE_FROM_ULP :/* used by ulp, rxe owns the index */ -if (WARN_ON (1 )) -pr_warn ("%s: attempt to advance driver index\n" , - __func__); +WARN_ON (1 );break ;case QUEUE_TYPE_TO_ULP :/* used by ulp which owns the index */
Signature · 1 line
2.27.0
Jason Gunthorpe
maintainerQuoted 10 lines · Zhu Yanjun
From: Zhu Yanjun <[email protected]>
Add the function names to the
pr_logs. As such, if some bugs occur, with function names, it is easy to locate the bugs.Signed-off-by Zhu Yanjun <[email protected]>--- drivers/infiniband/sw/rxe/rxe.h | 2 +- drivers/infiniband/sw/rxe/rxe_queue.h | 16 ++++------------ 2 files changed, 5 insertions(+), 13 deletions(-)
After you delete the warn_on's there is very little left:
rivers/infiniband/sw/rxe/rxe.c: pr_err("rxe creation allowed on top of a real device only\n");
drivers/infiniband/sw/rxe/rxe.c: pr_info("loaded\n");
drivers/infiniband/sw/rxe/rxe.c: pr_info("unloaded\n");
drivers/infiniband/sw/rxe/rxe_net.c: pr_err("Failed to create IPv4 UDP tunnel\n");
drivers/infiniband/sw/rxe/rxe_net.c: pr_warn("IPv6 is not supported, can not create a UDPv6 socket\n");
drivers/infiniband/sw/rxe/rxe_net.c: pr_err("Failed to create IPv6 UDP tunnel\n");
drivers/infiniband/sw/rxe/rxe_net.c: pr_err("Failed to register netdev notifier\n");It is not exactly mysterious where these come from?
Why do we need the function name?
Jason
Quoted 21 lines · Jason Gunthorpe
Quoted 10 lines · Zhu Yanjun
From: Zhu Yanjun <[email protected]>
Add the function names to the
pr_logs. As such, if some bugs occur, with function names, it is easy to locate the bugs.Signed-off-by Zhu Yanjun <[email protected]>--- drivers/infiniband/sw/rxe/rxe.h | 2 +- drivers/infiniband/sw/rxe/rxe_queue.h | 16 ++++------------ 2 files changed, 5 insertions(+), 13 deletions(-)After you delete the warn_on's there is very little left:
rivers/infiniband/sw/rxe/rxe.c: pr_err("rxe creation allowed on top of a real device only\n"); drivers/infiniband/sw/rxe/rxe.c: pr_info("loaded\n"); drivers/infiniband/sw/rxe/rxe.c: pr_info("unloaded\n"); drivers/infiniband/sw/rxe/rxe_net.c: pr_err("Failed to create IPv4 UDP tunnel\n"); drivers/infiniband/sw/rxe/rxe_net.c: pr_warn("IPv6 is not supported, can not create a UDPv6 socket\n"); drivers/infiniband/sw/rxe/rxe_net.c: pr_err("Failed to create IPv6 UDP tunnel\n"); drivers/infiniband/sw/rxe/rxe_net.c: pr_err("Failed to register netdev notifier\n");
Quoted 1 line
It is not exactly mysterious where these come from?
If I got you correctly, you mean that we can easily locate the above pr_xxx logs. As such, it is not necessary to add function names.
From this perspective, I agree with you.
Why I make this commit is that we can directly use this pr_info("xxxxx") when some bug occurs. But in the logs, the function names appear.
With this commit, we can decrease some work loads with some bug occurs.
Now I am debugging a problem. With a similar commit with this, I directly use pr_warn("xxx"). But in the logs, function names, line number, file names, caller and so on will appear.
This greatly decrease my workloads.
I think this is a smart method. So I introduce this smart method to softroce. When some bugs occur in softroce, this method can help us.
Zhu Yanjun
Quoted 4 lines
Why do we need the function name?
Jason
Jason Gunthorpe
maintainerQuoted 28 lines · Zhu Yanjun
Quoted 21 lines · Jason Gunthorpe
Quoted 10 lines · Zhu Yanjun
From: Zhu Yanjun <[email protected]>
Add the function names to the
pr_logs. As such, if some bugs occur, with function names, it is easy to locate the bugs.Signed-off-by Zhu Yanjun <[email protected]>--- drivers/infiniband/sw/rxe/rxe.h | 2 +- drivers/infiniband/sw/rxe/rxe_queue.h | 16 ++++------------ 2 files changed, 5 insertions(+), 13 deletions(-)After you delete the warn_on's there is very little left:
rivers/infiniband/sw/rxe/rxe.c: pr_err("rxe creation allowed on top of a real device only\n"); drivers/infiniband/sw/rxe/rxe.c: pr_info("loaded\n"); drivers/infiniband/sw/rxe/rxe.c: pr_info("unloaded\n"); drivers/infiniband/sw/rxe/rxe_net.c: pr_err("Failed to create IPv4 UDP tunnel\n"); drivers/infiniband/sw/rxe/rxe_net.c: pr_warn("IPv6 is not supported, can not create a UDPv6 socket\n"); drivers/infiniband/sw/rxe/rxe_net.c: pr_err("Failed to create IPv6 UDP tunnel\n"); drivers/infiniband/sw/rxe/rxe_net.c: pr_err("Failed to register netdev notifier\n");Quoted 1 line
It is not exactly mysterious where these come from?
If I got you correctly, you mean that we can easily locate the above
pr_xxxlogs. As such, it is not necessary to add function names.
Quoted 6 lines
From this perspective, I agree with you.
Why I make this commit is that we can directly use this
pr_info("xxxxx")when some bug occurs. But in the logs, the function names appear.With this commit, we can decrease some work loads with some bug occurs.
That doesn't seem like a good reason to merge something so abnormal for pr_* functions
Jason