pnfs/filelayout: add tracepoint to getdeviceinfo

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>
This commit is contained in:
Olga Kornievskaia 2024-01-26 13:04:16 -05:00 committed by Trond Myklebust
parent bcac8bff90
commit 47f7c95632
3 changed files with 32 additions and 0 deletions

View 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)) {

View 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

View 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