Skip to content

Commit 8eea78d

Browse files
authored
DLPX-93204 estat and stbtrace miss nfsv4 writes (#105)
PR URL: https://www.github.com/delphix/performance-diagnostics/pull/105
1 parent 8b1626a commit 8eea78d

File tree

4 files changed

+9
-11
lines changed

4 files changed

+9
-11
lines changed

bpf/estat/nfs-by-client.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2019 Delphix. All rights reserved.
2+
* Copyright 2019, 2025 Delphix. All rights reserved.
33
*
44
* SPDX-License-Identifier: GPL-2.0-or-later
55
*/
@@ -154,7 +154,7 @@ nfsd4_write_start(struct pt_regs *ctx, struct svc_rqst *rqstp, void *cstate,
154154
nfs_data_t data = {};
155155
data.ts = bpf_ktime_get_ns();
156156
data.size = 0;
157-
data.write_arg = &(nfs_write->wr_bytes_written);
157+
data.write_arg = &nfs_write->wr_buflen;
158158
data.sync = ASYNC_WRITE; // Assume async write, sync writes detected
159159
data.cached = AXIS_NOT_APPLICABLE;
160160
bpf_probe_read_str(&data.client, CLIENT_LEN, rqstp->rq_client->name);

bpf/estat/nfs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2019 Delphix. All rights reserved.
2+
* Copyright 2019, 2025 Delphix. All rights reserved.
33
*
44
* SPDX-License-Identifier: GPL-2.0-or-later
55
*/
@@ -154,7 +154,7 @@ nfsd4_write_start(struct pt_regs *ctx, struct svc_rqst *rqstp, void *cstate,
154154
nfs_data_t data = {};
155155
data.ts = bpf_ktime_get_ns();
156156
data.size = 0;
157-
data.write_arg = &(nfs_write->wr_bytes_written);
157+
data.write_arg = &nfs_write->wr_buflen;
158158
data.sync = ASYNC_WRITE; // Assume async write, sync writes detected
159159
data.cached = AXIS_NOT_APPLICABLE;
160160
bpf_probe_read_str(&data.client, CLIENT_LEN, rqstp->rq_client->name);

bpf/stbtrace/nfs.st

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2019, 2020 by Delphix. All rights reserved.
2+
# Copyright (c) 2019, 2025 by Delphix. All rights reserved.
33
#
44
# SPDX-License-Identifier: GPL-2.0-or-later
55
#
@@ -172,7 +172,7 @@ int nfsd4_write_start(struct pt_regs *ctx, struct svc_rqst *rqstp,
172172
nfs_data_t data = {};
173173
data.ts = bpf_ktime_get_ns();
174174
data.size = 0;
175-
data.write_arg = nfs_write;
175+
data.write_arg = &nfs_write->wr_buflen;
176176
data.sync = ASYNC_WRITE; // Assume async write, sync writes detected
177177
data.cached = AXIS_NOT_APPLICABLE;
178178
bpf_probe_read_str(&data.client, CLIENT_LEN, rqstp->rq_client->name);
@@ -292,9 +292,7 @@ int nfsd4_write_done(struct pt_regs *ctx)
292292
return 0; // missed issue
293293
}
294294

295-
bpf_probe_read(&nfs_write, sizeof(nfs_write), data->write_arg);
296-
data->size = nfs_write.wr_bytes_written;
297-
295+
bpf_probe_read(&data->size, sizeof(u32), data->write_arg);
298296
aggregate_data(data, ts, WRITE_STR, NFSV4_STR);
299297
nfs_base_data.delete(&pid);
300298

lib/iterative_template.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright 2019 Delphix. All rights reserved.
2+
# Copyright 2019, 2025 Delphix. All rights reserved.
33
#
44
# SPDX-License-Identifier: GPL-2.0-or-later
55
#
@@ -52,7 +52,7 @@ class IterativeTemplate:
5252
TOP_ITERATIVE_REGEX = r"\$(\w+)\:(\{\w+\|[^}]*})\$"
5353

5454
#
55-
# The org.stringtemplate.v4 used int he scripts requires dollars
55+
# The org.stringtemplate.v4 used in the scripts requires dollars
5656
# signs around template variables, e.g. $var$. The trailing
5757
# dollar sign is removed to work with python string templates
5858
# using DOUBLE_DOLLAR_REGEX.

0 commit comments

Comments
 (0)