Whamcloud - gitweb
LU-16213 kfilnd: Add peer info to some debug statements 81/48781/4
authorChris Horn <chris.horn@hpe.com>
Thu, 18 Aug 2022 19:02:18 +0000 (13:02 -0600)
committerOleg Drokin <green@whamcloud.com>
Thu, 19 Jan 2023 15:29:51 +0000 (15:29 +0000)
Add kfilnd_peer pointer address to some debug statements.

Use 0x%llx format consistently when printing kfilnd_peer::kp_addr

Also add the message type to the TN debug macro.

HPE-bug-id: LUS-11128
Test-Parameters: trivial
Signed-off-by: Chris Horn <chris.horn@hpe.com>
Change-Id: I4410ca9215f9d0a6eb65e6d4f953234fa7fba5ea
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/48781
Reviewed-by: Ron Gredvig <ron.gredvig@hpe.com>
Reviewed-by: Ian Ziemba <ian.ziemba@hpe.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
lnet/klnds/kfilnd/kfilnd.h
lnet/klnds/kfilnd/kfilnd_peer.c

index abf9adf..4f0fb9c 100644 (file)
@@ -481,11 +481,12 @@ struct kfilnd_msg {
        !IS_ERR_OR_NULL((tn)->tn_kp)
 
 #define KFILND_TN_DIR_DEBUG(tn, fmt, dir, ...) \
-       CDEBUG(D_NET, "Transaction ID %p: %s:%u %s %s:%llu " fmt "\n", \
+       CDEBUG(D_NET, "%s Transaction ID %p: %s:%u %s %s(%p):0x%llx " fmt "\n", \
+              msg_type_to_str(tn->msg_type), \
               (tn), \
               libcfs_nidstr(&(tn)->tn_ep->end_dev->kfd_ni->ni_nid), \
               (tn)->tn_ep->end_context_id, dir, \
-              libcfs_nid2str((tn)->tn_kp->kp_nid), \
+              libcfs_nid2str((tn)->tn_kp->kp_nid), tn->tn_kp, \
               KFILND_TN_PEER_VALID(tn) ? \
                KFILND_RX_CONTEXT((tn)->tn_kp->kp_addr) : 0, \
               ##__VA_ARGS__)
@@ -499,11 +500,11 @@ struct kfilnd_msg {
        } while (0)
 
 #define KFILND_TN_DIR_ERROR(tn, fmt, dir, ...) \
-       CNETERR("Transaction ID %p: %s:%u %s %s:%llu " fmt "\n", \
+       CNETERR("Transaction ID %p: %s:%u %s %s(%p):0x%llx " fmt "\n", \
                (tn), \
                libcfs_nidstr(&(tn)->tn_ep->end_dev->kfd_ni->ni_nid), \
                (tn)->tn_ep->end_context_id, dir, \
-               libcfs_nid2str((tn)->tn_kp->kp_nid), \
+               libcfs_nid2str((tn)->tn_kp->kp_nid), tn->tn_kp, \
                KFILND_TN_PEER_VALID(tn) ? \
                        KFILND_RX_CONTEXT((tn)->tn_kp->kp_addr) : 0, \
                ##__VA_ARGS__)
index 84653ca..de780a3 100644 (file)
@@ -47,8 +47,8 @@ static void kfilnd_peer_free(void *ptr, void *arg)
 {
        struct kfilnd_peer *kp = ptr;
 
-       CDEBUG(D_NET, "%s(0x%llx) peer entry freed\n",
-              libcfs_nid2str(kp->kp_nid), kp->kp_addr);
+       CDEBUG(D_NET, "%s(%p):0x%llx peer entry freed\n",
+              libcfs_nid2str(kp->kp_nid), kp, kp->kp_addr);
 
        kfi_av_remove(kp->kp_dev->kfd_av, &kp->kp_addr, 1, 0);
 
@@ -65,8 +65,8 @@ void kfilnd_peer_down(struct kfilnd_peer *kp)
                struct lnet_nid peer_nid;
 
                lnet_nid4_to_nid(kp->kp_nid, &peer_nid);
-               CDEBUG(D_NET, "%s(0x%llx) marked for removal from peer cache\n",
-                      libcfs_nidstr(&peer_nid), kp->kp_addr);
+               CDEBUG(D_NET, "%s(%p):0x%llx marked for removal from peer cache\n",
+                      libcfs_nidstr(&peer_nid), kp, kp->kp_addr);
 
                lnet_notify(kp->kp_dev->kfd_ni, &peer_nid, false, false,
                            kp->kp_last_alive);
@@ -87,8 +87,8 @@ void kfilnd_peer_put(struct kfilnd_peer *kp)
                                       peer_cache_params);
                refcount_dec(&kp->kp_cnt);
 
-               CDEBUG(D_NET, "%s(0x%llx) removed from peer cache\n",
-                      libcfs_nid2str(kp->kp_nid), kp->kp_addr);
+               CDEBUG(D_NET, "%s(%p):0x%llx removed from peer cache\n",
+                      libcfs_nid2str(kp->kp_nid), kp, kp->kp_addr);
        }
 
        if (refcount_dec_and_test(&kp->kp_cnt))
@@ -198,8 +198,8 @@ again:
 
        kfilnd_peer_alive(kp);
 
-       CDEBUG(D_NET, "%s(0x%llx) peer entry allocated\n",
-              libcfs_nid2str(kp->kp_nid), kp->kp_addr);
+       CDEBUG(D_NET, "%s(%p):0x%llx peer entry allocated\n",
+              libcfs_nid2str(kp->kp_nid), kp, kp->kp_addr);
 
        return kp;