| 1 |
// NFS procedure tapset |
| 2 |
// Copyright (C) 2006 IBM Corp. |
| 3 |
// Copyright (C) 2007-2013 Red Hat |
| 4 |
// |
| 5 |
// This file is part of systemtap, and is free software. You can |
| 6 |
// redistribute it and/or modify it under the terms of the GNU General |
| 7 |
// Public License (GPL); either version 2, or (at your option) any |
| 8 |
// later version. |
| 9 |
|
| 10 |
%{ |
| 11 |
/* For AF_INET */ |
| 12 |
#include <linux/socket.h> |
| 13 |
%} |
| 14 |
|
| 15 |
function AF_INET:long() |
| 16 |
{ |
| 17 |
return @const("AF_INET") |
| 18 |
} |
| 19 |
|
| 20 |
function AF_INET6:long() |
| 21 |
{ |
| 22 |
return @const("AF_INET6") |
| 23 |
} |
| 24 |
|
| 25 |
function NFS_I:long(inode:long) |
| 26 |
{ |
| 27 |
/* |
| 28 |
* Notice we're casting 0 here on purpose. We need the offset |
| 29 |
* of the 'vfs_inode' member of 'struct nfs_inode'. This is |
| 30 |
* the script language equivalent of: |
| 31 |
* offset = offsetof(struct nfs_inode, vfs_inode); |
| 32 |
*/ |
| 33 |
offset = &@cast(0, "nfs_inode", "kernel:nfs")->vfs_inode |
| 34 |
|
| 35 |
return (inode - offset) |
| 36 |
} |
| 37 |
|
| 38 |
@__private30 function NFS_FH:long(inode:long) |
| 39 |
{ |
| 40 |
return &@cast(NFS_I(inode), "nfs_inode", "kernel:nfs")->fh |
| 41 |
} |
| 42 |
|
| 43 |
function NFS_SERVER:long(inode:long) |
| 44 |
{ |
| 45 |
return @cast(inode, "inode")->i_sb->s_fs_info |
| 46 |
} |
| 47 |
|
| 48 |
@__private30 function NFS_CLIENT:long(inode:long) |
| 49 |
{ |
| 50 |
return @cast(NFS_SERVER(inode), "nfs_server", "kernel:nfs")->client |
| 51 |
} |
| 52 |
|
| 53 |
%( systemtap_v < "2.3" %? |
| 54 |
/* deprecated */ |
| 55 |
function stap_NFS_CLIENT:long(inode:long) |
| 56 |
{ |
| 57 |
return NFS_CLIENT(inode) |
| 58 |
} |
| 59 |
%) |
| 60 |
|
| 61 |
function NFS_PROTO:long(inode:long) |
| 62 |
{ |
| 63 |
nfsserver = NFS_SERVER(inode) |
| 64 |
return @choose_defined(@cast(nfsserver, "nfs_server", "kernel:nfs")->nfs_client->rpc_ops, |
| 65 |
@cast(nfsserver, "nfs_server", "kernel:nfs")->rpc_ops) |
| 66 |
} |
| 67 |
|
| 68 |
/* Get ip address from a rpc_clnt */ |
| 69 |
%( systemtap_v >= "4.3" %? |
| 70 |
function get_ip_from_client:string(clnt:long) |
| 71 |
{ |
| 72 |
cl_xprt = @cast(clnt, "rpc_clnt", "kernel:sunrpc")->cl_xprt |
| 73 |
addr = &@cast(cl_xprt, "rpc_xprt", "kernel:sunrpc")->addr |
| 74 |
|
| 75 |
/* In reality, 'cl_xprt->addr' is of 'sockaddr_storage' type |
| 76 |
* (since 2.6.19). But when used, you cast it to what is |
| 77 |
* inside that buffer. */ |
| 78 |
if (@cast(addr, "sockaddr")->sa_family |
| 79 |
== @const("AF_INET")) { |
| 80 |
return format_ipaddr(&@cast(addr, "sockaddr_in", "kernel:sunrpc")->sin_addr->s_addr, @const("AF_INET")) |
| 81 |
} |
| 82 |
else if (@cast(addr, "sockaddr")->sa_family |
| 83 |
== @const("AF_INET6")) { |
| 84 |
return format_ipaddr(&@cast(addr, "sockaddr_in6", "kernel:sunrpc")->sin6_addr, @const("AF_INET6")) |
| 85 |
} |
| 86 |
return "" |
| 87 |
} |
| 88 |
%: |
| 89 |
function get_ip_from_client:long(clnt:long) |
| 90 |
{ |
| 91 |
cl_xprt = @cast(clnt, "rpc_clnt", "kernel:sunrpc")->cl_xprt |
| 92 |
addr = &@cast(cl_xprt, "rpc_xprt", "kernel:sunrpc")->addr |
| 93 |
if (@cast(addr, "sockaddr_in", "kernel:sunrpc")->sin_family |
| 94 |
!= @const("AF_INET")) { |
| 95 |
/* Now consider ipv4 only */ |
| 96 |
return 0 |
| 97 |
} |
| 98 |
return @cast(addr, "sockaddr_in", "kernel:sunrpc")->sin_addr->s_addr |
| 99 |
} |
| 100 |
%) |
| 101 |
|
| 102 |
/* Get protocol types from a rpc_clnt */ |
| 103 |
function get_prot_from_client:long(clnt:long) |
| 104 |
{ |
| 105 |
cl_xprt = @cast(clnt, "rpc_clnt", "kernel:sunrpc")->cl_xprt |
| 106 |
return @cast(cl_xprt, "rpc_xprt", "kernel:sunrpc")->prot |
| 107 |
} |
| 108 |
|
| 109 |
/* Get ip address from a rpc_task */ |
| 110 |
%( systemtap_v >= "4.3" %? |
| 111 |
function get_ip:string(task:long) |
| 112 |
{ |
| 113 |
clnt = @cast(task, "rpc_task", "kernel:sunrpc")->tk_client |
| 114 |
return get_ip_from_client(clnt) |
| 115 |
} |
| 116 |
%: |
| 117 |
function get_ip:long(task:long) |
| 118 |
{ |
| 119 |
clnt = @cast(task, "rpc_task", "kernel:sunrpc")->tk_client |
| 120 |
return get_ip_from_client(clnt) |
| 121 |
} |
| 122 |
%) |
| 123 |
|
| 124 |
/* Get protocol types from a rpc_task */ |
| 125 |
function get_prot:long(task:long) |
| 126 |
{ |
| 127 |
clnt = @cast(task, "rpc_task", "kernel:sunrpc")->tk_client |
| 128 |
return get_prot_from_client(clnt) |
| 129 |
} |
| 130 |
|
| 131 |
@__private30 function __nfsv4_bitmask:long(dir:long, i:long) |
| 132 |
{ |
| 133 |
%( CONFIG_NFS_V4 == "[ym]" %? |
| 134 |
return @cast(NFS_SERVER(dir), "nfs_server", "kernel:nfs")->attr_bitmask[i] |
| 135 |
%: |
| 136 |
return 0 |
| 137 |
%) |
| 138 |
} |
| 139 |
|
| 140 |
%( systemtap_v < "2.3" %? |
| 141 |
/* deprecated */ |
| 142 |
function __getfh_inode:long(dir:long) |
| 143 |
{ |
| 144 |
return NFS_FH(dir) |
| 145 |
} |
| 146 |
%) |
| 147 |
|
| 148 |
probe nfs.proc.entries = nfs.proc.lookup, |
| 149 |
nfs.proc.read ?, |
| 150 |
nfs.proc.write ?, |
| 151 |
nfs.proc.commit ?, |
| 152 |
nfs.proc.read_setup, |
| 153 |
nfs.proc.write_setup, |
| 154 |
nfs.proc.commit_setup, |
| 155 |
nfs.proc.rename_setup, |
| 156 |
nfs.proc.read_done, |
| 157 |
nfs.proc.write_done, |
| 158 |
nfs.proc.commit_done, |
| 159 |
nfs.proc.rename_done, |
| 160 |
nfs.proc.open, |
| 161 |
nfs.proc.create, |
| 162 |
nfs.proc.rename, |
| 163 |
nfs.proc.remove, |
| 164 |
nfs.proc.release ? |
| 165 |
{ |
| 166 |
} |
| 167 |
|
| 168 |
|
| 169 |
probe nfs.proc.return = nfs.proc.lookup.return, |
| 170 |
nfs.proc.read.return ?, |
| 171 |
nfs.proc.write.return ?, |
| 172 |
nfs.proc.commit.return ?, |
| 173 |
nfs.proc.read_setup.return, |
| 174 |
nfs.proc.write_setup.return, |
| 175 |
nfs.proc.commit_setup.return, |
| 176 |
nfs.proc.rename_setup.return, |
| 177 |
nfs.proc.read_done.return, |
| 178 |
nfs.proc.write_done.return, |
| 179 |
nfs.proc.commit_done.return, |
| 180 |
nfs.proc.rename_done.return, |
| 181 |
nfs.proc.open.return, |
| 182 |
nfs.proc.create.return, |
| 183 |
nfs.proc.rename.return, |
| 184 |
nfs.proc.remove.return, |
| 185 |
nfs.proc.release.return ? |
| 186 |
{ |
| 187 |
} |
| 188 |
|
| 189 |
/** |
| 190 |
* probe nfs.proc.lookup - NFS client opens/searches a file on server |
| 191 |
* |
| 192 |
* @server_ip: IP address of server |
| 193 |
* @prot: transfer protocol |
| 194 |
* @version: NFS version |
| 195 |
* @filename: the name of file which client opens/searches on server |
| 196 |
* @name_len: the length of file name |
| 197 |
* @bitmask0: V4 bitmask representing the set of attributes supported |
| 198 |
* on this filesystem |
| 199 |
* @bitmask1: V4 bitmask representing the set of attributes supported |
| 200 |
* on this filesystem |
| 201 |
*/ |
| 202 |
probe nfs.proc.lookup = nfs.proc2.lookup, |
| 203 |
nfs.proc3.lookup, |
| 204 |
nfs.proc4.lookup |
| 205 |
{ |
| 206 |
} |
| 207 |
|
| 208 |
probe nfs.proc.lookup.return = nfs.proc2.lookup.return, |
| 209 |
nfs.proc3.lookup.return, |
| 210 |
nfs.proc4.lookup.return |
| 211 |
{} |
| 212 |
|
| 213 |
probe nfs.proc2.lookup = _nfs.proc2.lookup !, _nfs.proc2.missing_lookup |
| 214 |
{ |
| 215 |
version = 2 |
| 216 |
bitmask0 = 0 |
| 217 |
bitmask1 = 0 |
| 218 |
|
| 219 |
name = "nfs.proc2.lookup" |
| 220 |
argstr = sprintf("%s", filename) |
| 221 |
} |
| 222 |
|
| 223 |
probe _nfs.proc2.lookup = kernel.function("nfs_proc_lookup") !, |
| 224 |
module("nfs").function("nfs_proc_lookup") ?, |
| 225 |
module("nfsv2").function("nfs_proc_lookup") ? |
| 226 |
{ |
| 227 |
client = NFS_CLIENT($dir) |
| 228 |
server_ip = get_ip_from_client(client) |
| 229 |
prot = get_prot_from_client(client) |
| 230 |
|
| 231 |
name_len = $name->len |
| 232 |
filename = kernel_string_n($name->name, name_len) |
| 233 |
} |
| 234 |
|
| 235 |
probe _nfs.proc2.missing_lookup = never |
| 236 |
{ |
| 237 |
client = 0 |
| 238 |
%( systemtap_v >= "4.3" %? |
| 239 |
server_ip = "" |
| 240 |
%: |
| 241 |
server_ip = 0 |
| 242 |
%) |
| 243 |
prot = 0 |
| 244 |
|
| 245 |
name_len = 0 |
| 246 |
filename = "" |
| 247 |
} |
| 248 |
|
| 249 |
probe nfs.proc2.lookup.return = |
| 250 |
kernel.function("nfs_proc_lookup").return !, |
| 251 |
module("nfs").function("nfs_proc_lookup").return !, |
| 252 |
module("nfsv2").function("nfs_proc_lookup").return !, |
| 253 |
never |
| 254 |
{ |
| 255 |
version = 2 |
| 256 |
name = "nfs.proc2.lookup.return" |
| 257 |
retstr = (@defined($return) ? sprintf("%d", $return) : "N/A") |
| 258 |
} |
| 259 |
|
| 260 |
probe nfs.proc3.lookup = kernel.function("nfs3_proc_lookup") !, |
| 261 |
module("nfs").function("nfs3_proc_lookup") ?, |
| 262 |
module("nfsv3").function("nfs3_proc_lookup") ? |
| 263 |
{ |
| 264 |
client = NFS_CLIENT($dir) |
| 265 |
server_ip = get_ip_from_client(client) |
| 266 |
prot = get_prot_from_client(client) |
| 267 |
version = 3 |
| 268 |
|
| 269 |
name_len = $name->len |
| 270 |
filename = kernel_string_n($name->name, name_len) |
| 271 |
bitmask0 = 0 |
| 272 |
bitmask1 = 0 |
| 273 |
|
| 274 |
name = "nfs.proc3.lookup" |
| 275 |
argstr = sprintf("%s", filename) |
| 276 |
} |
| 277 |
|
| 278 |
|
| 279 |
probe nfs.proc3.lookup.return = |
| 280 |
kernel.function("nfs3_proc_lookup").return !, |
| 281 |
module("nfs").function("nfs3_proc_lookup").return ?, |
| 282 |
module("nfsv3").function("nfs3_proc_lookup").return ? |
| 283 |
{ |
| 284 |
version = 3 |
| 285 |
name = "nfs.proc3.lookup.return" |
| 286 |
retstr = sprintf("%d", $return) |
| 287 |
} |
| 288 |
|
| 289 |
probe nfs.proc4.lookup = kernel.function("nfs4_proc_lookup") !, |
| 290 |
module("nfs").function("nfs4_proc_lookup") ?, |
| 291 |
module("nfsv4").function("nfs4_proc_lookup") ? |
| 292 |
{ |
| 293 |
client = NFS_CLIENT($dir) |
| 294 |
server_ip = get_ip_from_client(client) |
| 295 |
prot = get_prot_from_client(client) |
| 296 |
version = 4 |
| 297 |
|
| 298 |
name_len = $name->len |
| 299 |
filename = kernel_string_n($name->name, name_len) |
| 300 |
bitmask0 = __nfsv4_bitmask($dir, 0) |
| 301 |
bitmask1 = __nfsv4_bitmask($dir, 1) |
| 302 |
|
| 303 |
name = "nfs.proc4.lookup" |
| 304 |
argstr = sprintf("%s", filename) |
| 305 |
} |
| 306 |
|
| 307 |
probe nfs.proc4.lookup.return = |
| 308 |
kernel.function("nfs4_proc_lookup").return !, |
| 309 |
module("nfs").function("nfs4_proc_lookup").return ?, |
| 310 |
module("nfsv4").function("nfs4_proc_lookup").return ? |
| 311 |
{ |
| 312 |
version = 4 |
| 313 |
name = "nfs.proc4.lookup.return" |
| 314 |
retstr = sprintf("%d", $return) |
| 315 |
} |
| 316 |
|
| 317 |
/** |
| 318 |
* probe nfs.proc.read - NFS client synchronously reads file from server |
| 319 |
* |
| 320 |
* @server_ip: IP address of server |
| 321 |
* @prot: transfer protocol |
| 322 |
* @version: NFS version |
| 323 |
* @flags: used to set task->tk_flags in rpc_init_task function |
| 324 |
* @size: |
| 325 |
* @count: read bytes in this execution |
| 326 |
* @offset: the file offset |
| 327 |
* |
| 328 |
* All the nfs.proc.read kernel functions were removed in kernel commit |
| 329 |
* 8e0969 in December 2006, so these probes do not exist on Linux |
| 330 |
* 2.6.21 and newer kernels. |
| 331 |
*/ |
| 332 |
probe nfs.proc.read = nfs.proc2.read ?, |
| 333 |
nfs.proc3.read ?, |
| 334 |
nfs.proc4.read ? |
| 335 |
{} |
| 336 |
|
| 337 |
|
| 338 |
probe nfs.proc.read.return = nfs.proc2.read.return ?, |
| 339 |
nfs.proc3.read.return ?, |
| 340 |
nfs.proc4.read.return ? |
| 341 |
{ |
| 342 |
} |
| 343 |
|
| 344 |
probe nfs.proc2.read = _nfs.proc2.read !, _nfs.proc2.missing_read |
| 345 |
{ |
| 346 |
version = 2 |
| 347 |
|
| 348 |
name = "nfs.proc2.read" |
| 349 |
argstr = sprintf("%d,%d", count, offset) |
| 350 |
|
| 351 |
size = count |
| 352 |
units = "bytes" |
| 353 |
} |
| 354 |
probe _nfs.proc2.read = kernel.function("nfs_proc_read") !, |
| 355 |
module("nfs").function("nfs_proc_read") ?, |
| 356 |
module("nfsv2").function("nfs_proc_read") ? |
| 357 |
{ |
| 358 |
server_ip = @_nfs_data_server_ip($rdata) |
| 359 |
prot = @_nfs_data_prot($rdata) |
| 360 |
version = 2 |
| 361 |
|
| 362 |
flags = $rdata->flags |
| 363 |
count = @_nfs_data_args_count($rdata) |
| 364 |
offset = $rdata->args->offset |
| 365 |
} |
| 366 |
probe _nfs.proc2.missing_read = never |
| 367 |
{ |
| 368 |
%( systemtap_v >= "4.3" %? |
| 369 |
server_ip = "" |
| 370 |
%: |
| 371 |
server_ip = 0 |
| 372 |
%) |
| 373 |
prot = 0 |
| 374 |
|
| 375 |
flags = 0 |
| 376 |
count = 0 |
| 377 |
offset = 0 |
| 378 |
} |
| 379 |
|
| 380 |
probe nfs.proc2.read.return = kernel.function("nfs_proc_read").return !, |
| 381 |
module("nfs").function("nfs_proc_read").return !, |
| 382 |
module("nfsv2").function("nfs_proc_read").return !, |
| 383 |
never |
| 384 |
{ |
| 385 |
version = 2 |
| 386 |
name = "nfs.proc2.read.return" |
| 387 |
retstr = (@defined($return) ? sprintf("%d", $return) : "N/A") |
| 388 |
} |
| 389 |
|
| 390 |
|
| 391 |
probe nfs.proc3.read = kernel.function("nfs3_proc_read") !, |
| 392 |
module("nfs").function("nfs3_proc_read") ?, |
| 393 |
module("nfsv3").function("nfs3_proc_read") ? |
| 394 |
{ |
| 395 |
server_ip = @_nfs_data_server_ip($rdata) |
| 396 |
prot = @_nfs_data_prot($rdata) |
| 397 |
version = 3 |
| 398 |
|
| 399 |
flags = $rdata->flags |
| 400 |
count = @_nfs_data_args_count($rdata) |
| 401 |
offset = $rdata->args->offset |
| 402 |
|
| 403 |
name = "nfs.proc3.read" |
| 404 |
argstr = sprintf("%d,%d", count, offset) |
| 405 |
|
| 406 |
size = count |
| 407 |
units = "bytes" |
| 408 |
} |
| 409 |
|
| 410 |
probe nfs.proc3.read.return = |
| 411 |
kernel.function("nfs3_proc_read").return !, |
| 412 |
module("nfs").function("nfs3_proc_read").return ?, |
| 413 |
module("nfsv3").function("nfs3_proc_read").return ? |
| 414 |
{ |
| 415 |
version = 3 |
| 416 |
name = "nfs.proc3.read.return" |
| 417 |
retstr = sprintf("%d", $return) |
| 418 |
} |
| 419 |
|
| 420 |
probe nfs.proc4.read = kernel.function("nfs4_proc_read") !, |
| 421 |
module("nfs").function("nfs4_proc_read") ?, |
| 422 |
module("nfsv3").function("nfs4_proc_read") ? |
| 423 |
{ |
| 424 |
server_ip = @_nfs_data_server_ip($rdata) |
| 425 |
prot = @_nfs_data_prot($rdata) |
| 426 |
version = 4 |
| 427 |
|
| 428 |
flags = $rdata->flags |
| 429 |
count = @_nfs_data_args_count($rdata) |
| 430 |
offset = $rdata->args->offset |
| 431 |
|
| 432 |
name = "nfs.proc4.read" |
| 433 |
argstr = sprintf("%d,%d", count, offset) |
| 434 |
|
| 435 |
size = count |
| 436 |
units = "bytes" |
| 437 |
} |
| 438 |
|
| 439 |
probe nfs.proc4.read.return = |
| 440 |
kernel.function("nfs4_proc_read").return !, |
| 441 |
module("nfs").function("nfs4_proc_read").return ?, |
| 442 |
module("nfsv4").function("nfs4_proc_read").return ? |
| 443 |
{ |
| 444 |
version = 4 |
| 445 |
name = "nfs.proc4.read.return" |
| 446 |
retstr = sprintf("%d", $return) |
| 447 |
} |
| 448 |
|
| 449 |
|
| 450 |
/** |
| 451 |
* probe nfs.proc.write - NFS client synchronously writes file to server |
| 452 |
* |
| 453 |
* @server_ip: IP address of server |
| 454 |
* @prot: transfer protocol |
| 455 |
* @version: NFS version |
| 456 |
* @flags: used to set task->tk_flags in rpc_init_task function |
| 457 |
* @count: |
| 458 |
* @size: read bytes in this execution |
| 459 |
* @offset: the file offset |
| 460 |
* @bitmask0: V4 bitmask representing the set of attributes supported |
| 461 |
* on this filesystem |
| 462 |
* @bitmask1: V4 bitmask representing the set of attributes supported |
| 463 |
* on this filesystem |
| 464 |
* |
| 465 |
* All the nfs.proc.write kernel functions were removed in kernel commit |
| 466 |
* 200baa in December 2006, so these probes do not exist on Linux |
| 467 |
* 2.6.21 and newer kernels. |
| 468 |
*/ |
| 469 |
|
| 470 |
probe nfs.proc.write = nfs.proc2.write ?, |
| 471 |
nfs.proc3.write ?, |
| 472 |
nfs.proc4.write ? |
| 473 |
{} |
| 474 |
|
| 475 |
|
| 476 |
probe nfs.proc.write.return = nfs.proc2.write.return ?, |
| 477 |
nfs.proc3.write.return ?, |
| 478 |
nfs.proc4.write.return ? |
| 479 |
{} |
| 480 |
|
| 481 |
probe nfs.proc2.write = _nfs.proc2.write !, _nfs.proc2.missing_write |
| 482 |
{ |
| 483 |
version = 2 |
| 484 |
|
| 485 |
bitmask0 = 0 |
| 486 |
bitmask1 = 0 |
| 487 |
|
| 488 |
name = "nfs.proc2.write" |
| 489 |
argstr = sprintf("%d,%d", count, offset) |
| 490 |
|
| 491 |
size = count |
| 492 |
units = "bytes" |
| 493 |
} |
| 494 |
probe _nfs.proc2.write = kernel.function("nfs_proc_write") !, |
| 495 |
module("nfs").function("nfs_proc_write") ?, |
| 496 |
module("nfsv2").function("nfs_proc_write") ? |
| 497 |
{ |
| 498 |
server_ip = @_nfs_data_server_ip($wdata) |
| 499 |
prot = @_nfs_data_prot($wdata) |
| 500 |
|
| 501 |
flags = $wdata->flags |
| 502 |
count = @_nfs_data_args_count($wdata) |
| 503 |
offset = $wdata->args->offset |
| 504 |
} |
| 505 |
probe _nfs.proc2.missing_write = never |
| 506 |
{ |
| 507 |
%( systemtap_v >= "4.3" %? |
| 508 |
server_ip = "" |
| 509 |
%: |
| 510 |
server_ip = 0 |
| 511 |
%) |
| 512 |
prot = 0 |
| 513 |
|
| 514 |
flags = 0 |
| 515 |
count = 0 |
| 516 |
offset = 0 |
| 517 |
} |
| 518 |
|
| 519 |
probe nfs.proc2.write.return = |
| 520 |
kernel.function("nfs_proc_write").return !, |
| 521 |
module("nfs").function("nfs_proc_write").return !, |
| 522 |
module("nfsv2").function("nfs_proc_write").return !, |
| 523 |
never |
| 524 |
{ |
| 525 |
version = 2 |
| 526 |
name = "nfs.proc2.write.return" |
| 527 |
if (@defined($return)) { |
| 528 |
retstr = sprintf("%d", $return) |
| 529 |
if ($return >= 0) { |
| 530 |
size = $return |
| 531 |
} |
| 532 |
} |
| 533 |
else { |
| 534 |
retstr = "N/A" |
| 535 |
size = 0 |
| 536 |
} |
| 537 |
units = "bytes" |
| 538 |
} |
| 539 |
|
| 540 |
|
| 541 |
probe nfs.proc3.write = kernel.function("nfs3_proc_write") !, |
| 542 |
module("nfs").function("nfs3_proc_write") ?, |
| 543 |
module("nfsv3").function("nfs3_proc_write") ? |
| 544 |
{ |
| 545 |
server_ip = @_nfs_data_server_ip($wdata) |
| 546 |
prot = @_nfs_data_prot($wdata) |
| 547 |
version = 3 |
| 548 |
|
| 549 |
flags = $wdata->flags |
| 550 |
count = @_nfs_data_args_count($wdata) |
| 551 |
offset = $wdata->args->offset |
| 552 |
bitmask0 = 0 |
| 553 |
bitmask1 = 0 |
| 554 |
|
| 555 |
name = "nfs.proc3.write" |
| 556 |
argstr = sprintf("%d,%d", count, offset) |
| 557 |
|
| 558 |
size = count |
| 559 |
units = "bytes" |
| 560 |
} |
| 561 |
|
| 562 |
|
| 563 |
probe nfs.proc3.write.return = |
| 564 |
kernel.function("nfs3_proc_write").return !, |
| 565 |
module("nfs").function("nfs3_proc_write").return ?, |
| 566 |
module("nfsv3").function("nfs3_proc_write").return ? |
| 567 |
{ |
| 568 |
version = 3 |
| 569 |
name = "nfs.proc3.write.return" |
| 570 |
retstr = sprintf("%d", $return) |
| 571 |
|
| 572 |
if ($return >= 0) { |
| 573 |
size = $return |
| 574 |
units = "bytes" |
| 575 |
} |
| 576 |
} |
| 577 |
|
| 578 |
|
| 579 |
probe nfs.proc4.write = kernel.function("nfs4_proc_write") !, |
| 580 |
module("nfs").function("nfs4_proc_write") ?, |
| 581 |
module("nfsv4").function("nfs4_proc_write") ? |
| 582 |
{ |
| 583 |
server_ip = @_nfs_data_server_ip($wdata) |
| 584 |
prot = @_nfs_data_prot($wdata) |
| 585 |
version = 4 |
| 586 |
|
| 587 |
flags = $wdata->flags |
| 588 |
count = @_nfs_data_args_count($wdata) |
| 589 |
offset = $wdata->args->offset |
| 590 |
bitmask0 = __nfsv4_bitmask($wdata->inode, 0) |
| 591 |
bitmask1 = __nfsv4_bitmask($wdata->inode, 1) |
| 592 |
|
| 593 |
name = "nfs.proc4.write" |
| 594 |
argstr = sprintf("%d,%d", count, offset) |
| 595 |
|
| 596 |
size = count |
| 597 |
units = "bytes" |
| 598 |
} |
| 599 |
|
| 600 |
|
| 601 |
probe nfs.proc4.write.return = |
| 602 |
kernel.function("nfs4_proc_write").return !, |
| 603 |
module("nfs").function("nfs4_proc_write").return ?, |
| 604 |
module("nfsv4").function("nfs4_proc_write").return ? |
| 605 |
{ |
| 606 |
version = 4 |
| 607 |
name = "nfs.proc4.write.return" |
| 608 |
retstr = sprintf("%d", $return) |
| 609 |
|
| 610 |
if ($return >= 0) { |
| 611 |
size = $return |
| 612 |
units = "bytes" |
| 613 |
} |
| 614 |
} |
| 615 |
|
| 616 |
/** |
| 617 |
* probe nfs.proc.commit - NFS client committing data on server |
| 618 |
* |
| 619 |
* @server_ip: IP address of server |
| 620 |
* @prot: transfer protocol |
| 621 |
* @version: NFS version |
| 622 |
* @count: |
| 623 |
* @size: read bytes in this execution |
| 624 |
* @offset: the file offset |
| 625 |
* @bitmask0: V4 bitmask representing the set of attributes supported |
| 626 |
* on this filesystem |
| 627 |
* @bitmask1: V4 bitmask representing the set of attributes supported |
| 628 |
* on this filesystem |
| 629 |
* |
| 630 |
* All the nfs.proc.commit kernel functions were removed in kernel |
| 631 |
* commit 200baa in December 2006, so these probes do not exist on Linux |
| 632 |
* 2.6.21 and newer kernels. |
| 633 |
* |
| 634 |
* Fires when client writes the buffered data to disk. |
| 635 |
* The buffered data is asynchronously written by client earlier. |
| 636 |
* The commit function works in sync way. |
| 637 |
* This probe point does not exist in NFSv2. |
| 638 |
*/ |
| 639 |
probe nfs.proc.commit = nfs.proc3.commit ?, |
| 640 |
nfs.proc4.commit ? |
| 641 |
{} |
| 642 |
|
| 643 |
probe nfs.proc.commit.return = nfs.proc3.commit.return ?, |
| 644 |
nfs.proc4.commit.return ? |
| 645 |
{} |
| 646 |
|
| 647 |
// XXX: on kernels > 2.6.18 (?), module("nfs") -> module("nfsd") and |
| 648 |
// function("nfsN...") becomes function("nfsdN..."). PR3833. |
| 649 |
|
| 650 |
probe nfs.proc3.commit = kernel.function ("nfs3_proc_commit") !, |
| 651 |
module("nfs").function("nfs3_proc_commit") ?, |
| 652 |
module("nfsv3").function("nfs3_proc_commit") ? |
| 653 |
{ |
| 654 |
server_ip = @_nfs_data_server_ip($cdata) |
| 655 |
prot = @_nfs_data_prot($cdata) |
| 656 |
version = 3 |
| 657 |
|
| 658 |
count = @_nfs_data_args_count($cdata) |
| 659 |
offset = $cdata->args->offset |
| 660 |
bitmask0 = 0 |
| 661 |
bitmask1 = 0 |
| 662 |
|
| 663 |
name = "nfs.proc3.commit" |
| 664 |
argstr = sprintf("%d,%d", count, offset) |
| 665 |
|
| 666 |
size = count |
| 667 |
units = "bytes" |
| 668 |
} |
| 669 |
|
| 670 |
probe nfs.proc3.commit.return = |
| 671 |
kernel.function ("nfs3_proc_commit").return !, |
| 672 |
module("nfs").function("nfs3_proc_commit").return ?, |
| 673 |
module("nfsv3").function("nfs3_proc_commit").return ? |
| 674 |
{ |
| 675 |
version = 3 |
| 676 |
name = "nfs.proc3.commit.return" |
| 677 |
retstr = sprintf("%d", $return) |
| 678 |
|
| 679 |
if ($return >= 0) { |
| 680 |
size = $return |
| 681 |
units = "bytes" |
| 682 |
} |
| 683 |
} |
| 684 |
|
| 685 |
|
| 686 |
probe nfs.proc4.commit = kernel.function ("nfs4_proc_commit") !, |
| 687 |
module("nfs").function("nfs4_proc_commit") ?, |
| 688 |
module("nfsv4").function("nfs4_proc_commit") ? |
| 689 |
{ |
| 690 |
server_ip = @_nfs_data_server_ip($cdata) |
| 691 |
prot = @_nfs_data_prot($cdata) |
| 692 |
version = 4 |
| 693 |
|
| 694 |
count = @_nfs_data_args_count($cdata) |
| 695 |
offset = $cdata->args->offset |
| 696 |
bitmask0 = __nfsv4_bitmask($cdata->inode, 0) |
| 697 |
bitmask1 = __nfsv4_bitmask($cdata->inode, 1) |
| 698 |
|
| 699 |
name = "nfs.proc4.commit" |
| 700 |
argstr = sprintf("%d,%d", count, offset) |
| 701 |
|
| 702 |
size = count |
| 703 |
units = "bytes" |
| 704 |
} |
| 705 |
|
| 706 |
probe nfs.proc4.commit.return = |
| 707 |
kernel.function ("nfs4_proc_commit").return !, |
| 708 |
module("nfs").function("nfs4_proc_commit").return ?, |
| 709 |
module("nfsv4").function("nfs4_proc_commit").return ? |
| 710 |
{ |
| 711 |
version = 4 |
| 712 |
name = "nfs.proc4.commit.return" |
| 713 |
retstr = sprintf("%d", $return) |
| 714 |
|
| 715 |
if ($return >= 0) { |
| 716 |
size = $return |
| 717 |
units = "bytes" |
| 718 |
} |
| 719 |
} |
| 720 |
|
| 721 |
/** |
| 722 |
* probe nfs.proc.read_setup - NFS client setting up a read RPC task |
| 723 |
* |
| 724 |
* @server_ip: IP address of server |
| 725 |
* @prot: transfer protocol |
| 726 |
* @version: NFS version |
| 727 |
* @count: read bytes in this execution |
| 728 |
* @size: read bytes in this execution |
| 729 |
* @offset: the file offset |
| 730 |
* |
| 731 |
* The read_setup function is used to setup a read RPC task. |
| 732 |
* It is not doing the actual read operation. |
| 733 |
*/ |
| 734 |
probe nfs.proc.read_setup = nfs.proc2.read_setup, |
| 735 |
nfs.proc3.read_setup, |
| 736 |
nfs.proc4.read_setup |
| 737 |
{} |
| 738 |
|
| 739 |
probe nfs.proc.read_setup.return = nfs.proc2.read_setup.return, |
| 740 |
nfs.proc3.read_setup.return, |
| 741 |
nfs.proc4.read_setup.return |
| 742 |
{} |
| 743 |
|
| 744 |
|
| 745 |
|
| 746 |
probe nfs.proc2.read_setup = _nfs.proc2.read_setup !, |
| 747 |
_nfs.proc2.missing_read_setup |
| 748 |
{ |
| 749 |
version = 2 |
| 750 |
|
| 751 |
name = "nfs.proc2.read_setup" |
| 752 |
argstr = sprintf("%d,%d", count, offset) |
| 753 |
|
| 754 |
size = count |
| 755 |
units = "bytes" |
| 756 |
} |
| 757 |
probe _nfs.proc2.read_setup = kernel.function("nfs_proc_read_setup") !, |
| 758 |
module("nfs").function("nfs_proc_read_setup") ?, |
| 759 |
module("nfsv2").function("nfs_proc_read_setup") ? |
| 760 |
{ |
| 761 |
inode = @defined($data->header) ? $data->header->inode : $data->inode |
| 762 |
client = NFS_CLIENT(inode) |
| 763 |
server_ip = get_ip_from_client(client) |
| 764 |
prot = get_prot_from_client(client) |
| 765 |
|
| 766 |
count = @_nfs_data_args_count($data) |
| 767 |
offset = $data->args->offset |
| 768 |
} |
| 769 |
probe _nfs.proc2.missing_read_setup = never |
| 770 |
{ |
| 771 |
inode = 0 |
| 772 |
client = 0 |
| 773 |
%( systemtap_v >= "4.3" %? |
| 774 |
server_ip = "" |
| 775 |
%: |
| 776 |
server_ip = 0 |
| 777 |
%) |
| 778 |
prot = 0 |
| 779 |
|
| 780 |
count = 0 |
| 781 |
offset = 0 |
| 782 |
} |
| 783 |
|
| 784 |
probe nfs.proc2.read_setup.return = |
| 785 |
kernel.function("nfs_proc_read_setup").return !, |
| 786 |
module("nfs").function("nfs_proc_read_setup").return !, |
| 787 |
module("nfsv2").function("nfs_proc_read_setup").return !, |
| 788 |
never |
| 789 |
{ |
| 790 |
version = 2 |
| 791 |
name = "nfs.proc2.read_setup.return" |
| 792 |
retvalue = 0 |
| 793 |
} |
| 794 |
|
| 795 |
probe nfs.proc3.read_setup = kernel.function("nfs3_proc_read_setup") !, |
| 796 |
module("nfs").function("nfs3_proc_read_setup") ?, |
| 797 |
module("nfsv3").function("nfs3_proc_read_setup") ? |
| 798 |
{ |
| 799 |
inode = @choose_defined($hdr->inode, |
| 800 |
@choose_defined($data->header->inode, |
| 801 |
$data->inode)) |
| 802 |
client = NFS_CLIENT(inode) |
| 803 |
server_ip = get_ip_from_client(client) |
| 804 |
prot = get_prot_from_client(client) |
| 805 |
version = 3 |
| 806 |
fh = 0 |
| 807 |
|
| 808 |
count = @_nfs_data_args_count(@choose_defined($hdr, $data)) |
| 809 |
offset = @choose_defined($hdr->args->offset, $data->args->offset) |
| 810 |
|
| 811 |
name = "nfs.proc3.read_setup" |
| 812 |
argstr = sprintf("%d,%d", count, offset) |
| 813 |
|
| 814 |
size = count |
| 815 |
units = "bytes" |
| 816 |
} |
| 817 |
|
| 818 |
probe nfs.proc3.read_setup.return = |
| 819 |
kernel.function("nfs3_proc_read_setup").return !, |
| 820 |
module("nfs").function("nfs3_proc_read_setup").return ?, |
| 821 |
module("nfsv3").function("nfs3_proc_read_setup").return ? |
| 822 |
{ |
| 823 |
version = 3 |
| 824 |
name = "nfs.proc3.read_setup.return" |
| 825 |
retvalue = 0 |
| 826 |
} |
| 827 |
|
| 828 |
probe nfs.proc4.read_setup = kernel.function("nfs4_proc_read_setup") !, |
| 829 |
module("nfs").function("nfs4_proc_read_setup") ?, |
| 830 |
module("nfsv4").function("nfs4_proc_read_setup") ? |
| 831 |
{ |
| 832 |
inode = @choose_defined($hdr->inode, |
| 833 |
@choose_defined($data->header->inode, |
| 834 |
$data->inode)) |
| 835 |
client = NFS_CLIENT(inode) |
| 836 |
server_ip = get_ip_from_client(client) |
| 837 |
prot = get_prot_from_client(client) |
| 838 |
version = 4 |
| 839 |
|
| 840 |
count = @_nfs_data_args_count(@choose_defined($hdr, $data)) |
| 841 |
offset = @choose_defined($hdr->args->offset, $data->args->offset) |
| 842 |
//timestamp = $jiffies |
| 843 |
|
| 844 |
name = "nfs.proc4.read_setup" |
| 845 |
argstr = sprintf("%d,%d", count, offset) |
| 846 |
|
| 847 |
size = count |
| 848 |
units = "bytes" |
| 849 |
} |
| 850 |
probe nfs.proc4.read_setup.return = |
| 851 |
kernel.function("nfs4_proc_read_setup").return !, |
| 852 |
module("nfs").function("nfs4_proc_read_setup").return ?, |
| 853 |
module("nfsv4").function("nfs4_proc_read_setup").return ? |
| 854 |
{ |
| 855 |
version = 4 |
| 856 |
name = "nfs.proc4.read_setup.return" |
| 857 |
retvalue = 0 |
| 858 |
} |
| 859 |
|
| 860 |
/** |
| 861 |
* probe nfs.proc.read_done - NFS client response to a read RPC task |
| 862 |
* |
| 863 |
* @server_ip: IP address of server |
| 864 |
* @prot: transfer protocol |
| 865 |
* @version: NFS version |
| 866 |
* @status: result of last operation |
| 867 |
* @count: number of bytes read |
| 868 |
* @timestamp : V4 timestamp, which is used for lease renewal |
| 869 |
* |
| 870 |
* Fires when a reply to a read RPC task is received or some read error occurs |
| 871 |
* (timeout or socket shutdown). |
| 872 |
*/ |
| 873 |
probe nfs.proc.read_done = nfs.proc2.read_done, |
| 874 |
nfs.proc3.read_done, |
| 875 |
nfs.proc4.read_done |
| 876 |
{} |
| 877 |
|
| 878 |
probe nfs.proc.read_done.return = nfs.proc2.read_done.return, |
| 879 |
nfs.proc3.read_done.return, |
| 880 |
nfs.proc4.read_done.return |
| 881 |
{} |
| 882 |
|
| 883 |
probe nfs.proc2.read_done = _nfs.proc2.read_done !, |
| 884 |
_nfs.proc2.missing_read_done |
| 885 |
{ |
| 886 |
timestamp = 0 |
| 887 |
version = 2 |
| 888 |
|
| 889 |
name = "nfs.proc2.read_done" |
| 890 |
argstr = sprintf("%d", status) |
| 891 |
} |
| 892 |
probe _nfs.proc2.read_done = kernel.function("nfs_read_done") !, |
| 893 |
module("nfs").function("nfs_read_done") ?, |
| 894 |
module("nfsv2").function("nfs_read_done") ? |
| 895 |
{ |
| 896 |
if (@defined($data)) { # kernels >= 2.6.10 |
| 897 |
server_ip = @_nfs_data_server_ip($data) |
| 898 |
prot = @_nfs_data_prot($data) |
| 899 |
count = @_nfs_data_res_count($data) |
| 900 |
} |
| 901 |
else { |
| 902 |
server_ip = @_nfs_data_server_ip($task->tk_calldata) |
| 903 |
prot = @_nfs_data_prot($task->tk_calldata) |
| 904 |
count = @_nfs_data_res_count($task->tk_calldata) |
| 905 |
} |
| 906 |
status = $task->tk_status |
| 907 |
} |
| 908 |
probe _nfs.proc2.missing_read_done = never |
| 909 |
{ |
| 910 |
%( systemtap_v >= "4.3" %? |
| 911 |
server_ip = "" |
| 912 |
%: |
| 913 |
server_ip = 0 |
| 914 |
%) |
| 915 |
prot = 0 |
| 916 |
count = 0 |
| 917 |
status = 0 |
| 918 |
} |
| 919 |
|
| 920 |
probe nfs.proc2.read_done.return = |
| 921 |
kernel.function("nfs_read_done").return !, |
| 922 |
module("nfs").function("nfs_read_done").return !, |
| 923 |
module("nfsv2").function("nfs_read_done").return !, |
| 924 |
never |
| 925 |
{ |
| 926 |
version = 2 |
| 927 |
name = "nfs.proc2.read_done.return" |
| 928 |
retstr = (@defined($return) ? sprintf("%d", $return) : "N/A") |
| 929 |
} |
| 930 |
|
| 931 |
|
| 932 |
probe nfs.proc3.read_done = kernel.function("nfs3_read_done") !, |
| 933 |
module("nfs").function("nfs3_read_done") ?, |
| 934 |
module("nfsv3").function("nfs3_read_done") ? |
| 935 |
{ |
| 936 |
if (@defined($hdr)) { # kernels >= 3.17 |
| 937 |
server_ip = @_nfs_data_server_ip($hdr) |
| 938 |
prot = @_nfs_data_prot($hdr) |
| 939 |
count = @_nfs_data_res_count($hdr) |
| 940 |
} |
| 941 |
else if (@defined($data)) { # kernels >= 2.6.10 |
| 942 |
server_ip = @_nfs_data_server_ip($data) |
| 943 |
prot = @_nfs_data_prot($data) |
| 944 |
count = @_nfs_data_res_count($data) |
| 945 |
} |
| 946 |
else { |
| 947 |
server_ip = @_nfs_data_server_ip($task->tk_calldata) |
| 948 |
prot = @_nfs_data_prot($task->tk_calldata) |
| 949 |
count = @_nfs_data_res_count($task->tk_calldata) |
| 950 |
} |
| 951 |
timestamp = 0 |
| 952 |
version = 3 |
| 953 |
status = $task->tk_status |
| 954 |
|
| 955 |
name = "nfs.proc3.read_done" |
| 956 |
argstr = sprintf("%d", status) |
| 957 |
|
| 958 |
} |
| 959 |
|
| 960 |
probe nfs.proc3.read_done.return = |
| 961 |
kernel.function("nfs3_read_done").return !, |
| 962 |
module("nfs").function("nfs3_read_done").return ?, |
| 963 |
module("nfsv3").function("nfs3_read_done").return ? |
| 964 |
{ |
| 965 |
version = 3 |
| 966 |
name = "nfs.proc3.read_done.return" |
| 967 |
retstr = (@defined($return) ? sprintf("%d", $return) : "N/A") |
| 968 |
} |
| 969 |
|
| 970 |
|
| 971 |
probe nfs.proc4.read_done = kernel.function("nfs4_read_done") !, |
| 972 |
module("nfs").function("nfs4_read_done") ?, |
| 973 |
module("nfsv4").function("nfs4_read_done") ? |
| 974 |
{ |
| 975 |
if (@defined($hdr)) { # kernels >= 3.17 |
| 976 |
server_ip = @_nfs_data_server_ip($hdr) |
| 977 |
prot = @_nfs_data_prot($hdr) |
| 978 |
count = @_nfs_data_res_count($hdr) |
| 979 |
timestamp = @_nfs_data_timestamp($hdr) |
| 980 |
} |
| 981 |
else if (@defined($data)) { # kernels >= 2.6.10 |
| 982 |
server_ip = @_nfs_data_server_ip($data) |
| 983 |
prot = @_nfs_data_prot($data) |
| 984 |
count = @_nfs_data_res_count($data) |
| 985 |
timestamp = @_nfs_data_timestamp($data) |
| 986 |
} |
| 987 |
else { |
| 988 |
server_ip = @_nfs_data_server_ip($task->tk_calldata) |
| 989 |
prot = @_nfs_data_prot($task->tk_calldata) |
| 990 |
count = @_nfs_data_res_count($task->tk_calldata) |
| 991 |
timestamp = @_nfs_data_timestamp($task->tk_calldata) |
| 992 |
} |
| 993 |
version = 4 |
| 994 |
status = $task->tk_status |
| 995 |
|
| 996 |
name = "nfs.proc4.read_done" |
| 997 |
argstr = sprintf("%d", status) |
| 998 |
|
| 999 |
} |
| 1000 |
|
| 1001 |
probe nfs.proc4.read_done.return = |
| 1002 |
kernel.function("nfs4_read_done").return !, |
| 1003 |
module("nfs").function("nfs4_read_done").return ?, |
| 1004 |
module("nfsv4").function("nfs4_read_done").return ? |
| 1005 |
{ |
| 1006 |
version = 4 |
| 1007 |
name = "nfs.proc4.read_done.return" |
| 1008 |
retstr = (@defined($return) ? sprintf("%d", $return) : "N/A") |
| 1009 |
} |
| 1010 |
|
| 1011 |
/** |
| 1012 |
* probe nfs.proc.write_setup - NFS client setting up a write RPC task |
| 1013 |
* |
| 1014 |
* @server_ip: IP address of server |
| 1015 |
* @prot: transfer protocol |
| 1016 |
* @version: NFS version |
| 1017 |
* @size: bytes written in this execution |
| 1018 |
* @count: bytes written in this execution |
| 1019 |
* @offset: the file offset |
| 1020 |
* @how: used to set args.stable. The stable value could be: |
| 1021 |
* NFS_UNSTABLE,NFS_DATA_SYNC,NFS_FILE_SYNC |
| 1022 |
* (in nfs.proc3.write_setup and nfs.proc4.write_setup) |
| 1023 |
* @bitmask0: V4 bitmask representing the set of attributes supported |
| 1024 |
* on this filesystem |
| 1025 |
* @bitmask1: V4 bitmask representing the set of attributes supported |
| 1026 |
* on this filesystem |
| 1027 |
* |
| 1028 |
* The write_setup function is used to setup a write RPC task. |
| 1029 |
* It is not doing the actual write operation. |
| 1030 |
*/ |
| 1031 |
|
| 1032 |
probe nfs.proc.write_setup = nfs.proc2.write_setup, |
| 1033 |
nfs.proc3.write_setup, |
| 1034 |
nfs.proc4.write_setup |
| 1035 |
{} |
| 1036 |
probe nfs.proc.write_setup.return = nfs.proc2.write_setup.return, |
| 1037 |
nfs.proc3.write_setup.return, |
| 1038 |
nfs.proc4.write_setup.return |
| 1039 |
{} |
| 1040 |
|
| 1041 |
|
| 1042 |
probe nfs.proc2.write_setup = _nfs.proc2.write_setup !, |
| 1043 |
_nfs.proc2.missing_write_setup |
| 1044 |
{ |
| 1045 |
version = 2 |
| 1046 |
bitmask0 = 0 |
| 1047 |
bitmask1 = 0 |
| 1048 |
|
| 1049 |
name = "nfs.proc2.write_setup" |
| 1050 |
argstr = sprintf("%d,%d", count, offset) |
| 1051 |
|
| 1052 |
size = count |
| 1053 |
units = "bytes" |
| 1054 |
} |
| 1055 |
probe _nfs.proc2.write_setup = |
| 1056 |
kernel.function("nfs_proc_write_setup") !, |
| 1057 |
module("nfs").function("nfs_proc_write_setup") ?, |
| 1058 |
module("nfsv2").function("nfs_proc_write_setup") ? |
| 1059 |
{ |
| 1060 |
inode = @defined($data->header) ? $data->header->inode : $data->inode |
| 1061 |
client = NFS_CLIENT(inode) |
| 1062 |
server_ip = get_ip_from_client(client) |
| 1063 |
prot = get_prot_from_client(client) |
| 1064 |
|
| 1065 |
count = @_nfs_data_args_count($data) |
| 1066 |
offset = $data->args->offset |
| 1067 |
how = @choose_defined($how, $data->args->stable) |
| 1068 |
} |
| 1069 |
probe _nfs.proc2.missing_write_setup = never |
| 1070 |
{ |
| 1071 |
inode = 0 |
| 1072 |
client = 0 |
| 1073 |
%( systemtap_v >= "4.3" %? |
| 1074 |
server_ip = "" |
| 1075 |
%: |
| 1076 |
server_ip = 0 |
| 1077 |
%) |
| 1078 |
prot = 0 |
| 1079 |
|
| 1080 |
count = 0 |
| 1081 |
offset = 0 |
| 1082 |
how = 0 |
| 1083 |
} |
| 1084 |
|
| 1085 |
probe nfs.proc2.write_setup.return = |
| 1086 |
kernel.function("nfs_proc_write_setup").return !, |
| 1087 |
module("nfs").function("nfs_proc_write_setup").return !, |
| 1088 |
module("nfsv2").function("nfs_proc_write_setup").return !, |
| 1089 |
never |
| 1090 |
{ |
| 1091 |
version = 2 |
| 1092 |
name = "nfs.proc2.write_setup.return" |
| 1093 |
retvalue = 0 |
| 1094 |
} |
| 1095 |
|
| 1096 |
|
| 1097 |
probe nfs.proc3.write_setup = |
| 1098 |
kernel.function("nfs3_proc_write_setup") !, |
| 1099 |
module("nfs").function("nfs3_proc_write_setup") ?, |
| 1100 |
module("nfsv3").function("nfs3_proc_write_setup") ? |
| 1101 |
{ |
| 1102 |
inode = @choose_defined($hdr->inode, |
| 1103 |
@choose_defined($data->header->inode, |
| 1104 |
$data->inode)) |
| 1105 |
client = NFS_CLIENT(inode) |
| 1106 |
server_ip = get_ip_from_client(client) |
| 1107 |
prot = get_prot_from_client(client) |
| 1108 |
version = 3 |
| 1109 |
|
| 1110 |
count = @_nfs_data_args_count(@choose_defined($hdr, $data)) |
| 1111 |
offset = @choose_defined($hdr->args->offset, $data->args->offset) |
| 1112 |
how = @choose_defined($hdr->args->stable, |
| 1113 |
@choose_defined($how, $data->args->stable)) |
| 1114 |
bitmask0 = 0 |
| 1115 |
bitmask1 = 0 |
| 1116 |
|
| 1117 |
name = "nfs.proc3.write_setup" |
| 1118 |
argstr = sprintf("%d,%d,%d", count, offset, how) |
| 1119 |
|
| 1120 |
size = count |
| 1121 |
units = "bytes" |
| 1122 |
} |
| 1123 |
probe nfs.proc3.write_setup.return = |
| 1124 |
kernel.function("nfs3_proc_write_setup").return !, |
| 1125 |
module("nfs").function("nfs3_proc_write_setup").return ?, |
| 1126 |
module("nfsv3").function("nfs3_proc_write_setup").return ? |
| 1127 |
{ |
| 1128 |
version = 3 |
| 1129 |
name = "nfs.proc3.write_setup.return" |
| 1130 |
retvalue = 0 |
| 1131 |
} |
| 1132 |
|
| 1133 |
probe nfs.proc4.write_setup = |
| 1134 |
kernel.function("nfs4_proc_write_setup") !, |
| 1135 |
module("nfs").function("nfs4_proc_write_setup") ?, |
| 1136 |
module("nfsv4").function("nfs4_proc_write_setup") ? |
| 1137 |
{ |
| 1138 |
inode = @choose_defined($hdr->inode, |
| 1139 |
@choose_defined($data->header->inode, |
| 1140 |
$data->inode)) |
| 1141 |
client = NFS_CLIENT(inode) |
| 1142 |
server_ip = get_ip_from_client(client) |
| 1143 |
prot = get_prot_from_client(client) |
| 1144 |
version = 4 |
| 1145 |
|
| 1146 |
count = @_nfs_data_args_count(@choose_defined($hdr, $data)) |
| 1147 |
offset = @choose_defined($hdr->args->offset, $data->args->offset) |
| 1148 |
how = @choose_defined($hdr->args->stable, |
| 1149 |
@choose_defined($how, $data->args->stable)) |
| 1150 |
bitmask0 = __nfsv4_bitmask(inode, 0) |
| 1151 |
bitmask1 = __nfsv4_bitmask(inode, 1) |
| 1152 |
//timestamp = $jiffies |
| 1153 |
|
| 1154 |
name = "nfs.proc4.write_setup" |
| 1155 |
argstr = sprintf("%d,%d,%d", count, offset, how) |
| 1156 |
|
| 1157 |
size = count |
| 1158 |
units = "bytes" |
| 1159 |
} |
| 1160 |
probe nfs.proc4.write_setup.return = |
| 1161 |
kernel.function("nfs4_proc_write_setup").return !, |
| 1162 |
module("nfs").function("nfs4_proc_write_setup").return ?, |
| 1163 |
module("nfsv4").function("nfs4_proc_write_setup").return ? |
| 1164 |
{ |
| 1165 |
version = 4 |
| 1166 |
name = "nfs.proc4.write_setup.return" |
| 1167 |
retvalue = 0 |
| 1168 |
} |
| 1169 |
|
| 1170 |
|
| 1171 |
/** |
| 1172 |
* probe nfs.proc.write_done - NFS client response to a write RPC task |
| 1173 |
* |
| 1174 |
* @server_ip: IP address of server |
| 1175 |
* @prot: transfer protocol |
| 1176 |
* @version: NFS version |
| 1177 |
* @status: result of last operation |
| 1178 |
* @valid: fattr->valid, indicates which fields are valid |
| 1179 |
* @count: number of bytes written |
| 1180 |
* @timestamp: V4 timestamp, which is used for lease renewal |
| 1181 |
* |
| 1182 |
* Fires when a reply to a write RPC task is received or some write error occurs |
| 1183 |
* (timeout or socket shutdown). |
| 1184 |
*/ |
| 1185 |
probe nfs.proc.write_done = nfs.proc2.write_done, |
| 1186 |
nfs.proc3.write_done, |
| 1187 |
nfs.proc4.write_done |
| 1188 |
{} |
| 1189 |
|
| 1190 |
probe nfs.proc.write_done.return = nfs.proc2.write_done.return, |
| 1191 |
nfs.proc3.write_done.return, |
| 1192 |
nfs.proc4.write_done.return |
| 1193 |
{} |
| 1194 |
|
| 1195 |
probe nfs.proc2.write_done = _nfs.proc2.write_done !, |
| 1196 |
_nfs.proc2.missing_write_done |
| 1197 |
{ |
| 1198 |
timestamp = 0 |
| 1199 |
version = 2 |
| 1200 |
|
| 1201 |
name = "nfs.proc2.write_done" |
| 1202 |
argstr = sprintf("%d", status) |
| 1203 |
} |
| 1204 |
probe _nfs.proc2.write_done = kernel.function("nfs_write_done") !, |
| 1205 |
module("nfs").function("nfs_write_done") ?, |
| 1206 |
module("nfsv2").function("nfs_write_done") ? |
| 1207 |
{ |
| 1208 |
if (@defined($data)) { # kernels >= 2.6.10 |
| 1209 |
server_ip = @_nfs_data_server_ip($data) |
| 1210 |
prot = @_nfs_data_prot($data) |
| 1211 |
count = @_nfs_data_res_count($data) |
| 1212 |
valid = @_nfs_data_valid($data) |
| 1213 |
} |
| 1214 |
else { |
| 1215 |
server_ip = @_nfs_data_server_ip($task->tk_calldata) |
| 1216 |
prot = @_nfs_data_prot($task->tk_calldata) |
| 1217 |
count = @_nfs_data_res_count($task->tk_calldata) |
| 1218 |
valid = @_nfs_data_valid($task->tk_calldata) |
| 1219 |
} |
| 1220 |
status = $task->tk_status |
| 1221 |
} |
| 1222 |
probe _nfs.proc2.missing_write_done = never |
| 1223 |
{ |
| 1224 |
%( systemtap_v >= "4.3" %? |
| 1225 |
server_ip = "" |
| 1226 |
%: |
| 1227 |
server_ip = 0 |
| 1228 |
%) |
| 1229 |
prot = 0 |
| 1230 |
count = 0 |
| 1231 |
valid = 0 |
| 1232 |
status = 0 |
| 1233 |
} |
| 1234 |
|
| 1235 |
probe nfs.proc2.write_done.return = |
| 1236 |
kernel.function("nfs_write_done").return !, |
| 1237 |
module("nfs").function("nfs_write_done").return !, |
| 1238 |
module("nfsv2").function("nfs_write_done").return !, |
| 1239 |
never |
| 1240 |
{ |
| 1241 |
version = 2 |
| 1242 |
name = "nfs.proc2.write_done.return" |
| 1243 |
retstr = (@defined($return) ? sprintf("%d", $return) : "N/A") |
| 1244 |
} |
| 1245 |
|
| 1246 |
probe nfs.proc3.write_done = kernel.function("nfs3_write_done") !, |
| 1247 |
module("nfs").function("nfs3_write_done") ?, |
| 1248 |
module("nfsv3").function("nfs3_write_done") ? |
| 1249 |
{ |
| 1250 |
if (@defined($hdr) || @defined($data)) { # kernels >= 2.6.10 |
| 1251 |
server_ip = @_nfs_data_server_ip(@choose_defined($hdr, $data)) |
| 1252 |
prot = @_nfs_data_prot(@choose_defined($hdr, $data)) |
| 1253 |
count = @_nfs_data_res_count(@choose_defined($hdr, $data)) |
| 1254 |
valid = @_nfs_data_valid(@choose_defined($hdr, $data)) |
| 1255 |
} |
| 1256 |
else { |
| 1257 |
server_ip = @_nfs_data_server_ip($task->tk_calldata) |
| 1258 |
prot = @_nfs_data_prot($task->tk_calldata) |
| 1259 |
count = @_nfs_data_res_count($task->tk_calldata) |
| 1260 |
valid = @_nfs_data_valid($task->tk_calldata) |
| 1261 |
} |
| 1262 |
timestamp = 0 |
| 1263 |
version = 3 |
| 1264 |
status = $task->tk_status |
| 1265 |
|
| 1266 |
name = "nfs.proc3.write_done" |
| 1267 |
argstr = sprintf("%d", status) |
| 1268 |
} |
| 1269 |
|
| 1270 |
probe nfs.proc3.write_done.return = |
| 1271 |
kernel.function("nfs3_write_done").return !, |
| 1272 |
module("nfs").function("nfs3_write_done").return ?, |
| 1273 |
module("nfsv3").function("nfs3_write_done").return ? |
| 1274 |
{ |
| 1275 |
version = 3 |
| 1276 |
name = "nfs.proc3.write_done.return" |
| 1277 |
retstr = (@defined($return) ? sprintf("%d", $return) : "N/A") |
| 1278 |
} |
| 1279 |
|
| 1280 |
probe nfs.proc4.write_done = kernel.function("nfs4_write_done") !, |
| 1281 |
module("nfs").function("nfs4_write_done") ?, |
| 1282 |
module("nfsv4").function("nfs4_write_done") ? |
| 1283 |
{ |
| 1284 |
if (@defined($hdr) || @defined($data)) { # kernels >= 2.6.10 |
| 1285 |
server_ip = @_nfs_data_server_ip(@choose_defined($hdr, $data)) |
| 1286 |
prot = @_nfs_data_prot(@choose_defined($hdr, $data)) |
| 1287 |
count = @_nfs_data_res_count(@choose_defined($hdr, $data)) |
| 1288 |
valid = @_nfs_data_valid(@choose_defined($hdr, $data)) |
| 1289 |
timestamp = @_nfs_data_timestamp(@choose_defined($hdr, $data)) |
| 1290 |
} |
| 1291 |
else { |
| 1292 |
server_ip = @_nfs_data_server_ip($task->tk_calldata) |
| 1293 |
prot = @_nfs_data_prot($task->tk_calldata) |
| 1294 |
count = @_nfs_data_res_count($task->tk_calldata) |
| 1295 |
valid = @_nfs_data_valid($task->tk_calldata) |
| 1296 |
timestamp = @_nfs_data_timestamp($task->tk_calldata) |
| 1297 |
} |
| 1298 |
version = 4 |
| 1299 |
status = $task->tk_status |
| 1300 |
|
| 1301 |
name = "nfs.proc4.write_done" |
| 1302 |
argstr = sprintf("%d", status) |
| 1303 |
} |
| 1304 |
|
| 1305 |
probe nfs.proc4.write_done.return = |
| 1306 |
kernel.function("nfs4_write_done").return !, |
| 1307 |
module("nfs").function("nfs4_write_done").return ?, |
| 1308 |
module("nfsv4").function("nfs4_write_done").return ? |
| 1309 |
{ |
| 1310 |
version = 4 |
| 1311 |
name = "nfs.proc4.write_done.return" |
| 1312 |
retstr = (@defined($return) ? sprintf("%d", $return) : "N/A") |
| 1313 |
} |
| 1314 |
|
| 1315 |
|
| 1316 |
/** |
| 1317 |
* probe nfs.proc.commit_setup - NFS client setting up a commit RPC task |
| 1318 |
* |
| 1319 |
* @server_ip: IP address of server |
| 1320 |
* @prot: transfer protocol |
| 1321 |
* @version: NFS version |
| 1322 |
* @size: bytes in this commit |
| 1323 |
* @count: bytes in this commit |
| 1324 |
* @offset: the file offset |
| 1325 |
* @bitmask0: V4 bitmask representing the set of attributes supported |
| 1326 |
* on this filesystem |
| 1327 |
* @bitmask1: V4 bitmask representing the set of attributes supported |
| 1328 |
* on this filesystem |
| 1329 |
* |
| 1330 |
* The commit_setup function is used to setup a commit RPC task. |
| 1331 |
* Is is not doing the actual commit operation. |
| 1332 |
* It does not exist in NFSv2. |
| 1333 |
*/ |
| 1334 |
|
| 1335 |
probe nfs.proc.commit_setup = nfs.proc3.commit_setup, |
| 1336 |
nfs.proc4.commit_setup |
| 1337 |
{} |
| 1338 |
probe nfs.proc.commit_setup.return = nfs.proc3.commit_setup.return, |
| 1339 |
nfs.proc4.commit_setup.return |
| 1340 |
{} |
| 1341 |
|
| 1342 |
|
| 1343 |
|
| 1344 |
probe nfs.proc3.commit_setup = |
| 1345 |
kernel.function("nfs3_proc_commit_setup") !, |
| 1346 |
module("nfs").function("nfs3_proc_commit_setup") ?, |
| 1347 |
module("nfsv3").function("nfs3_proc_commit_setup") ? |
| 1348 |
{ |
| 1349 |
inode = @defined($data->header) ? $data->header->inode : $data->inode |
| 1350 |
client = NFS_CLIENT(inode) |
| 1351 |
server_ip = get_ip_from_client(client) |
| 1352 |
prot = get_prot_from_client(client) |
| 1353 |
version = 3 |
| 1354 |
|
| 1355 |
count = @_nfs_data_args_count($data) |
| 1356 |
|
| 1357 |
offset = $data->args->offset |
| 1358 |
bitmask0 = 0 |
| 1359 |
bitmask1 = 0 |
| 1360 |
|
| 1361 |
name = "nfs.proc3.commit_setup" |
| 1362 |
argstr = sprintf("%d,%d", count, offset) |
| 1363 |
|
| 1364 |
size = count |
| 1365 |
units = "bytes" |
| 1366 |
} |
| 1367 |
probe nfs.proc3.commit_setup.return = |
| 1368 |
kernel.function("nfs3_proc_commit_setup") .return !, |
| 1369 |
module("nfs").function("nfs3_proc_commit_setup").return ?, |
| 1370 |
module("nfsv3").function("nfs3_proc_commit_setup").return ? |
| 1371 |
{ |
| 1372 |
version = 3 |
| 1373 |
name = "nfs.proc3.commit_setup.return" |
| 1374 |
retvalue = 0 |
| 1375 |
} |
| 1376 |
|
| 1377 |
probe nfs.proc4.commit_setup = |
| 1378 |
kernel.function("nfs4_proc_commit_setup") !, |
| 1379 |
module("nfs").function("nfs4_proc_commit_setup") ?, |
| 1380 |
module("nfsv4").function("nfs4_proc_commit_setup") ? |
| 1381 |
{ |
| 1382 |
inode = @defined($data->header) ? $data->header->inode : $data->inode |
| 1383 |
client = NFS_CLIENT(inode) |
| 1384 |
server_ip = get_ip_from_client(client) |
| 1385 |
prot = get_prot_from_client(client) |
| 1386 |
version = 4 |
| 1387 |
|
| 1388 |
count = @_nfs_data_args_count($data) |
| 1389 |
offset = $data->args->offset |
| 1390 |
bitmask0 = __nfsv4_bitmask(inode, 0) |
| 1391 |
bitmask1 = __nfsv4_bitmask(inode, 1) |
| 1392 |
//timestamp = $jiffies |
| 1393 |
|
| 1394 |
name = "nfs.proc4.commit_setup" |
| 1395 |
argstr = sprintf("%d,%d", count, offset) |
| 1396 |
|
| 1397 |
size = count |
| 1398 |
units = "bytes" |
| 1399 |
} |
| 1400 |
probe nfs.proc4.commit_setup.return = |
| 1401 |
kernel.function("nfs4_proc_commit_setup") .return !, |
| 1402 |
module("nfs").function("nfs4_proc_commit_setup").return ?, |
| 1403 |
module("nfsv4").function("nfs4_proc_commit_setup").return ? |
| 1404 |
{ |
| 1405 |
version = 4 |
| 1406 |
name = "nfs.proc4.commit_setup.return" |
| 1407 |
retvalue = 0 |
| 1408 |
} |
| 1409 |
|
| 1410 |
|
| 1411 |
/** |
| 1412 |
* probe nfs.proc.commit_done - NFS client response to a commit RPC task |
| 1413 |
* |
| 1414 |
* @server_ip: IP address of server |
| 1415 |
* @prot: transfer protocol |
| 1416 |
* @version: NFS version |
| 1417 |
* @status: result of last operation |
| 1418 |
* @valid: fattr->valid, indicates which fields are valid |
| 1419 |
* @count: number of bytes committed |
| 1420 |
* @timestamp: V4 timestamp, which is used for lease renewal |
| 1421 |
* |
| 1422 |
* Fires when a reply to a commit RPC task is received |
| 1423 |
* or some commit operation error occur (timeout or socket shutdown). |
| 1424 |
*/ |
| 1425 |
probe nfs.proc.commit_done = nfs.proc3.commit_done, |
| 1426 |
nfs.proc4.commit_done |
| 1427 |
{} |
| 1428 |
|
| 1429 |
probe nfs.proc.commit_done.return = nfs.proc3.commit_done.return, |
| 1430 |
nfs.proc4.commit_done.return |
| 1431 |
{} |
| 1432 |
|
| 1433 |
|
| 1434 |
probe nfs.proc3.commit_done = kernel.function("nfs3_commit_done") !, |
| 1435 |
module("nfs").function("nfs3_commit_done") ?, |
| 1436 |
module("nfsv3").function("nfs3_commit_done") ? |
| 1437 |
{ |
| 1438 |
if (@defined($data)) { # kernels >= 2.6.10 |
| 1439 |
server_ip = @_nfs_data_server_ip($data) |
| 1440 |
prot = @_nfs_data_prot($data) |
| 1441 |
count = @_nfs_data_res_count($data) |
| 1442 |
valid = @_nfs_data_valid($data) |
| 1443 |
} |
| 1444 |
else { |
| 1445 |
_tk_calldata=@choose_defined($task->tk_calldata, @cast($task, "rpc_task", "kernel:nfs")->tk_calldata) |
| 1446 |
server_ip = @_nfs_data_server_ip(_tk_calldata) |
| 1447 |
prot = @_nfs_data_prot(_tk_calldata) |
| 1448 |
count = @_nfs_data_res_count(_tk_calldata) |
| 1449 |
valid = @_nfs_data_valid(_tk_calldata) |
| 1450 |
} |
| 1451 |
timestamp = 0 |
| 1452 |
version = 3 |
| 1453 |
status = $task->tk_status |
| 1454 |
|
| 1455 |
name = "nfs.proc3.commit_done" |
| 1456 |
argstr = sprintf("%d", status) |
| 1457 |
} |
| 1458 |
|
| 1459 |
probe nfs.proc3.commit_done.return = |
| 1460 |
kernel.function("nfs3_commit_done").return !, |
| 1461 |
module("nfs").function("nfs3_commit_done").return ?, |
| 1462 |
module("nfsv3").function("nfs3_commit_done").return ? |
| 1463 |
{ |
| 1464 |
version = 3 |
| 1465 |
name = "nfs.proc3.commit_done.return" |
| 1466 |
retstr = (@defined($return) ? sprintf("%d", $return) : "N/A") |
| 1467 |
} |
| 1468 |
|
| 1469 |
probe nfs.proc4.commit_done = kernel.function("nfs4_commit_done") !, |
| 1470 |
module("nfs").function("nfs4_commit_done") ?, |
| 1471 |
module("nfsv4").function("nfs4_commit_done") ? |
| 1472 |
{ |
| 1473 |
if (@defined($data)) { # kernels >= 2.6.10 |
| 1474 |
server_ip = @_nfs_data_server_ip($data) |
| 1475 |
prot = @_nfs_data_prot($data) |
| 1476 |
count = @_nfs_data_res_count($data) |
| 1477 |
valid = @_nfs_data_valid($data) |
| 1478 |
timestamp = @_nfs_data_timestamp($data) |
| 1479 |
} |
| 1480 |
else { |
| 1481 |
server_ip = @_nfs_data_server_ip($task->tk_calldata) |
| 1482 |
prot = @_nfs_data_prot($task->tk_calldata) |
| 1483 |
count = @_nfs_data_res_count($task->tk_calldata) |
| 1484 |
valid = @_nfs_data_valid($task->tk_calldata) |
| 1485 |
timestamp = @_nfs_data_timestamp($task->tk_calldata) |
| 1486 |
} |
| 1487 |
version = 4 |
| 1488 |
status = $task->tk_status |
| 1489 |
|
| 1490 |
name = "nfs.proc4.commit_done" |
| 1491 |
argstr = sprintf("%d", status) |
| 1492 |
} |
| 1493 |
|
| 1494 |
probe nfs.proc4.commit_done.return = |
| 1495 |
kernel.function("nfs4_commit_done").return !, |
| 1496 |
module("nfs").function("nfs4_commit_done").return ?, |
| 1497 |
module("nfsv4").function("nfs4_commit_done").return ? |
| 1498 |
{ |
| 1499 |
version = 4 |
| 1500 |
name = "nfs.proc4.commit_done.return" |
| 1501 |
retstr = (@defined($return) ? sprintf("%d", $return) : "N/A") |
| 1502 |
} |
| 1503 |
|
| 1504 |
/** |
| 1505 |
* probe nfs.proc.rename_setup - NFS client setting up a rename RPC task |
| 1506 |
* |
| 1507 |
* @server_ip: IP address of server |
| 1508 |
* @prot: transfer protocol |
| 1509 |
* @version: NFS version |
| 1510 |
* @fh: file handle of parent dir |
| 1511 |
* |
| 1512 |
* The rename_setup function is used to setup a rename RPC task. |
| 1513 |
* Is is not doing the actual rename operation. |
| 1514 |
*/ |
| 1515 |
|
| 1516 |
probe nfs.proc.rename_setup = nfs.proc2.rename_setup ?, |
| 1517 |
nfs.proc3.rename_setup, |
| 1518 |
nfs.proc4.rename_setup |
| 1519 |
{} |
| 1520 |
probe nfs.proc.rename_setup.return = nfs.proc2.rename_setup.return ?, |
| 1521 |
nfs.proc3.rename_setup.return, |
| 1522 |
nfs.proc4.rename_setup.return |
| 1523 |
{} |
| 1524 |
|
| 1525 |
probe nfs.proc2.rename_setup = |
| 1526 |
kernel.function("nfs_proc_rename_setup") !, |
| 1527 |
module("nfs").function("nfs_proc_rename_setup") ?, |
| 1528 |
module("nfsv2").function("nfs_proc_rename_setup") ? |
| 1529 |
{ |
| 1530 |
client = NFS_CLIENT($dir) |
| 1531 |
server_ip = get_ip_from_client(client) |
| 1532 |
prot = get_prot_from_client(client) |
| 1533 |
version = 2 |
| 1534 |
fh = NFS_FH($dir) |
| 1535 |
|
| 1536 |
name = "nfs.proc2.rename_setup" |
| 1537 |
|
| 1538 |
argstr = sprintf("%d", fh) |
| 1539 |
} |
| 1540 |
probe nfs.proc2.rename_setup.return = |
| 1541 |
kernel.function("nfs2_proc_rename_setup").return !, |
| 1542 |
module("nfs").function("nfs_proc_rename_setup").return ?, |
| 1543 |
module("nfsv2").function("nfs_proc_rename_setup").return ? |
| 1544 |
{ |
| 1545 |
version = 2 |
| 1546 |
name = "nfs.proc2.rename_setup.return" |
| 1547 |
retvalue = 0 |
| 1548 |
} |
| 1549 |
|
| 1550 |
probe nfs.proc3.rename_setup = |
| 1551 |
kernel.function("nfs3_proc_rename_setup") !, |
| 1552 |
module("nfs").function("nfs3_proc_rename_setup") ?, |
| 1553 |
module("nfsv3").function("nfs3_proc_rename_setup") ? |
| 1554 |
{ |
| 1555 |
client = NFS_CLIENT($dir) |
| 1556 |
server_ip = get_ip_from_client(client) |
| 1557 |
prot = get_prot_from_client(client) |
| 1558 |
version = 3 |
| 1559 |
fh = NFS_FH($dir) |
| 1560 |
|
| 1561 |
name = "nfs.proc3.rename_setup" |
| 1562 |
argstr = sprintf("%d", fh) |
| 1563 |
} |
| 1564 |
probe nfs.proc3.rename_setup.return = |
| 1565 |
kernel.function("nfs3_proc_rename_setup").return !, |
| 1566 |
module("nfs").function("nfs3_proc_rename_setup").return ?, |
| 1567 |
module("nfsv3").function("nfs3_proc_rename_setup").return ? |
| 1568 |
{ |
| 1569 |
version = 3 |
| 1570 |
name = "nfs.proc3.rename_setup.return" |
| 1571 |
retvalue = 0 |
| 1572 |
} |
| 1573 |
|
| 1574 |
probe nfs.proc4.rename_setup = |
| 1575 |
kernel.function("nfs4_proc_rename_setup") !, |
| 1576 |
module("nfs").function("nfs4_proc_rename_setup") ?, |
| 1577 |
module("nfsv4").function("nfs4_proc_rename_setup") ? |
| 1578 |
{ |
| 1579 |
client = NFS_CLIENT($dir) |
| 1580 |
server_ip = get_ip_from_client(client) |
| 1581 |
prot = get_prot_from_client(client) |
| 1582 |
version = 4 |
| 1583 |
fh = NFS_FH($dir) |
| 1584 |
|
| 1585 |
name = "nfs.proc4.rename_setup" |
| 1586 |
argstr = sprintf("%d", fh) |
| 1587 |
} |
| 1588 |
probe nfs.proc4.rename_setup.return = |
| 1589 |
kernel.function("nfs4_proc_rename_setup").return !, |
| 1590 |
module("nfs").function("nfs4_proc_rename_setup").return ?, |
| 1591 |
module("nfsv4").function("nfs4_proc_rename_setup").return ? |
| 1592 |
{ |
| 1593 |
version = 4 |
| 1594 |
name = "nfs.proc4.rename_setup.return" |
| 1595 |
retvalue = 0 |
| 1596 |
} |
| 1597 |
|
| 1598 |
/** |
| 1599 |
* probe nfs.proc.rename_done - NFS client response to a rename RPC task |
| 1600 |
* |
| 1601 |
* @server_ip: IP address of server |
| 1602 |
* @prot: transfer protocol |
| 1603 |
* @version: NFS version |
| 1604 |
* @status: result of last operation |
| 1605 |
* @timestamp : V4 timestamp, which is used for lease renewal |
| 1606 |
* @old_fh: file handle of old parent dir |
| 1607 |
* @new_fh: file handle of new parent dir |
| 1608 |
* |
| 1609 |
* Fires when a reply to a rename RPC task is received or some rename |
| 1610 |
* error occurs (timeout or socket shutdown). |
| 1611 |
*/ |
| 1612 |
probe nfs.proc.rename_done = nfs.proc2.rename_done ?, |
| 1613 |
nfs.proc3.rename_done, |
| 1614 |
nfs.proc4.rename_done |
| 1615 |
{} |
| 1616 |
|
| 1617 |
probe nfs.proc.rename_done.return = nfs.proc2.rename_done.return ?, |
| 1618 |
nfs.proc3.rename_done.return, |
| 1619 |
nfs.proc4.rename_done.return |
| 1620 |
{} |
| 1621 |
|
| 1622 |
probe nfs.proc2.rename_done = kernel.function("nfs_proc_rename_done") !, |
| 1623 |
module("nfs").function("nfs_proc_rename_done") ?, |
| 1624 |
module("nfsv2").function("nfs_proc_rename_done") ? |
| 1625 |
{ |
| 1626 |
client = NFS_CLIENT($old_dir) |
| 1627 |
server_ip = get_ip_from_client(client) |
| 1628 |
prot = get_prot_from_client(client) |
| 1629 |
version = 2 |
| 1630 |
status = $task->tk_status |
| 1631 |
timestamp = 0 |
| 1632 |
|
| 1633 |
old_fh = NFS_FH($old_dir) |
| 1634 |
new_fh = NFS_FH($new_dir) |
| 1635 |
|
| 1636 |
name = "nfs.proc2.rename_done" |
| 1637 |
argstr = sprintf("%d", status) |
| 1638 |
} |
| 1639 |
probe nfs.proc2.rename_done.return = |
| 1640 |
kernel.function("nfs_rename_done").return !, |
| 1641 |
module("nfs").function("nfs_rename_done").return !, |
| 1642 |
module("nfsv2").function("nfs_rename_done").return ! |
| 1643 |
{ |
| 1644 |
version = 2 |
| 1645 |
name = "nfs.proc2.rename_done.return" |
| 1646 |
retstr = sprintf("%d", $return) |
| 1647 |
} |
| 1648 |
|
| 1649 |
probe nfs.proc3.rename_done = |
| 1650 |
kernel.function("nfs3_proc_rename_done") !, |
| 1651 |
module("nfs").function("nfs3_proc_rename_done") ?, |
| 1652 |
module("nfsv3").function("nfs3_proc_rename_done") ? |
| 1653 |
{ |
| 1654 |
client = NFS_CLIENT($old_dir) |
| 1655 |
server_ip = get_ip_from_client(client) |
| 1656 |
prot = get_prot_from_client(client) |
| 1657 |
version = 3 |
| 1658 |
status = $task->tk_status |
| 1659 |
timestamp = 0 |
| 1660 |
|
| 1661 |
old_fh = NFS_FH($old_dir) |
| 1662 |
new_fh = NFS_FH($new_dir) |
| 1663 |
|
| 1664 |
name = "nfs.proc3.rename_done" |
| 1665 |
argstr = sprintf("%d", status) |
| 1666 |
} |
| 1667 |
probe nfs.proc3.rename_done.return = |
| 1668 |
kernel.function("nfs3_proc_rename_done").return !, |
| 1669 |
module("nfs").function("nfs3_proc_rename_done").return ?, |
| 1670 |
module("nfsv3").function("nfs3_proc_rename_done").return ? |
| 1671 |
{ |
| 1672 |
version = 3 |
| 1673 |
name = "nfs.proc3.rename_done.return" |
| 1674 |
retstr = sprintf("%d", $return) |
| 1675 |
} |
| 1676 |
|
| 1677 |
probe nfs.proc4.rename_done = |
| 1678 |
kernel.function("nfs4_proc_rename_done") !, |
| 1679 |
module("nfs").function("nfs4_proc_rename_done") ?, |
| 1680 |
module("nfsv4").function("nfs4_proc_rename_done") ? |
| 1681 |
{ |
| 1682 |
client = NFS_CLIENT($old_dir) |
| 1683 |
server_ip = get_ip_from_client(client) |
| 1684 |
prot = get_prot_from_client(client) |
| 1685 |
version = 4 |
| 1686 |
timestamp = @_nfs_data_timestamp(@choose_defined($hdr, $data)) |
| 1687 |
status = $task->tk_status |
| 1688 |
|
| 1689 |
old_fh = NFS_FH($old_dir) |
| 1690 |
new_fh = NFS_FH($new_dir) |
| 1691 |
|
| 1692 |
name = "nfs.proc4.rename_done" |
| 1693 |
argstr = sprintf("%d", status) |
| 1694 |
} |
| 1695 |
probe nfs.proc4.rename_done.return = |
| 1696 |
kernel.function("nfs4_proc_rename_done").return !, |
| 1697 |
module("nfs").function("nfs4_proc_rename_done").return ?, |
| 1698 |
module("nfsv4").function("nfs4_proc_rename_done").return ? |
| 1699 |
{ |
| 1700 |
version = 4 |
| 1701 |
name = "nfs.proc4.rename_done.return" |
| 1702 |
retstr = sprintf("%d", $return) |
| 1703 |
} |
| 1704 |
|
| 1705 |
/** |
| 1706 |
* probe nfs.proc.open - NFS client allocates file read/write context information |
| 1707 |
* |
| 1708 |
* @server_ip: IP address of server |
| 1709 |
* @prot: transfer protocol |
| 1710 |
* @version: NFS version (the function is used for all NFS version) |
| 1711 |
* @filename: file name |
| 1712 |
* @flag: file flag |
| 1713 |
* @mode: file mode |
| 1714 |
* |
| 1715 |
* Allocate file read/write context information |
| 1716 |
*/ |
| 1717 |
probe nfs.proc.open = kernel.function("nfs_open") !, |
| 1718 |
module("nfs").function("nfs_open") ? |
| 1719 |
{ |
| 1720 |
client = NFS_CLIENT($inode) |
| 1721 |
server_ip = get_ip_from_client(client) |
| 1722 |
prot = get_prot_from_client(client) |
| 1723 |
version = __nfs_version($inode) |
| 1724 |
|
| 1725 |
filename = __file_filename($filp) |
| 1726 |
flag = $filp->f_flags |
| 1727 |
mode = $filp->f_mode |
| 1728 |
|
| 1729 |
name = "nfs.proc.open" |
| 1730 |
argstr = sprintf("%s,%d,%d", filename, flag, mode) |
| 1731 |
} |
| 1732 |
|
| 1733 |
probe nfs.proc.open.return = kernel.function("nfs_open").return !, |
| 1734 |
module("nfs").function("nfs_open").return ? |
| 1735 |
{ |
| 1736 |
name = "nfs.proc.open.return" |
| 1737 |
retstr = sprintf("%d", $return) |
| 1738 |
} |
| 1739 |
|
| 1740 |
/** |
| 1741 |
* probe nfs.proc.release - NFS client releases file read/write context information |
| 1742 |
* |
| 1743 |
* @server_ip: IP address of server |
| 1744 |
* @prot: transfer protocol |
| 1745 |
* @version: NFS version (the function is used for all NFS version) |
| 1746 |
* @filename: file name |
| 1747 |
* @flag: file flag |
| 1748 |
* @mode: file mode |
| 1749 |
* |
| 1750 |
* Release file read/write context information |
| 1751 |
*/ |
| 1752 |
probe nfs.proc.release = kernel.function("nfs_release") !, |
| 1753 |
module("nfs").function("nfs_release") ? |
| 1754 |
{ |
| 1755 |
client = NFS_CLIENT($inode) |
| 1756 |
server_ip = get_ip_from_client(client) |
| 1757 |
prot = get_prot_from_client(client) |
| 1758 |
version = __nfs_version($inode) |
| 1759 |
|
| 1760 |
filename = __file_filename($filp) |
| 1761 |
flag = $filp->f_flags |
| 1762 |
mode = $filp->f_mode |
| 1763 |
|
| 1764 |
name = "nfs.proc.release" |
| 1765 |
argstr = sprintf("%s,%d,%d", filename, flag, mode) |
| 1766 |
} |
| 1767 |
|
| 1768 |
probe nfs.proc.release.return = kernel.function("nfs_release").return !, |
| 1769 |
module("nfs").function("nfs_release").return ? |
| 1770 |
{ |
| 1771 |
name = "nfs.proc.release.return" |
| 1772 |
retstr = sprintf("%d", $return) |
| 1773 |
} |
| 1774 |
|
| 1775 |
/** |
| 1776 |
* probe nfs.proc.handle_exception - NFS client handling an NFSv4 exception |
| 1777 |
* |
| 1778 |
* @errorcode: indicates the type of error |
| 1779 |
* |
| 1780 |
* This is the error handling routine for processes for NFSv4. |
| 1781 |
*/ |
| 1782 |
probe nfs.proc.handle_exception = nfs.proc4.handle_exception |
| 1783 |
{} |
| 1784 |
|
| 1785 |
probe nfs.proc.handle_exception.return = nfs.proc4.handle_exception.return |
| 1786 |
{} |
| 1787 |
|
| 1788 |
probe nfs.proc4.handle_exception = |
| 1789 |
kernel.function("nfs4_handle_exception") !, |
| 1790 |
module("nfs").function("nfs4_handle_exception") ?, |
| 1791 |
module("nfsv4").function("nfs4_handle_exception") ? |
| 1792 |
{ |
| 1793 |
version = 4 |
| 1794 |
|
| 1795 |
errorcode = $errorcode |
| 1796 |
|
| 1797 |
name = "nfs.proc4.handle_exception" |
| 1798 |
argstr = sprintf("%d", errorcode) |
| 1799 |
} |
| 1800 |
|
| 1801 |
probe nfs.proc4.handle_exception.return = |
| 1802 |
kernel.function("nfs4_handle_exception").return !, |
| 1803 |
module("nfs").function("nfs4_handle_exception").return ?, |
| 1804 |
module("nfsv4").function("nfs4_handle_exception").return ? |
| 1805 |
{ |
| 1806 |
name = "nfs.proc4.handle_exception.return" |
| 1807 |
retstr = sprintf("%d", $return) |
| 1808 |
} |
| 1809 |
|
| 1810 |
/** |
| 1811 |
* probe nfs.proc.create - NFS client creating file on server |
| 1812 |
* |
| 1813 |
* @server_ip: IP address of server |
| 1814 |
* @prot: transfer protocol |
| 1815 |
* @version: NFS version (the function is used for all NFS version) |
| 1816 |
* @fh: file handle of parent dir |
| 1817 |
* @filename: file name |
| 1818 |
* @filelen: length of file name |
| 1819 |
* @flag: indicates create mode (only for NFSv3 and NFSv4) |
| 1820 |
*/ |
| 1821 |
probe nfs.proc.create = nfs.proc2.create, |
| 1822 |
nfs.proc3.create, |
| 1823 |
nfs.proc4.create |
| 1824 |
{} |
| 1825 |
|
| 1826 |
probe nfs.proc.create.return = nfs.proc2.create.return, |
| 1827 |
nfs.proc3.create.return, |
| 1828 |
nfs.proc4.create.return |
| 1829 |
{} |
| 1830 |
|
| 1831 |
probe nfs.proc2.create = _nfs.proc2.create !, _nfs.proc2.missing_create |
| 1832 |
{ |
| 1833 |
version = 2 |
| 1834 |
|
| 1835 |
name = "nfs.proc2.create" |
| 1836 |
argstr = sprintf("%s", filename) |
| 1837 |
} |
| 1838 |
probe _nfs.proc2.create = kernel.function("nfs_proc_create") !, |
| 1839 |
module("nfs").function("nfs_proc_create") ?, |
| 1840 |
module("nfsv2").function("nfs_proc_create") ? |
| 1841 |
{ |
| 1842 |
client = NFS_CLIENT($dir) |
| 1843 |
server_ip = get_ip_from_client(client) |
| 1844 |
prot = get_prot_from_client(client) |
| 1845 |
|
| 1846 |
fh = NFS_FH($dir) |
| 1847 |
filelen = $dentry->d_name->len |
| 1848 |
filename = kernel_string_n($dentry->d_name->name, filelen) |
| 1849 |
mode = $sattr->ia_mode |
| 1850 |
} |
| 1851 |
probe _nfs.proc2.missing_create = never |
| 1852 |
{ |
| 1853 |
client = 0 |
| 1854 |
%( systemtap_v >= "4.3" %? |
| 1855 |
server_ip = "" |
| 1856 |
%: |
| 1857 |
server_ip = 0 |
| 1858 |
%) |
| 1859 |
prot = 0 |
| 1860 |
|
| 1861 |
fh = 0 |
| 1862 |
filelen = 0 |
| 1863 |
filename = "" |
| 1864 |
mode = 0 |
| 1865 |
} |
| 1866 |
|
| 1867 |
probe nfs.proc2.create.return = |
| 1868 |
kernel.function("nfs_proc_create").return !, |
| 1869 |
module("nfs").function("nfs_proc_create").return !, |
| 1870 |
module("nfsv2").function("nfs_proc_create").return !, |
| 1871 |
never |
| 1872 |
{ |
| 1873 |
name = "nfs.proc2.create.return" |
| 1874 |
version = 2 |
| 1875 |
retstr = (@defined($return) ? sprintf("%d", $return) : "N/A") |
| 1876 |
} |
| 1877 |
|
| 1878 |
probe nfs.proc3.create = kernel.function("nfs3_proc_create") !, |
| 1879 |
module("nfs").function("nfs3_proc_create") ?, |
| 1880 |
module("nfsv3").function("nfs3_proc_create") ? |
| 1881 |
{ |
| 1882 |
client = NFS_CLIENT($dir) |
| 1883 |
server_ip = get_ip_from_client(client) |
| 1884 |
prot = get_prot_from_client(client) |
| 1885 |
version = 3 |
| 1886 |
|
| 1887 |
fh = NFS_FH($dir) |
| 1888 |
filelen = $dentry->d_name->len |
| 1889 |
filename = kernel_string_n($dentry->d_name->name, filelen) |
| 1890 |
flag = $flags |
| 1891 |
mode = $sattr->ia_mode |
| 1892 |
|
| 1893 |
name = "nfs.proc3.create" |
| 1894 |
argstr = sprintf("%s", filename) |
| 1895 |
} |
| 1896 |
|
| 1897 |
probe nfs.proc3.create.return = |
| 1898 |
kernel.function("nfs3_proc_create").return !, |
| 1899 |
module("nfs").function("nfs3_proc_create").return ?, |
| 1900 |
module("nfsv3").function("nfs3_proc_create").return ? |
| 1901 |
{ |
| 1902 |
name = "nfs.proc3.create.return" |
| 1903 |
version = 3 |
| 1904 |
retstr = sprintf("%d", $return) |
| 1905 |
} |
| 1906 |
|
| 1907 |
probe nfs.proc4.create = kernel.function("nfs4_proc_create") !, |
| 1908 |
module("nfs").function("nfs4_proc_create") ?, |
| 1909 |
module("nfsv4").function("nfs4_proc_create") ? |
| 1910 |
{ |
| 1911 |
client = NFS_CLIENT($dir) |
| 1912 |
server_ip = get_ip_from_client(client) |
| 1913 |
prot = get_prot_from_client(client) |
| 1914 |
version = 4 |
| 1915 |
|
| 1916 |
fh = NFS_FH($dir) |
| 1917 |
filelen = $dentry->d_name->len |
| 1918 |
filename = kernel_string_n($dentry->d_name->name, filelen) |
| 1919 |
flag = $flags |
| 1920 |
mode = $sattr->ia_mode |
| 1921 |
|
| 1922 |
name = "nfs.proc4.create" |
| 1923 |
argstr = sprintf("%s", filename) |
| 1924 |
} |
| 1925 |
|
| 1926 |
probe nfs.proc4.create.return = |
| 1927 |
kernel.function("nfs4_proc_create").return !, |
| 1928 |
module("nfs").function("nfs4_proc_create").return ?, |
| 1929 |
module("nfsv4").function("nfs4_proc_create").return ? |
| 1930 |
{ |
| 1931 |
name = "nfs.proc4.create.return" |
| 1932 |
version = 4 |
| 1933 |
retstr = sprintf("%d", $return) |
| 1934 |
} |
| 1935 |
|
| 1936 |
/** |
| 1937 |
* probe nfs.proc.remove - NFS client removes a file on server |
| 1938 |
* |
| 1939 |
* @server_ip: IP address of server |
| 1940 |
* @prot: transfer protocol |
| 1941 |
* @version: NFS version (the function is used for all NFS version) |
| 1942 |
* @fh: file handle of parent dir |
| 1943 |
* @filename: file name |
| 1944 |
* @filelen: length of file name |
| 1945 |
*/ |
| 1946 |
probe nfs.proc.remove = nfs.proc2.remove, |
| 1947 |
nfs.proc3.remove, |
| 1948 |
nfs.proc4.remove |
| 1949 |
{} |
| 1950 |
|
| 1951 |
probe nfs.proc.remove.return = nfs.proc2.remove.return, |
| 1952 |
nfs.proc3.remove.return, |
| 1953 |
nfs.proc4.remove.return |
| 1954 |
{} |
| 1955 |
|
| 1956 |
probe nfs.proc2.remove = _nfs.proc2.remove !, _nfs.proc2.missing_remove |
| 1957 |
{ |
| 1958 |
version = 2 |
| 1959 |
|
| 1960 |
name = "nfs.proc2.remove" |
| 1961 |
argstr = sprintf("%s", filename) |
| 1962 |
} |
| 1963 |
probe _nfs.proc2.remove = kernel.function("nfs_proc_remove") !, |
| 1964 |
module("nfs").function("nfs_proc_remove") ?, |
| 1965 |
module("nfsv2").function("nfs_proc_remove") ? |
| 1966 |
{ |
| 1967 |
client = NFS_CLIENT($dir) |
| 1968 |
server_ip = get_ip_from_client(client) |
| 1969 |
prot = get_prot_from_client(client) |
| 1970 |
|
| 1971 |
fh = NFS_FH($dir) |
| 1972 |
filelen = $name->len |
| 1973 |
filename = kernel_string_n($name->name, filelen) |
| 1974 |
} |
| 1975 |
probe _nfs.proc2.missing_remove = never |
| 1976 |
{ |
| 1977 |
client = 0 |
| 1978 |
%( systemtap_v >= "4.3" %? |
| 1979 |
server_ip = "" |
| 1980 |
%: |
| 1981 |
server_ip = 0 |
| 1982 |
%) |
| 1983 |
prot = 0 |
| 1984 |
|
| 1985 |
fh = 0 |
| 1986 |
filelen = 0 |
| 1987 |
filename = "" |
| 1988 |
} |
| 1989 |
|
| 1990 |
probe nfs.proc2.remove.return = |
| 1991 |
kernel.function("nfs_proc_remove").return !, |
| 1992 |
module("nfs").function("nfs_proc_remove").return !, |
| 1993 |
module("nfsv2").function("nfs_proc_remove").return !, |
| 1994 |
never |
| 1995 |
{ |
| 1996 |
name = "nfs.proc2.remove.return" |
| 1997 |
version = 2 |
| 1998 |
retstr = (@defined($return) ? sprintf("%d", $return) : "N/A") |
| 1999 |
} |
| 2000 |
|
| 2001 |
probe nfs.proc3.remove = kernel.function("nfs3_proc_remove") !, |
| 2002 |
module("nfs").function("nfs3_proc_remove") ?, |
| 2003 |
module("nfsv3").function("nfs3_proc_remove") ? |
| 2004 |
{ |
| 2005 |
client = NFS_CLIENT($dir) |
| 2006 |
server_ip = get_ip_from_client(client) |
| 2007 |
prot = get_prot_from_client(client) |
| 2008 |
version = 3 |
| 2009 |
|
| 2010 |
fh = NFS_FH($dir) |
| 2011 |
filelen = $name->len |
| 2012 |
filename = kernel_string_n($name->name, filelen) |
| 2013 |
|
| 2014 |
name = "nfs.proc3.remove" |
| 2015 |
argstr = sprintf("%s", filename) |
| 2016 |
} |
| 2017 |
|
| 2018 |
probe nfs.proc3.remove.return = |
| 2019 |
kernel.function("nfs3_proc_remove").return !, |
| 2020 |
module("nfs").function("nfs3_proc_remove").return ?, |
| 2021 |
module("nfsv3").function("nfs3_proc_remove").return ? |
| 2022 |
{ |
| 2023 |
name = "nfs.proc3.remove.return" |
| 2024 |
version = 3 |
| 2025 |
retstr = sprintf("%d", $return) |
| 2026 |
} |
| 2027 |
|
| 2028 |
probe nfs.proc4.remove = kernel.function("nfs4_proc_remove") !, |
| 2029 |
module("nfs").function("nfs4_proc_remove") ?, |
| 2030 |
module("nfsv4").function("nfs4_proc_remove") ? |
| 2031 |
{ |
| 2032 |
client = NFS_CLIENT($dir) |
| 2033 |
server_ip = get_ip_from_client(client) |
| 2034 |
prot = get_prot_from_client(client) |
| 2035 |
version = 4 |
| 2036 |
|
| 2037 |
fh = NFS_FH($dir) |
| 2038 |
filelen = $name->len |
| 2039 |
filename = kernel_string_n($name->name, filelen) |
| 2040 |
|
| 2041 |
name = "nfs.proc4.remove" |
| 2042 |
argstr = sprintf("%s", filename) |
| 2043 |
} |
| 2044 |
|
| 2045 |
probe nfs.proc4.remove.return = |
| 2046 |
kernel.function("nfs4_proc_remove").return !, |
| 2047 |
module("nfs").function("nfs4_proc_remove").return ?, |
| 2048 |
module("nfsv4").function("nfs4_proc_remove").return ? |
| 2049 |
{ |
| 2050 |
name = "nfs.proc4.remove.return" |
| 2051 |
version = 4 |
| 2052 |
retstr = sprintf("%d", $return) |
| 2053 |
} |
| 2054 |
|
| 2055 |
/** |
| 2056 |
* probe nfs.proc.rename - NFS client renames a file on server |
| 2057 |
* |
| 2058 |
* @server_ip: IP address of server |
| 2059 |
* @prot: transfer protocol |
| 2060 |
* @version: NFS version (the function is used for all NFS version) |
| 2061 |
* @old_fh: file handle of old parent dir |
| 2062 |
* @new_fh: file handle of new parent dir |
| 2063 |
* @old_name: old file name |
| 2064 |
* @old_filelen: length of old file name |
| 2065 |
* @new_name: new file name |
| 2066 |
* @new_filelen: length of new file name |
| 2067 |
*/ |
| 2068 |
probe nfs.proc.rename = nfs.proc2.rename, |
| 2069 |
nfs.proc3.rename, |
| 2070 |
nfs.proc4.rename |
| 2071 |
{} |
| 2072 |
|
| 2073 |
probe nfs.proc.rename.return = nfs.proc2.rename.return, |
| 2074 |
nfs.proc3.rename.return, |
| 2075 |
nfs.proc4.rename.return |
| 2076 |
{} |
| 2077 |
|
| 2078 |
probe nfs.proc2.rename = _nfs.proc2.rename !, _nfs.proc2.missing_rename |
| 2079 |
{ |
| 2080 |
version = 2 |
| 2081 |
|
| 2082 |
name = "nfs.proc2.rename" |
| 2083 |
argstr = sprintf("%s,%s", old_name, new_name) |
| 2084 |
} |
| 2085 |
probe _nfs.proc2.rename = kernel.function("nfs_proc_rename") !, |
| 2086 |
module("nfs").function("nfs_proc_rename") ?, |
| 2087 |
module("nfsv2").function("nfs_proc_rename") ? |
| 2088 |
{ |
| 2089 |
client = NFS_CLIENT($old_dir) |
| 2090 |
server_ip = get_ip_from_client(client) |
| 2091 |
prot = get_prot_from_client(client) |
| 2092 |
|
| 2093 |
old_fh = NFS_FH($old_dir) |
| 2094 |
old_filelen = $old_name->len |
| 2095 |
old_name = kernel_string_n($old_name->name, old_filelen) |
| 2096 |
new_fh = NFS_FH($new_dir) |
| 2097 |
new_filelen = $new_name->len |
| 2098 |
new_name = kernel_string_n($new_name->name, new_filelen) |
| 2099 |
} |
| 2100 |
probe _nfs.proc2.missing_rename = never |
| 2101 |
{ |
| 2102 |
client = 0 |
| 2103 |
%( systemtap_v >= "4.3" %? |
| 2104 |
server_ip = "" |
| 2105 |
%: |
| 2106 |
server_ip = 0 |
| 2107 |
%) |
| 2108 |
prot = 0 |
| 2109 |
|
| 2110 |
old_fh = 0 |
| 2111 |
old_filelen = 0 |
| 2112 |
old_name = "" |
| 2113 |
new_fh = 0 |
| 2114 |
new_filelen = 0 |
| 2115 |
new_name = "" |
| 2116 |
} |
| 2117 |
|
| 2118 |
probe nfs.proc2.rename.return = |
| 2119 |
kernel.function("nfs_proc_rename").return !, |
| 2120 |
module("nfs").function("nfs_proc_rename").return !, |
| 2121 |
module("nfsv2").function("nfs_proc_rename").return !, |
| 2122 |
never |
| 2123 |
{ |
| 2124 |
name = "nfs.proc2.rename.return" |
| 2125 |
version = 2 |
| 2126 |
retstr = (@defined($return) ? sprintf("%d", $return) : "N/A") |
| 2127 |
} |
| 2128 |
|
| 2129 |
probe nfs.proc3.rename = _nfs.proc3.rename !, _nfs.proc3.missing_rename |
| 2130 |
{ |
| 2131 |
version = 3 |
| 2132 |
|
| 2133 |
name = "nfs.proc3.rename" |
| 2134 |
argstr = sprintf("%s,%s", old_name, new_name) |
| 2135 |
} |
| 2136 |
probe _nfs.proc3.rename = kernel.function("nfs3_proc_rename") !, |
| 2137 |
module("nfs").function("nfs3_proc_rename") ?, |
| 2138 |
module("nfsv3").function("nfs3_proc_rename") ? |
| 2139 |
{ |
| 2140 |
client = NFS_CLIENT($old_dir) |
| 2141 |
server_ip = get_ip_from_client(client) |
| 2142 |
prot = get_prot_from_client(client) |
| 2143 |
|
| 2144 |
old_fh = NFS_FH($old_dir) |
| 2145 |
old_filelen = $old_name->len |
| 2146 |
old_name = kernel_string_n($old_name->name, old_filelen) |
| 2147 |
new_fh = NFS_FH($new_dir) |
| 2148 |
new_filelen = $new_name->len |
| 2149 |
new_name = kernel_string_n($new_name->name, new_filelen) |
| 2150 |
} |
| 2151 |
probe _nfs.proc3.missing_rename = never |
| 2152 |
{ |
| 2153 |
client = 0 |
| 2154 |
%( systemtap_v >= "4.3" %? |
| 2155 |
server_ip = "" |
| 2156 |
%: |
| 2157 |
server_ip = 0 |
| 2158 |
%) |
| 2159 |
prot = 0 |
| 2160 |
|
| 2161 |
old_fh = 0 |
| 2162 |
old_filelen = 0 |
| 2163 |
old_name = "" |
| 2164 |
new_fh = 0 |
| 2165 |
new_filelen = 0 |
| 2166 |
new_name = "" |
| 2167 |
} |
| 2168 |
|
| 2169 |
probe nfs.proc3.rename.return = |
| 2170 |
kernel.function("nfs3_proc_rename").return !, |
| 2171 |
module("nfs").function("nfs3_proc_rename").return ?, |
| 2172 |
module("nfsv3").function("nfs3_proc_rename").return !, |
| 2173 |
never |
| 2174 |
{ |
| 2175 |
name = "nfs.proc3.rename.return" |
| 2176 |
version = 3 |
| 2177 |
retstr = (@defined($return) ? sprintf("%d", $return) : "N/A") |
| 2178 |
} |
| 2179 |
|
| 2180 |
probe nfs.proc4.rename = _nfs.proc4.rename !, _nfs.proc4.missing_rename |
| 2181 |
{ |
| 2182 |
version = 4 |
| 2183 |
|
| 2184 |
name = "nfs.proc4.rename" |
| 2185 |
argstr = sprintf("%s,%s", old_name, new_name) |
| 2186 |
} |
| 2187 |
probe _nfs.proc4.rename = kernel.function("nfs4_proc_rename") !, |
| 2188 |
module("nfs").function("nfs4_proc_rename") ?, |
| 2189 |
module("nfsv4").function("nfs4_proc_rename") ? |
| 2190 |
{ |
| 2191 |
client = NFS_CLIENT($old_dir) |
| 2192 |
server_ip = get_ip_from_client(client) |
| 2193 |
prot = get_prot_from_client(client) |
| 2194 |
|
| 2195 |
old_fh = NFS_FH($old_dir) |
| 2196 |
old_filelen = $old_name->len |
| 2197 |
old_name = kernel_string_n($old_name->name, old_filelen) |
| 2198 |
new_fh = NFS_FH($new_dir) |
| 2199 |
new_filelen = $new_name->len |
| 2200 |
new_name = kernel_string_n($new_name->name, new_filelen) |
| 2201 |
} |
| 2202 |
probe _nfs.proc4.missing_rename = never |
| 2203 |
{ |
| 2204 |
client = 0 |
| 2205 |
%( systemtap_v >= "4.3" %? |
| 2206 |
server_ip = "" |
| 2207 |
%: |
| 2208 |
server_ip = 0 |
| 2209 |
%) |
| 2210 |
prot = 0 |
| 2211 |
|
| 2212 |
old_fh = 0 |
| 2213 |
old_filelen = 0 |
| 2214 |
old_name = "" |
| 2215 |
new_fh = 0 |
| 2216 |
new_filelen = 0 |
| 2217 |
new_name = "" |
| 2218 |
} |
| 2219 |
|
| 2220 |
probe nfs.proc4.rename.return = |
| 2221 |
kernel.function("nfs4_proc_rename").return !, |
| 2222 |
module("nfs").function("nfs4_proc_rename").return ?, |
| 2223 |
module("nfsv4").function("nfs4_proc_rename").return !, |
| 2224 |
never |
| 2225 |
{ |
| 2226 |
name = "nfs.proc4.rename.return" |
| 2227 |
version = 4 |
| 2228 |
retstr = (@defined($return) ? sprintf("%d", $return) : "N/A") |
| 2229 |
} |