Logging in the timer arm routine doesn't provide any context to the user who is debugging. This patch adds the function who called the arm routine to the log statement.
The resultant log message looks like this: kernel: [ 9390.263809] host88: xid 200: Exchange timer armed (fc_exch_seq_send+0x149/0x1c0 [libfc]): 2000 msecs Signed-off-by: Robert Love <[email protected]> --- drivers/scsi/libfc/fc_exch.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/libfc/fc_exch.c b/drivers/scsi/libfc/fc_exch.c index 5879929..e686161 100644 --- a/drivers/scsi/libfc/fc_exch.c +++ b/drivers/scsi/libfc/fc_exch.c @@ -23,6 +23,7 @@ * Fibre Channel exchange and sequence handling. */ +#include <linux/kallsyms.h> #include <linux/timer.h> #include <linux/slab.h> #include <linux/err.h> @@ -357,10 +358,15 @@ static inline void fc_exch_timer_cancel(struct fc_exch *ep) static inline void fc_exch_timer_set_locked(struct fc_exch *ep, unsigned int timer_msec) { + char symb_name[KSYM_NAME_LEN]; + if (ep->state & (FC_EX_RST_CLEANUP | FC_EX_DONE)) return; - FC_EXCH_DBG(ep, "Exchange timer armed : %d msecs\n", timer_msec); + sprint_symbol(symb_name, (unsigned long)__builtin_return_address(0)); + + FC_EXCH_DBG(ep, "Exchange timer armed (%s): %d msecs\n", + symb_name, timer_msec); if (queue_delayed_work(fc_exch_workqueue, &ep->timeout_work, msecs_to_jiffies(timer_msec))) _______________________________________________ fcoe-devel mailing list [email protected] http://lists.open-fcoe.org/mailman/listinfo/fcoe-devel
