]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
pnfs/filelayout: add tracepoint to getdeviceinfo
authorOlga Kornievskaia <kolga@netapp.com>
Fri, 26 Jan 2024 18:04:16 +0000 (13:04 -0500)
committerTrond Myklebust <trond.myklebust@hammerspace.com>
Wed, 28 Feb 2024 21:18:19 +0000 (16:18 -0500)
While decoding filelayout getdeviceinfo received, print out the
information about the location of data servers (IPs).

Generic getdeviceinfo tracepoints prints the MDS's ip for the
dstaddr. In this patch, separate the MDS's address from the
DS's addresses.

Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
fs/nfs/filelayout/filelayoutdev.c
fs/nfs/nfs4trace.c
fs/nfs/nfs4trace.h

index acf4b88889dc3814ebfe06d3883c96f429415f2a..4fa304fa5bc4b2346458877c39a558936a49317a 100644 (file)
@@ -35,6 +35,7 @@
 #include "../internal.h"
 #include "../nfs4session.h"
 #include "filelayout.h"
+#include "../nfs4trace.h"
 
 #define NFSDBG_FACILITY                NFSDBG_PNFS_LD
 
@@ -172,6 +173,7 @@ nfs4_fl_alloc_deviceid_node(struct nfs_server *server, struct pnfs_device *pdev,
                dsaddr->ds_list[i] = nfs4_pnfs_ds_add(&dsaddrs, gfp_flags);
                if (!dsaddr->ds_list[i])
                        goto out_err_drain_dsaddrs;
+               trace_fl_getdevinfo(server, &pdev->dev_id, dsaddr->ds_list[i]->ds_remotestr);
 
                /* If DS was already in cache, free ds addrs */
                while (!list_empty(&dsaddrs)) {
index d9ac556bebcf685c50a026594823d434202ab903..d22c6670f770f18949ed908e8e64572c174aeb41 100644 (file)
@@ -28,4 +28,6 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(pnfs_mds_fallback_write_pagelist);
 EXPORT_TRACEPOINT_SYMBOL_GPL(ff_layout_read_error);
 EXPORT_TRACEPOINT_SYMBOL_GPL(ff_layout_write_error);
 EXPORT_TRACEPOINT_SYMBOL_GPL(ff_layout_commit_error);
+
+EXPORT_TRACEPOINT_SYMBOL_GPL(fl_getdevinfo);
 #endif
index d27919d7241d389b257939c26cc134d4ff1be76f..713d080fd26829f60877152c44a8cbea78b9a562 100644 (file)
@@ -1991,6 +1991,34 @@ DECLARE_EVENT_CLASS(nfs4_deviceid_status,
 DEFINE_PNFS_DEVICEID_STATUS(nfs4_getdeviceinfo);
 DEFINE_PNFS_DEVICEID_STATUS(nfs4_find_deviceid);
 
+TRACE_EVENT(fl_getdevinfo,
+               TP_PROTO(
+                       const struct nfs_server *server,
+                       const struct nfs4_deviceid *deviceid,
+                       char *ds_remotestr
+               ),
+               TP_ARGS(server, deviceid, ds_remotestr),
+
+               TP_STRUCT__entry(
+                       __string(mds_addr, server->nfs_client->cl_hostname)
+                       __array(unsigned char, deviceid, NFS4_DEVICEID4_SIZE)
+                       __string(ds_ips, ds_remotestr)
+               ),
+
+               TP_fast_assign(
+                       __assign_str(mds_addr, server->nfs_client->cl_hostname);
+                       __assign_str(ds_ips, ds_remotestr);
+                       memcpy(__entry->deviceid, deviceid->data,
+                              NFS4_DEVICEID4_SIZE);
+               ),
+               TP_printk(
+                       "deviceid=%s, mds_addr=%s, ds_ips=%s",
+                       __print_hex(__entry->deviceid, NFS4_DEVICEID4_SIZE),
+                       __get_str(mds_addr),
+                       __get_str(ds_ips)
+               )
+);
+
 DECLARE_EVENT_CLASS(nfs4_flexfiles_io_event,
                TP_PROTO(
                        const struct nfs_pgio_header *hdr