Skip to content

Commit 47f7c95

Browse files
olgakorn1Trond Myklebust
authored andcommitted
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>
1 parent bcac8bf commit 47f7c95

File tree

3 files changed

+32
-0
lines changed

3 files changed

+32
-0
lines changed

fs/nfs/filelayout/filelayoutdev.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
#include "../internal.h"
3636
#include "../nfs4session.h"
3737
#include "filelayout.h"
38+
#include "../nfs4trace.h"
3839

3940
#define NFSDBG_FACILITY NFSDBG_PNFS_LD
4041

@@ -172,6 +173,7 @@ nfs4_fl_alloc_deviceid_node(struct nfs_server *server, struct pnfs_device *pdev,
172173
dsaddr->ds_list[i] = nfs4_pnfs_ds_add(&dsaddrs, gfp_flags);
173174
if (!dsaddr->ds_list[i])
174175
goto out_err_drain_dsaddrs;
176+
trace_fl_getdevinfo(server, &pdev->dev_id, dsaddr->ds_list[i]->ds_remotestr);
175177

176178
/* If DS was already in cache, free ds addrs */
177179
while (!list_empty(&dsaddrs)) {

fs/nfs/nfs4trace.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,6 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(pnfs_mds_fallback_write_pagelist);
2828
EXPORT_TRACEPOINT_SYMBOL_GPL(ff_layout_read_error);
2929
EXPORT_TRACEPOINT_SYMBOL_GPL(ff_layout_write_error);
3030
EXPORT_TRACEPOINT_SYMBOL_GPL(ff_layout_commit_error);
31+
32+
EXPORT_TRACEPOINT_SYMBOL_GPL(fl_getdevinfo);
3133
#endif

fs/nfs/nfs4trace.h

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1991,6 +1991,34 @@ DECLARE_EVENT_CLASS(nfs4_deviceid_status,
19911991
DEFINE_PNFS_DEVICEID_STATUS(nfs4_getdeviceinfo);
19921992
DEFINE_PNFS_DEVICEID_STATUS(nfs4_find_deviceid);
19931993

1994+
TRACE_EVENT(fl_getdevinfo,
1995+
TP_PROTO(
1996+
const struct nfs_server *server,
1997+
const struct nfs4_deviceid *deviceid,
1998+
char *ds_remotestr
1999+
),
2000+
TP_ARGS(server, deviceid, ds_remotestr),
2001+
2002+
TP_STRUCT__entry(
2003+
__string(mds_addr, server->nfs_client->cl_hostname)
2004+
__array(unsigned char, deviceid, NFS4_DEVICEID4_SIZE)
2005+
__string(ds_ips, ds_remotestr)
2006+
),
2007+
2008+
TP_fast_assign(
2009+
__assign_str(mds_addr, server->nfs_client->cl_hostname);
2010+
__assign_str(ds_ips, ds_remotestr);
2011+
memcpy(__entry->deviceid, deviceid->data,
2012+
NFS4_DEVICEID4_SIZE);
2013+
),
2014+
TP_printk(
2015+
"deviceid=%s, mds_addr=%s, ds_ips=%s",
2016+
__print_hex(__entry->deviceid, NFS4_DEVICEID4_SIZE),
2017+
__get_str(mds_addr),
2018+
__get_str(ds_ips)
2019+
)
2020+
);
2021+
19942022
DECLARE_EVENT_CLASS(nfs4_flexfiles_io_event,
19952023
TP_PROTO(
19962024
const struct nfs_pgio_header *hdr

0 commit comments

Comments
 (0)