License cleanup: add SPDX GPL-2.0 license identifier to files with no license
Many source files in the tree are missing licensing information, which
makes it harder for compliance tools to determine the correct license.
By default all files without license information are under the default
license of the kernel, which is GPL version 2.
Update the files which contain no license information with the 'GPL-2.0'
SPDX license identifier. The SPDX identifier is a legally binding
shorthand, which can be used instead of the full boiler plate text.
This patch is based on work done by Thomas Gleixner and Kate Stewart and
Philippe Ombredanne.
How this work was done:
Patches were generated and checked against linux-4.14-rc6 for a subset of
the use cases:
- file had no licensing information it it.
- file was a */uapi/* one with no licensing information in it,
- file was a */uapi/* one with existing licensing information,
Further patches will be generated in subsequent months to fix up cases
where non-standard license headers were used, and references to license
had to be inferred by heuristics based on keywords.
The analysis to determine which SPDX License Identifier to be applied to
a file was done in a spreadsheet of side by side results from of the
output of two independent scanners (ScanCode & Windriver) producing SPDX
tag:value files created by Philippe Ombredanne. Philippe prepared the
base worksheet, and did an initial spot review of a few 1000 files.
The 4.13 kernel was the starting point of the analysis with 60,537 files
assessed. Kate Stewart did a file by file comparison of the scanner
results in the spreadsheet to determine which SPDX license identifier(s)
to be applied to the file. She confirmed any determination that was not
immediately clear with lawyers working with the Linux Foundation.
Criteria used to select files for SPDX license identifier tagging was:
- Files considered eligible had to be source code files.
- Make and config files were included as candidates if they contained >5
lines of source
- File already had some variant of a license header in it (even if <5
lines).
All documentation files were explicitly excluded.
The following heuristics were used to determine which SPDX license
identifiers to apply.
- when both scanners couldn't find any license traces, file was
considered to have no license information in it, and the top level
COPYING file license applied.
For non */uapi/* files that summary was:
SPDX license identifier # files
---------------------------------------------------|-------
GPL-2.0 11139
and resulted in the first patch in this series.
If that file was a */uapi/* path one, it was "GPL-2.0 WITH
Linux-syscall-note" otherwise it was "GPL-2.0". Results of that was:
SPDX license identifier # files
---------------------------------------------------|-------
GPL-2.0 WITH Linux-syscall-note 930
and resulted in the second patch in this series.
- if a file had some form of licensing information in it, and was one
of the */uapi/* ones, it was denoted with the Linux-syscall-note if
any GPL family license was found in the file or had no licensing in
it (per prior point). Results summary:
SPDX license identifier # files
---------------------------------------------------|------
GPL-2.0 WITH Linux-syscall-note 270
GPL-2.0+ WITH Linux-syscall-note 169
((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) 21
((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) 17
LGPL-2.1+ WITH Linux-syscall-note 15
GPL-1.0+ WITH Linux-syscall-note 14
((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause) 5
LGPL-2.0+ WITH Linux-syscall-note 4
LGPL-2.1 WITH Linux-syscall-note 3
((GPL-2.0 WITH Linux-syscall-note) OR MIT) 3
((GPL-2.0 WITH Linux-syscall-note) AND MIT) 1
and that resulted in the third patch in this series.
- when the two scanners agreed on the detected license(s), that became
the concluded license(s).
- when there was disagreement between the two scanners (one detected a
license but the other didn't, or they both detected different
licenses) a manual inspection of the file occurred.
- In most cases a manual inspection of the information in the file
resulted in a clear resolution of the license that should apply (and
which scanner probably needed to revisit its heuristics).
- When it was not immediately clear, the license identifier was
confirmed with lawyers working with the Linux Foundation.
- If there was any question as to the appropriate license identifier,
the file was flagged for further research and to be revisited later
in time.
In total, over 70 hours of logged manual review was done on the
spreadsheet to determine the SPDX license identifiers to apply to the
source files by Kate, Philippe, Thomas and, in some cases, confirmation
by lawyers working with the Linux Foundation.
Kate also obtained a third independent scan of the 4.13 code base from
FOSSology, and compared selected files where the other two scanners
disagreed against that SPDX file, to see if there was new insights. The
Windriver scanner is based on an older version of FOSSology in part, so
they are related.
Thomas did random spot checks in about 500 files from the spreadsheets
for the uapi headers and agreed with SPDX license identifier in the
files he inspected. For the non-uapi files Thomas did random spot checks
in about 15000 files.
In initial set of patches against 4.14-rc6, 3 files were found to have
copy/paste license identifier errors, and have been fixed to reflect the
correct identifier.
Additionally Philippe spent 10 hours this week doing a detailed manual
inspection and review of the 12,461 patched files from the initial patch
version early this week with:
- a full scancode scan run, collecting the matched texts, detected
license ids and scores
- reviewing anything where there was a license detected (about 500+
files) to ensure that the applied SPDX license was correct
- reviewing anything where there was no detection but the patch license
was not GPL-2.0 WITH Linux-syscall-note to ensure that the applied
SPDX license was correct
This produced a worksheet with 20 files needing minor correction. This
worksheet was then exported into 3 different .csv files for the
different types of files to be modified.
These .csv files were then reviewed by Greg. Thomas wrote a script to
parse the csv files and add the proper SPDX tag to the file, in the
format that the file expected. This script was further refined by Greg
based on the output to detect more types of files automatically and to
distinguish between header and source .c files (which need different
comment types.) Finally Greg ran the script using the .csv files to
generate the patches.
Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org>
Reviewed-by: Philippe Ombredanne <pombredanne@nexb.com>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-01 14:07:57 +00:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 */
|
2013-08-19 22:59:33 +00:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2013 Trond Myklebust <Trond.Myklebust@netapp.com>
|
|
|
|
*/
|
|
|
|
#undef TRACE_SYSTEM
|
|
|
|
#define TRACE_SYSTEM nfs
|
|
|
|
|
|
|
|
#if !defined(_TRACE_NFS_H) || defined(TRACE_HEADER_MULTI_READ)
|
|
|
|
#define _TRACE_NFS_H
|
|
|
|
|
|
|
|
#include <linux/tracepoint.h>
|
2018-01-09 13:21:17 +00:00
|
|
|
#include <linux/iversion.h>
|
2013-08-19 22:59:33 +00:00
|
|
|
|
2022-11-14 13:57:43 +00:00
|
|
|
#include <trace/misc/fs.h>
|
|
|
|
#include <trace/misc/nfs.h>
|
|
|
|
#include <trace/misc/sunrpc.h>
|
2021-10-16 22:02:24 +00:00
|
|
|
|
2013-08-19 22:59:33 +00:00
|
|
|
#define nfs_show_cache_validity(v) \
|
|
|
|
__print_flags(v, "|", \
|
|
|
|
{ NFS_INO_INVALID_DATA, "INVALID_DATA" }, \
|
|
|
|
{ NFS_INO_INVALID_ATIME, "INVALID_ATIME" }, \
|
|
|
|
{ NFS_INO_INVALID_ACCESS, "INVALID_ACCESS" }, \
|
|
|
|
{ NFS_INO_INVALID_ACL, "INVALID_ACL" }, \
|
|
|
|
{ NFS_INO_REVAL_FORCED, "REVAL_FORCED" }, \
|
2019-06-19 14:34:03 +00:00
|
|
|
{ NFS_INO_INVALID_LABEL, "INVALID_LABEL" }, \
|
|
|
|
{ NFS_INO_INVALID_CHANGE, "INVALID_CHANGE" }, \
|
|
|
|
{ NFS_INO_INVALID_CTIME, "INVALID_CTIME" }, \
|
|
|
|
{ NFS_INO_INVALID_MTIME, "INVALID_MTIME" }, \
|
|
|
|
{ NFS_INO_INVALID_SIZE, "INVALID_SIZE" }, \
|
2020-06-23 22:39:00 +00:00
|
|
|
{ NFS_INO_INVALID_OTHER, "INVALID_OTHER" }, \
|
2021-03-25 19:45:09 +00:00
|
|
|
{ NFS_INO_DATA_INVAL_DEFER, "DATA_INVAL_DEFER" }, \
|
|
|
|
{ NFS_INO_INVALID_BLOCKS, "INVALID_BLOCKS" }, \
|
2021-03-25 17:14:42 +00:00
|
|
|
{ NFS_INO_INVALID_XATTR, "INVALID_XATTR" }, \
|
2021-04-13 13:41:16 +00:00
|
|
|
{ NFS_INO_INVALID_NLINK, "INVALID_NLINK" }, \
|
|
|
|
{ NFS_INO_INVALID_MODE, "INVALID_MODE" })
|
2019-06-19 14:34:03 +00:00
|
|
|
|
2013-08-19 22:59:33 +00:00
|
|
|
#define nfs_show_nfsi_flags(v) \
|
|
|
|
__print_flags(v, "|", \
|
2019-06-19 14:34:03 +00:00
|
|
|
{ BIT(NFS_INO_STALE), "STALE" }, \
|
|
|
|
{ BIT(NFS_INO_ACL_LRU_SET), "ACL_LRU_SET" }, \
|
|
|
|
{ BIT(NFS_INO_INVALIDATING), "INVALIDATING" }, \
|
|
|
|
{ BIT(NFS_INO_LAYOUTCOMMIT), "NEED_LAYOUTCOMMIT" }, \
|
|
|
|
{ BIT(NFS_INO_LAYOUTCOMMITTING), "LAYOUTCOMMIT" }, \
|
|
|
|
{ BIT(NFS_INO_LAYOUTSTATS), "LAYOUTSTATS" }, \
|
|
|
|
{ BIT(NFS_INO_ODIRECT), "ODIRECT" })
|
2013-08-19 22:59:33 +00:00
|
|
|
|
|
|
|
DECLARE_EVENT_CLASS(nfs_inode_event,
|
|
|
|
TP_PROTO(
|
|
|
|
const struct inode *inode
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_ARGS(inode),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__field(dev_t, dev)
|
|
|
|
__field(u32, fhandle)
|
|
|
|
__field(u64, fileid)
|
|
|
|
__field(u64, version)
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
const struct nfs_inode *nfsi = NFS_I(inode);
|
|
|
|
__entry->dev = inode->i_sb->s_dev;
|
|
|
|
__entry->fileid = nfsi->fileid;
|
|
|
|
__entry->fhandle = nfs_fhandle_hash(&nfsi->fh);
|
2018-01-09 13:21:17 +00:00
|
|
|
__entry->version = inode_peek_iversion_raw(inode);
|
2013-08-19 22:59:33 +00:00
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk(
|
|
|
|
"fileid=%02x:%02x:%llu fhandle=0x%08x version=%llu ",
|
|
|
|
MAJOR(__entry->dev), MINOR(__entry->dev),
|
|
|
|
(unsigned long long)__entry->fileid,
|
|
|
|
__entry->fhandle,
|
|
|
|
(unsigned long long)__entry->version
|
|
|
|
)
|
|
|
|
);
|
|
|
|
|
|
|
|
DECLARE_EVENT_CLASS(nfs_inode_event_done,
|
|
|
|
TP_PROTO(
|
|
|
|
const struct inode *inode,
|
|
|
|
int error
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_ARGS(inode, error),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
2019-06-19 14:33:58 +00:00
|
|
|
__field(unsigned long, error)
|
2013-08-19 22:59:33 +00:00
|
|
|
__field(dev_t, dev)
|
|
|
|
__field(u32, fhandle)
|
|
|
|
__field(unsigned char, type)
|
|
|
|
__field(u64, fileid)
|
|
|
|
__field(u64, version)
|
|
|
|
__field(loff_t, size)
|
|
|
|
__field(unsigned long, nfsi_flags)
|
|
|
|
__field(unsigned long, cache_validity)
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
const struct nfs_inode *nfsi = NFS_I(inode);
|
2019-06-19 14:33:58 +00:00
|
|
|
__entry->error = error < 0 ? -error : 0;
|
2013-08-19 22:59:33 +00:00
|
|
|
__entry->dev = inode->i_sb->s_dev;
|
|
|
|
__entry->fileid = nfsi->fileid;
|
|
|
|
__entry->fhandle = nfs_fhandle_hash(&nfsi->fh);
|
|
|
|
__entry->type = nfs_umode_to_dtype(inode->i_mode);
|
2018-01-09 13:21:17 +00:00
|
|
|
__entry->version = inode_peek_iversion_raw(inode);
|
2013-08-19 22:59:33 +00:00
|
|
|
__entry->size = i_size_read(inode);
|
|
|
|
__entry->nfsi_flags = nfsi->flags;
|
|
|
|
__entry->cache_validity = nfsi->cache_validity;
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk(
|
2019-06-19 14:33:58 +00:00
|
|
|
"error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x "
|
2013-08-19 22:59:33 +00:00
|
|
|
"type=%u (%s) version=%llu size=%lld "
|
2019-06-19 14:34:03 +00:00
|
|
|
"cache_validity=0x%lx (%s) nfs_flags=0x%lx (%s)",
|
2021-10-22 20:17:03 +00:00
|
|
|
-__entry->error, show_nfs_status(__entry->error),
|
2013-08-19 22:59:33 +00:00
|
|
|
MAJOR(__entry->dev), MINOR(__entry->dev),
|
|
|
|
(unsigned long long)__entry->fileid,
|
|
|
|
__entry->fhandle,
|
|
|
|
__entry->type,
|
2021-10-22 20:16:56 +00:00
|
|
|
show_fs_dirent_type(__entry->type),
|
2013-08-19 22:59:33 +00:00
|
|
|
(unsigned long long)__entry->version,
|
|
|
|
(long long)__entry->size,
|
|
|
|
__entry->cache_validity,
|
|
|
|
nfs_show_cache_validity(__entry->cache_validity),
|
|
|
|
__entry->nfsi_flags,
|
|
|
|
nfs_show_nfsi_flags(__entry->nfsi_flags)
|
|
|
|
)
|
|
|
|
);
|
|
|
|
|
|
|
|
#define DEFINE_NFS_INODE_EVENT(name) \
|
|
|
|
DEFINE_EVENT(nfs_inode_event, name, \
|
|
|
|
TP_PROTO( \
|
|
|
|
const struct inode *inode \
|
|
|
|
), \
|
|
|
|
TP_ARGS(inode))
|
|
|
|
#define DEFINE_NFS_INODE_EVENT_DONE(name) \
|
|
|
|
DEFINE_EVENT(nfs_inode_event_done, name, \
|
|
|
|
TP_PROTO( \
|
|
|
|
const struct inode *inode, \
|
|
|
|
int error \
|
|
|
|
), \
|
|
|
|
TP_ARGS(inode, error))
|
2020-04-06 17:39:29 +00:00
|
|
|
DEFINE_NFS_INODE_EVENT(nfs_set_inode_stale);
|
2013-08-19 22:59:33 +00:00
|
|
|
DEFINE_NFS_INODE_EVENT(nfs_refresh_inode_enter);
|
|
|
|
DEFINE_NFS_INODE_EVENT_DONE(nfs_refresh_inode_exit);
|
|
|
|
DEFINE_NFS_INODE_EVENT(nfs_revalidate_inode_enter);
|
|
|
|
DEFINE_NFS_INODE_EVENT_DONE(nfs_revalidate_inode_exit);
|
|
|
|
DEFINE_NFS_INODE_EVENT(nfs_invalidate_mapping_enter);
|
|
|
|
DEFINE_NFS_INODE_EVENT_DONE(nfs_invalidate_mapping_exit);
|
|
|
|
DEFINE_NFS_INODE_EVENT(nfs_getattr_enter);
|
|
|
|
DEFINE_NFS_INODE_EVENT_DONE(nfs_getattr_exit);
|
|
|
|
DEFINE_NFS_INODE_EVENT(nfs_setattr_enter);
|
|
|
|
DEFINE_NFS_INODE_EVENT_DONE(nfs_setattr_exit);
|
|
|
|
DEFINE_NFS_INODE_EVENT(nfs_writeback_inode_enter);
|
|
|
|
DEFINE_NFS_INODE_EVENT_DONE(nfs_writeback_inode_exit);
|
|
|
|
DEFINE_NFS_INODE_EVENT(nfs_fsync_enter);
|
|
|
|
DEFINE_NFS_INODE_EVENT_DONE(nfs_fsync_exit);
|
|
|
|
DEFINE_NFS_INODE_EVENT(nfs_access_enter);
|
2021-11-16 13:49:24 +00:00
|
|
|
DEFINE_NFS_INODE_EVENT_DONE(nfs_set_cache_invalid);
|
2022-02-23 18:29:59 +00:00
|
|
|
DEFINE_NFS_INODE_EVENT(nfs_readdir_force_readdirplus);
|
2022-02-20 00:24:38 +00:00
|
|
|
DEFINE_NFS_INODE_EVENT_DONE(nfs_readdir_cache_fill_done);
|
|
|
|
DEFINE_NFS_INODE_EVENT_DONE(nfs_readdir_uncached_done);
|
2020-01-06 20:25:12 +00:00
|
|
|
|
|
|
|
TRACE_EVENT(nfs_access_exit,
|
|
|
|
TP_PROTO(
|
|
|
|
const struct inode *inode,
|
|
|
|
unsigned int mask,
|
|
|
|
unsigned int permitted,
|
|
|
|
int error
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_ARGS(inode, mask, permitted, error),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__field(unsigned long, error)
|
|
|
|
__field(dev_t, dev)
|
|
|
|
__field(u32, fhandle)
|
|
|
|
__field(unsigned char, type)
|
|
|
|
__field(u64, fileid)
|
|
|
|
__field(u64, version)
|
|
|
|
__field(loff_t, size)
|
|
|
|
__field(unsigned long, nfsi_flags)
|
|
|
|
__field(unsigned long, cache_validity)
|
|
|
|
__field(unsigned int, mask)
|
|
|
|
__field(unsigned int, permitted)
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
const struct nfs_inode *nfsi = NFS_I(inode);
|
|
|
|
__entry->error = error < 0 ? -error : 0;
|
|
|
|
__entry->dev = inode->i_sb->s_dev;
|
|
|
|
__entry->fileid = nfsi->fileid;
|
|
|
|
__entry->fhandle = nfs_fhandle_hash(&nfsi->fh);
|
|
|
|
__entry->type = nfs_umode_to_dtype(inode->i_mode);
|
|
|
|
__entry->version = inode_peek_iversion_raw(inode);
|
|
|
|
__entry->size = i_size_read(inode);
|
|
|
|
__entry->nfsi_flags = nfsi->flags;
|
|
|
|
__entry->cache_validity = nfsi->cache_validity;
|
|
|
|
__entry->mask = mask;
|
|
|
|
__entry->permitted = permitted;
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk(
|
|
|
|
"error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x "
|
|
|
|
"type=%u (%s) version=%llu size=%lld "
|
|
|
|
"cache_validity=0x%lx (%s) nfs_flags=0x%lx (%s) "
|
|
|
|
"mask=0x%x permitted=0x%x",
|
2021-10-22 20:17:03 +00:00
|
|
|
-__entry->error, show_nfs_status(__entry->error),
|
2020-01-06 20:25:12 +00:00
|
|
|
MAJOR(__entry->dev), MINOR(__entry->dev),
|
|
|
|
(unsigned long long)__entry->fileid,
|
|
|
|
__entry->fhandle,
|
|
|
|
__entry->type,
|
2021-10-22 20:16:56 +00:00
|
|
|
show_fs_dirent_type(__entry->type),
|
2020-01-06 20:25:12 +00:00
|
|
|
(unsigned long long)__entry->version,
|
|
|
|
(long long)__entry->size,
|
|
|
|
__entry->cache_validity,
|
|
|
|
nfs_show_cache_validity(__entry->cache_validity),
|
|
|
|
__entry->nfsi_flags,
|
|
|
|
nfs_show_nfsi_flags(__entry->nfsi_flags),
|
|
|
|
__entry->mask, __entry->permitted
|
|
|
|
)
|
|
|
|
);
|
2013-08-19 22:59:33 +00:00
|
|
|
|
2021-10-04 14:10:16 +00:00
|
|
|
DECLARE_EVENT_CLASS(nfs_update_size_class,
|
|
|
|
TP_PROTO(
|
|
|
|
const struct inode *inode,
|
|
|
|
loff_t new_size
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_ARGS(inode, new_size),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__field(dev_t, dev)
|
|
|
|
__field(u32, fhandle)
|
|
|
|
__field(u64, fileid)
|
|
|
|
__field(u64, version)
|
|
|
|
__field(loff_t, cur_size)
|
|
|
|
__field(loff_t, new_size)
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
const struct nfs_inode *nfsi = NFS_I(inode);
|
|
|
|
|
|
|
|
__entry->dev = inode->i_sb->s_dev;
|
|
|
|
__entry->fhandle = nfs_fhandle_hash(&nfsi->fh);
|
|
|
|
__entry->fileid = nfsi->fileid;
|
|
|
|
__entry->version = inode_peek_iversion_raw(inode);
|
|
|
|
__entry->cur_size = i_size_read(inode);
|
|
|
|
__entry->new_size = new_size;
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk(
|
|
|
|
"fileid=%02x:%02x:%llu fhandle=0x%08x version=%llu cursize=%lld newsize=%lld",
|
|
|
|
MAJOR(__entry->dev), MINOR(__entry->dev),
|
|
|
|
(unsigned long long)__entry->fileid,
|
|
|
|
__entry->fhandle, __entry->version,
|
|
|
|
__entry->cur_size, __entry->new_size
|
|
|
|
)
|
|
|
|
);
|
|
|
|
|
|
|
|
#define DEFINE_NFS_UPDATE_SIZE_EVENT(name) \
|
|
|
|
DEFINE_EVENT(nfs_update_size_class, nfs_size_##name, \
|
|
|
|
TP_PROTO( \
|
|
|
|
const struct inode *inode, \
|
|
|
|
loff_t new_size \
|
|
|
|
), \
|
|
|
|
TP_ARGS(inode, new_size))
|
|
|
|
|
|
|
|
DEFINE_NFS_UPDATE_SIZE_EVENT(truncate);
|
|
|
|
DEFINE_NFS_UPDATE_SIZE_EVENT(wcc);
|
|
|
|
DEFINE_NFS_UPDATE_SIZE_EVENT(update);
|
|
|
|
DEFINE_NFS_UPDATE_SIZE_EVENT(grow);
|
|
|
|
|
2022-02-20 00:09:21 +00:00
|
|
|
DECLARE_EVENT_CLASS(nfs_inode_range_event,
|
|
|
|
TP_PROTO(
|
|
|
|
const struct inode *inode,
|
|
|
|
loff_t range_start,
|
|
|
|
loff_t range_end
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_ARGS(inode, range_start, range_end),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__field(dev_t, dev)
|
|
|
|
__field(u32, fhandle)
|
|
|
|
__field(u64, fileid)
|
|
|
|
__field(u64, version)
|
|
|
|
__field(loff_t, range_start)
|
|
|
|
__field(loff_t, range_end)
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
const struct nfs_inode *nfsi = NFS_I(inode);
|
|
|
|
|
|
|
|
__entry->dev = inode->i_sb->s_dev;
|
|
|
|
__entry->fhandle = nfs_fhandle_hash(&nfsi->fh);
|
|
|
|
__entry->fileid = nfsi->fileid;
|
|
|
|
__entry->version = inode_peek_iversion_raw(inode);
|
|
|
|
__entry->range_start = range_start;
|
|
|
|
__entry->range_end = range_end;
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk(
|
|
|
|
"fileid=%02x:%02x:%llu fhandle=0x%08x version=%llu "
|
|
|
|
"range=[%lld, %lld]",
|
|
|
|
MAJOR(__entry->dev), MINOR(__entry->dev),
|
|
|
|
(unsigned long long)__entry->fileid,
|
|
|
|
__entry->fhandle, __entry->version,
|
|
|
|
__entry->range_start, __entry->range_end
|
|
|
|
)
|
|
|
|
);
|
|
|
|
|
|
|
|
#define DEFINE_NFS_INODE_RANGE_EVENT(name) \
|
|
|
|
DEFINE_EVENT(nfs_inode_range_event, name, \
|
|
|
|
TP_PROTO( \
|
|
|
|
const struct inode *inode, \
|
|
|
|
loff_t range_start, \
|
|
|
|
loff_t range_end \
|
|
|
|
), \
|
|
|
|
TP_ARGS(inode, range_start, range_end))
|
|
|
|
|
|
|
|
DEFINE_NFS_INODE_RANGE_EVENT(nfs_readdir_invalidate_cache_range);
|
|
|
|
|
2022-02-20 00:24:38 +00:00
|
|
|
DECLARE_EVENT_CLASS(nfs_readdir_event,
|
|
|
|
TP_PROTO(
|
|
|
|
const struct file *file,
|
|
|
|
const __be32 *verifier,
|
|
|
|
u64 cookie,
|
|
|
|
pgoff_t page_index,
|
|
|
|
unsigned int dtsize
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_ARGS(file, verifier, cookie, page_index, dtsize),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__field(dev_t, dev)
|
|
|
|
__field(u32, fhandle)
|
|
|
|
__field(u64, fileid)
|
|
|
|
__field(u64, version)
|
|
|
|
__array(char, verifier, NFS4_VERIFIER_SIZE)
|
|
|
|
__field(u64, cookie)
|
|
|
|
__field(pgoff_t, index)
|
|
|
|
__field(unsigned int, dtsize)
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
const struct inode *dir = file_inode(file);
|
|
|
|
const struct nfs_inode *nfsi = NFS_I(dir);
|
|
|
|
|
|
|
|
__entry->dev = dir->i_sb->s_dev;
|
|
|
|
__entry->fileid = nfsi->fileid;
|
|
|
|
__entry->fhandle = nfs_fhandle_hash(&nfsi->fh);
|
|
|
|
__entry->version = inode_peek_iversion_raw(dir);
|
|
|
|
if (cookie != 0)
|
|
|
|
memcpy(__entry->verifier, verifier,
|
|
|
|
NFS4_VERIFIER_SIZE);
|
|
|
|
else
|
|
|
|
memset(__entry->verifier, 0,
|
|
|
|
NFS4_VERIFIER_SIZE);
|
|
|
|
__entry->cookie = cookie;
|
|
|
|
__entry->index = page_index;
|
|
|
|
__entry->dtsize = dtsize;
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk(
|
|
|
|
"fileid=%02x:%02x:%llu fhandle=0x%08x version=%llu "
|
|
|
|
"cookie=%s:0x%llx cache_index=%lu dtsize=%u",
|
|
|
|
MAJOR(__entry->dev), MINOR(__entry->dev),
|
|
|
|
(unsigned long long)__entry->fileid, __entry->fhandle,
|
|
|
|
__entry->version, show_nfs4_verifier(__entry->verifier),
|
|
|
|
(unsigned long long)__entry->cookie, __entry->index,
|
|
|
|
__entry->dtsize
|
|
|
|
)
|
|
|
|
);
|
|
|
|
|
|
|
|
#define DEFINE_NFS_READDIR_EVENT(name) \
|
|
|
|
DEFINE_EVENT(nfs_readdir_event, name, \
|
|
|
|
TP_PROTO( \
|
|
|
|
const struct file *file, \
|
|
|
|
const __be32 *verifier, \
|
|
|
|
u64 cookie, \
|
|
|
|
pgoff_t page_index, \
|
|
|
|
unsigned int dtsize \
|
|
|
|
), \
|
|
|
|
TP_ARGS(file, verifier, cookie, page_index, dtsize))
|
|
|
|
|
|
|
|
DEFINE_NFS_READDIR_EVENT(nfs_readdir_cache_fill);
|
|
|
|
DEFINE_NFS_READDIR_EVENT(nfs_readdir_uncached);
|
|
|
|
|
2013-08-20 15:26:17 +00:00
|
|
|
DECLARE_EVENT_CLASS(nfs_lookup_event,
|
|
|
|
TP_PROTO(
|
|
|
|
const struct inode *dir,
|
|
|
|
const struct dentry *dentry,
|
|
|
|
unsigned int flags
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_ARGS(dir, dentry, flags),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
2019-06-19 14:34:03 +00:00
|
|
|
__field(unsigned long, flags)
|
2013-08-20 15:26:17 +00:00
|
|
|
__field(dev_t, dev)
|
|
|
|
__field(u64, dir)
|
|
|
|
__string(name, dentry->d_name.name)
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
__entry->dev = dir->i_sb->s_dev;
|
|
|
|
__entry->dir = NFS_FILEID(dir);
|
|
|
|
__entry->flags = flags;
|
|
|
|
__assign_str(name, dentry->d_name.name);
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk(
|
2019-06-19 14:34:03 +00:00
|
|
|
"flags=0x%lx (%s) name=%02x:%02x:%llu/%s",
|
2013-08-20 15:26:17 +00:00
|
|
|
__entry->flags,
|
2021-10-22 20:16:56 +00:00
|
|
|
show_fs_lookup_flags(__entry->flags),
|
2013-08-20 15:26:17 +00:00
|
|
|
MAJOR(__entry->dev), MINOR(__entry->dev),
|
|
|
|
(unsigned long long)__entry->dir,
|
|
|
|
__get_str(name)
|
|
|
|
)
|
|
|
|
);
|
|
|
|
|
|
|
|
#define DEFINE_NFS_LOOKUP_EVENT(name) \
|
|
|
|
DEFINE_EVENT(nfs_lookup_event, name, \
|
|
|
|
TP_PROTO( \
|
|
|
|
const struct inode *dir, \
|
|
|
|
const struct dentry *dentry, \
|
|
|
|
unsigned int flags \
|
|
|
|
), \
|
|
|
|
TP_ARGS(dir, dentry, flags))
|
|
|
|
|
|
|
|
DECLARE_EVENT_CLASS(nfs_lookup_event_done,
|
|
|
|
TP_PROTO(
|
|
|
|
const struct inode *dir,
|
|
|
|
const struct dentry *dentry,
|
|
|
|
unsigned int flags,
|
|
|
|
int error
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_ARGS(dir, dentry, flags, error),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
2019-06-19 14:33:58 +00:00
|
|
|
__field(unsigned long, error)
|
2019-06-19 14:34:03 +00:00
|
|
|
__field(unsigned long, flags)
|
2013-08-20 15:26:17 +00:00
|
|
|
__field(dev_t, dev)
|
|
|
|
__field(u64, dir)
|
|
|
|
__string(name, dentry->d_name.name)
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
__entry->dev = dir->i_sb->s_dev;
|
|
|
|
__entry->dir = NFS_FILEID(dir);
|
2019-06-19 14:33:58 +00:00
|
|
|
__entry->error = error < 0 ? -error : 0;
|
2013-08-20 15:26:17 +00:00
|
|
|
__entry->flags = flags;
|
|
|
|
__assign_str(name, dentry->d_name.name);
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk(
|
2019-06-19 14:34:03 +00:00
|
|
|
"error=%ld (%s) flags=0x%lx (%s) name=%02x:%02x:%llu/%s",
|
2021-10-22 20:17:03 +00:00
|
|
|
-__entry->error, show_nfs_status(__entry->error),
|
2013-08-20 15:26:17 +00:00
|
|
|
__entry->flags,
|
2021-10-22 20:16:56 +00:00
|
|
|
show_fs_lookup_flags(__entry->flags),
|
2013-08-20 15:26:17 +00:00
|
|
|
MAJOR(__entry->dev), MINOR(__entry->dev),
|
|
|
|
(unsigned long long)__entry->dir,
|
|
|
|
__get_str(name)
|
|
|
|
)
|
|
|
|
);
|
|
|
|
|
|
|
|
#define DEFINE_NFS_LOOKUP_EVENT_DONE(name) \
|
|
|
|
DEFINE_EVENT(nfs_lookup_event_done, name, \
|
|
|
|
TP_PROTO( \
|
|
|
|
const struct inode *dir, \
|
|
|
|
const struct dentry *dentry, \
|
|
|
|
unsigned int flags, \
|
|
|
|
int error \
|
|
|
|
), \
|
|
|
|
TP_ARGS(dir, dentry, flags, error))
|
|
|
|
|
|
|
|
DEFINE_NFS_LOOKUP_EVENT(nfs_lookup_enter);
|
|
|
|
DEFINE_NFS_LOOKUP_EVENT_DONE(nfs_lookup_exit);
|
|
|
|
DEFINE_NFS_LOOKUP_EVENT(nfs_lookup_revalidate_enter);
|
|
|
|
DEFINE_NFS_LOOKUP_EVENT_DONE(nfs_lookup_revalidate_exit);
|
2022-02-20 00:19:35 +00:00
|
|
|
DEFINE_NFS_LOOKUP_EVENT(nfs_readdir_lookup);
|
|
|
|
DEFINE_NFS_LOOKUP_EVENT(nfs_readdir_lookup_revalidate_failed);
|
|
|
|
DEFINE_NFS_LOOKUP_EVENT_DONE(nfs_readdir_lookup_revalidate);
|
2013-08-20 15:26:17 +00:00
|
|
|
|
|
|
|
TRACE_EVENT(nfs_atomic_open_enter,
|
|
|
|
TP_PROTO(
|
|
|
|
const struct inode *dir,
|
|
|
|
const struct nfs_open_context *ctx,
|
|
|
|
unsigned int flags
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_ARGS(dir, ctx, flags),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
2019-06-19 14:34:03 +00:00
|
|
|
__field(unsigned long, flags)
|
2021-10-22 20:16:56 +00:00
|
|
|
__field(unsigned long, fmode)
|
2013-08-20 15:26:17 +00:00
|
|
|
__field(dev_t, dev)
|
|
|
|
__field(u64, dir)
|
|
|
|
__string(name, ctx->dentry->d_name.name)
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
__entry->dev = dir->i_sb->s_dev;
|
|
|
|
__entry->dir = NFS_FILEID(dir);
|
|
|
|
__entry->flags = flags;
|
2021-10-22 20:16:56 +00:00
|
|
|
__entry->fmode = (__force unsigned long)ctx->mode;
|
2013-08-20 15:26:17 +00:00
|
|
|
__assign_str(name, ctx->dentry->d_name.name);
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk(
|
2019-06-19 14:34:03 +00:00
|
|
|
"flags=0x%lx (%s) fmode=%s name=%02x:%02x:%llu/%s",
|
2013-08-20 15:26:17 +00:00
|
|
|
__entry->flags,
|
2021-10-22 20:16:56 +00:00
|
|
|
show_fs_fcntl_open_flags(__entry->flags),
|
|
|
|
show_fs_fmode_flags(__entry->fmode),
|
2013-08-20 15:26:17 +00:00
|
|
|
MAJOR(__entry->dev), MINOR(__entry->dev),
|
|
|
|
(unsigned long long)__entry->dir,
|
|
|
|
__get_str(name)
|
|
|
|
)
|
|
|
|
);
|
|
|
|
|
|
|
|
TRACE_EVENT(nfs_atomic_open_exit,
|
|
|
|
TP_PROTO(
|
|
|
|
const struct inode *dir,
|
|
|
|
const struct nfs_open_context *ctx,
|
|
|
|
unsigned int flags,
|
|
|
|
int error
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_ARGS(dir, ctx, flags, error),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
2019-06-19 14:33:58 +00:00
|
|
|
__field(unsigned long, error)
|
2019-06-19 14:34:03 +00:00
|
|
|
__field(unsigned long, flags)
|
2021-10-22 20:16:56 +00:00
|
|
|
__field(unsigned long, fmode)
|
2013-08-20 15:26:17 +00:00
|
|
|
__field(dev_t, dev)
|
|
|
|
__field(u64, dir)
|
|
|
|
__string(name, ctx->dentry->d_name.name)
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
2019-06-19 14:33:58 +00:00
|
|
|
__entry->error = -error;
|
2013-08-20 15:26:17 +00:00
|
|
|
__entry->dev = dir->i_sb->s_dev;
|
|
|
|
__entry->dir = NFS_FILEID(dir);
|
|
|
|
__entry->flags = flags;
|
2021-10-22 20:16:56 +00:00
|
|
|
__entry->fmode = (__force unsigned long)ctx->mode;
|
2013-08-20 15:26:17 +00:00
|
|
|
__assign_str(name, ctx->dentry->d_name.name);
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk(
|
2019-06-19 14:34:03 +00:00
|
|
|
"error=%ld (%s) flags=0x%lx (%s) fmode=%s "
|
2013-08-20 15:26:17 +00:00
|
|
|
"name=%02x:%02x:%llu/%s",
|
2021-10-22 20:17:03 +00:00
|
|
|
-__entry->error, show_nfs_status(__entry->error),
|
2013-08-20 15:26:17 +00:00
|
|
|
__entry->flags,
|
2021-10-22 20:16:56 +00:00
|
|
|
show_fs_fcntl_open_flags(__entry->flags),
|
|
|
|
show_fs_fmode_flags(__entry->fmode),
|
2013-08-20 15:26:17 +00:00
|
|
|
MAJOR(__entry->dev), MINOR(__entry->dev),
|
|
|
|
(unsigned long long)__entry->dir,
|
|
|
|
__get_str(name)
|
|
|
|
)
|
|
|
|
);
|
|
|
|
|
2013-08-21 14:53:09 +00:00
|
|
|
TRACE_EVENT(nfs_create_enter,
|
|
|
|
TP_PROTO(
|
|
|
|
const struct inode *dir,
|
|
|
|
const struct dentry *dentry,
|
|
|
|
unsigned int flags
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_ARGS(dir, dentry, flags),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
2019-06-19 14:34:03 +00:00
|
|
|
__field(unsigned long, flags)
|
2013-08-21 14:53:09 +00:00
|
|
|
__field(dev_t, dev)
|
|
|
|
__field(u64, dir)
|
|
|
|
__string(name, dentry->d_name.name)
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
__entry->dev = dir->i_sb->s_dev;
|
|
|
|
__entry->dir = NFS_FILEID(dir);
|
|
|
|
__entry->flags = flags;
|
|
|
|
__assign_str(name, dentry->d_name.name);
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk(
|
2019-06-19 14:34:03 +00:00
|
|
|
"flags=0x%lx (%s) name=%02x:%02x:%llu/%s",
|
2013-08-21 14:53:09 +00:00
|
|
|
__entry->flags,
|
2021-10-22 20:16:56 +00:00
|
|
|
show_fs_fcntl_open_flags(__entry->flags),
|
2013-08-21 14:53:09 +00:00
|
|
|
MAJOR(__entry->dev), MINOR(__entry->dev),
|
|
|
|
(unsigned long long)__entry->dir,
|
|
|
|
__get_str(name)
|
|
|
|
)
|
|
|
|
);
|
|
|
|
|
|
|
|
TRACE_EVENT(nfs_create_exit,
|
|
|
|
TP_PROTO(
|
|
|
|
const struct inode *dir,
|
|
|
|
const struct dentry *dentry,
|
|
|
|
unsigned int flags,
|
|
|
|
int error
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_ARGS(dir, dentry, flags, error),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
2019-06-19 14:33:58 +00:00
|
|
|
__field(unsigned long, error)
|
2019-06-19 14:34:03 +00:00
|
|
|
__field(unsigned long, flags)
|
2013-08-21 14:53:09 +00:00
|
|
|
__field(dev_t, dev)
|
|
|
|
__field(u64, dir)
|
|
|
|
__string(name, dentry->d_name.name)
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
2019-06-19 14:33:58 +00:00
|
|
|
__entry->error = -error;
|
2013-08-21 14:53:09 +00:00
|
|
|
__entry->dev = dir->i_sb->s_dev;
|
|
|
|
__entry->dir = NFS_FILEID(dir);
|
|
|
|
__entry->flags = flags;
|
|
|
|
__assign_str(name, dentry->d_name.name);
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk(
|
2019-06-19 14:34:03 +00:00
|
|
|
"error=%ld (%s) flags=0x%lx (%s) name=%02x:%02x:%llu/%s",
|
2021-10-22 20:17:03 +00:00
|
|
|
-__entry->error, show_nfs_status(__entry->error),
|
2013-08-21 14:53:09 +00:00
|
|
|
__entry->flags,
|
2021-10-22 20:16:56 +00:00
|
|
|
show_fs_fcntl_open_flags(__entry->flags),
|
2013-08-21 14:53:09 +00:00
|
|
|
MAJOR(__entry->dev), MINOR(__entry->dev),
|
|
|
|
(unsigned long long)__entry->dir,
|
|
|
|
__get_str(name)
|
|
|
|
)
|
|
|
|
);
|
|
|
|
|
2013-08-21 16:36:04 +00:00
|
|
|
DECLARE_EVENT_CLASS(nfs_directory_event,
|
|
|
|
TP_PROTO(
|
|
|
|
const struct inode *dir,
|
|
|
|
const struct dentry *dentry
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_ARGS(dir, dentry),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__field(dev_t, dev)
|
|
|
|
__field(u64, dir)
|
|
|
|
__string(name, dentry->d_name.name)
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
__entry->dev = dir->i_sb->s_dev;
|
|
|
|
__entry->dir = NFS_FILEID(dir);
|
|
|
|
__assign_str(name, dentry->d_name.name);
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk(
|
|
|
|
"name=%02x:%02x:%llu/%s",
|
|
|
|
MAJOR(__entry->dev), MINOR(__entry->dev),
|
|
|
|
(unsigned long long)__entry->dir,
|
|
|
|
__get_str(name)
|
|
|
|
)
|
|
|
|
);
|
|
|
|
|
|
|
|
#define DEFINE_NFS_DIRECTORY_EVENT(name) \
|
|
|
|
DEFINE_EVENT(nfs_directory_event, name, \
|
|
|
|
TP_PROTO( \
|
|
|
|
const struct inode *dir, \
|
|
|
|
const struct dentry *dentry \
|
|
|
|
), \
|
|
|
|
TP_ARGS(dir, dentry))
|
|
|
|
|
|
|
|
DECLARE_EVENT_CLASS(nfs_directory_event_done,
|
|
|
|
TP_PROTO(
|
|
|
|
const struct inode *dir,
|
|
|
|
const struct dentry *dentry,
|
|
|
|
int error
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_ARGS(dir, dentry, error),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
2019-06-19 14:33:58 +00:00
|
|
|
__field(unsigned long, error)
|
2013-08-21 16:36:04 +00:00
|
|
|
__field(dev_t, dev)
|
|
|
|
__field(u64, dir)
|
|
|
|
__string(name, dentry->d_name.name)
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
__entry->dev = dir->i_sb->s_dev;
|
|
|
|
__entry->dir = NFS_FILEID(dir);
|
2019-06-19 14:33:58 +00:00
|
|
|
__entry->error = error < 0 ? -error : 0;
|
2013-08-21 16:36:04 +00:00
|
|
|
__assign_str(name, dentry->d_name.name);
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk(
|
2019-06-19 14:33:58 +00:00
|
|
|
"error=%ld (%s) name=%02x:%02x:%llu/%s",
|
2021-10-22 20:17:03 +00:00
|
|
|
-__entry->error, show_nfs_status(__entry->error),
|
2013-08-21 16:36:04 +00:00
|
|
|
MAJOR(__entry->dev), MINOR(__entry->dev),
|
|
|
|
(unsigned long long)__entry->dir,
|
|
|
|
__get_str(name)
|
|
|
|
)
|
|
|
|
);
|
|
|
|
|
|
|
|
#define DEFINE_NFS_DIRECTORY_EVENT_DONE(name) \
|
|
|
|
DEFINE_EVENT(nfs_directory_event_done, name, \
|
|
|
|
TP_PROTO( \
|
|
|
|
const struct inode *dir, \
|
|
|
|
const struct dentry *dentry, \
|
|
|
|
int error \
|
|
|
|
), \
|
|
|
|
TP_ARGS(dir, dentry, error))
|
|
|
|
|
|
|
|
DEFINE_NFS_DIRECTORY_EVENT(nfs_mknod_enter);
|
|
|
|
DEFINE_NFS_DIRECTORY_EVENT_DONE(nfs_mknod_exit);
|
|
|
|
DEFINE_NFS_DIRECTORY_EVENT(nfs_mkdir_enter);
|
|
|
|
DEFINE_NFS_DIRECTORY_EVENT_DONE(nfs_mkdir_exit);
|
|
|
|
DEFINE_NFS_DIRECTORY_EVENT(nfs_rmdir_enter);
|
|
|
|
DEFINE_NFS_DIRECTORY_EVENT_DONE(nfs_rmdir_exit);
|
|
|
|
DEFINE_NFS_DIRECTORY_EVENT(nfs_remove_enter);
|
|
|
|
DEFINE_NFS_DIRECTORY_EVENT_DONE(nfs_remove_exit);
|
|
|
|
DEFINE_NFS_DIRECTORY_EVENT(nfs_unlink_enter);
|
|
|
|
DEFINE_NFS_DIRECTORY_EVENT_DONE(nfs_unlink_exit);
|
|
|
|
DEFINE_NFS_DIRECTORY_EVENT(nfs_symlink_enter);
|
|
|
|
DEFINE_NFS_DIRECTORY_EVENT_DONE(nfs_symlink_exit);
|
|
|
|
|
2013-08-21 17:54:44 +00:00
|
|
|
TRACE_EVENT(nfs_link_enter,
|
|
|
|
TP_PROTO(
|
|
|
|
const struct inode *inode,
|
|
|
|
const struct inode *dir,
|
|
|
|
const struct dentry *dentry
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_ARGS(inode, dir, dentry),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__field(dev_t, dev)
|
|
|
|
__field(u64, fileid)
|
|
|
|
__field(u64, dir)
|
|
|
|
__string(name, dentry->d_name.name)
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
__entry->dev = inode->i_sb->s_dev;
|
|
|
|
__entry->fileid = NFS_FILEID(inode);
|
|
|
|
__entry->dir = NFS_FILEID(dir);
|
|
|
|
__assign_str(name, dentry->d_name.name);
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk(
|
|
|
|
"fileid=%02x:%02x:%llu name=%02x:%02x:%llu/%s",
|
|
|
|
MAJOR(__entry->dev), MINOR(__entry->dev),
|
|
|
|
__entry->fileid,
|
|
|
|
MAJOR(__entry->dev), MINOR(__entry->dev),
|
|
|
|
(unsigned long long)__entry->dir,
|
|
|
|
__get_str(name)
|
|
|
|
)
|
|
|
|
);
|
|
|
|
|
|
|
|
TRACE_EVENT(nfs_link_exit,
|
|
|
|
TP_PROTO(
|
|
|
|
const struct inode *inode,
|
|
|
|
const struct inode *dir,
|
|
|
|
const struct dentry *dentry,
|
|
|
|
int error
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_ARGS(inode, dir, dentry, error),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
2019-06-19 14:33:58 +00:00
|
|
|
__field(unsigned long, error)
|
2013-08-21 17:54:44 +00:00
|
|
|
__field(dev_t, dev)
|
|
|
|
__field(u64, fileid)
|
|
|
|
__field(u64, dir)
|
|
|
|
__string(name, dentry->d_name.name)
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
__entry->dev = inode->i_sb->s_dev;
|
|
|
|
__entry->fileid = NFS_FILEID(inode);
|
|
|
|
__entry->dir = NFS_FILEID(dir);
|
2019-06-19 14:33:58 +00:00
|
|
|
__entry->error = error < 0 ? -error : 0;
|
2013-08-21 17:54:44 +00:00
|
|
|
__assign_str(name, dentry->d_name.name);
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk(
|
2019-06-19 14:33:58 +00:00
|
|
|
"error=%ld (%s) fileid=%02x:%02x:%llu name=%02x:%02x:%llu/%s",
|
2021-10-22 20:17:03 +00:00
|
|
|
-__entry->error, show_nfs_status(__entry->error),
|
2013-08-21 17:54:44 +00:00
|
|
|
MAJOR(__entry->dev), MINOR(__entry->dev),
|
|
|
|
__entry->fileid,
|
|
|
|
MAJOR(__entry->dev), MINOR(__entry->dev),
|
|
|
|
(unsigned long long)__entry->dir,
|
|
|
|
__get_str(name)
|
|
|
|
)
|
|
|
|
);
|
|
|
|
|
2013-08-21 16:08:45 +00:00
|
|
|
DECLARE_EVENT_CLASS(nfs_rename_event,
|
|
|
|
TP_PROTO(
|
|
|
|
const struct inode *old_dir,
|
|
|
|
const struct dentry *old_dentry,
|
|
|
|
const struct inode *new_dir,
|
|
|
|
const struct dentry *new_dentry
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_ARGS(old_dir, old_dentry, new_dir, new_dentry),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__field(dev_t, dev)
|
|
|
|
__field(u64, old_dir)
|
|
|
|
__field(u64, new_dir)
|
|
|
|
__string(old_name, old_dentry->d_name.name)
|
|
|
|
__string(new_name, new_dentry->d_name.name)
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
__entry->dev = old_dir->i_sb->s_dev;
|
|
|
|
__entry->old_dir = NFS_FILEID(old_dir);
|
|
|
|
__entry->new_dir = NFS_FILEID(new_dir);
|
|
|
|
__assign_str(old_name, old_dentry->d_name.name);
|
|
|
|
__assign_str(new_name, new_dentry->d_name.name);
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk(
|
|
|
|
"old_name=%02x:%02x:%llu/%s new_name=%02x:%02x:%llu/%s",
|
|
|
|
MAJOR(__entry->dev), MINOR(__entry->dev),
|
|
|
|
(unsigned long long)__entry->old_dir,
|
|
|
|
__get_str(old_name),
|
|
|
|
MAJOR(__entry->dev), MINOR(__entry->dev),
|
|
|
|
(unsigned long long)__entry->new_dir,
|
|
|
|
__get_str(new_name)
|
|
|
|
)
|
|
|
|
);
|
|
|
|
#define DEFINE_NFS_RENAME_EVENT(name) \
|
|
|
|
DEFINE_EVENT(nfs_rename_event, name, \
|
|
|
|
TP_PROTO( \
|
|
|
|
const struct inode *old_dir, \
|
|
|
|
const struct dentry *old_dentry, \
|
|
|
|
const struct inode *new_dir, \
|
|
|
|
const struct dentry *new_dentry \
|
|
|
|
), \
|
|
|
|
TP_ARGS(old_dir, old_dentry, new_dir, new_dentry))
|
|
|
|
|
|
|
|
DECLARE_EVENT_CLASS(nfs_rename_event_done,
|
|
|
|
TP_PROTO(
|
|
|
|
const struct inode *old_dir,
|
|
|
|
const struct dentry *old_dentry,
|
|
|
|
const struct inode *new_dir,
|
|
|
|
const struct dentry *new_dentry,
|
|
|
|
int error
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_ARGS(old_dir, old_dentry, new_dir, new_dentry, error),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__field(dev_t, dev)
|
2019-06-19 14:33:58 +00:00
|
|
|
__field(unsigned long, error)
|
2013-08-21 16:08:45 +00:00
|
|
|
__field(u64, old_dir)
|
|
|
|
__string(old_name, old_dentry->d_name.name)
|
|
|
|
__field(u64, new_dir)
|
|
|
|
__string(new_name, new_dentry->d_name.name)
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
__entry->dev = old_dir->i_sb->s_dev;
|
2019-06-19 14:33:58 +00:00
|
|
|
__entry->error = -error;
|
2013-08-21 16:08:45 +00:00
|
|
|
__entry->old_dir = NFS_FILEID(old_dir);
|
|
|
|
__entry->new_dir = NFS_FILEID(new_dir);
|
|
|
|
__assign_str(old_name, old_dentry->d_name.name);
|
|
|
|
__assign_str(new_name, new_dentry->d_name.name);
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk(
|
2019-06-19 14:33:58 +00:00
|
|
|
"error=%ld (%s) old_name=%02x:%02x:%llu/%s "
|
2013-08-21 16:08:45 +00:00
|
|
|
"new_name=%02x:%02x:%llu/%s",
|
2021-10-22 20:17:03 +00:00
|
|
|
-__entry->error, show_nfs_status(__entry->error),
|
2013-08-21 16:08:45 +00:00
|
|
|
MAJOR(__entry->dev), MINOR(__entry->dev),
|
|
|
|
(unsigned long long)__entry->old_dir,
|
|
|
|
__get_str(old_name),
|
|
|
|
MAJOR(__entry->dev), MINOR(__entry->dev),
|
|
|
|
(unsigned long long)__entry->new_dir,
|
|
|
|
__get_str(new_name)
|
|
|
|
)
|
|
|
|
);
|
|
|
|
#define DEFINE_NFS_RENAME_EVENT_DONE(name) \
|
|
|
|
DEFINE_EVENT(nfs_rename_event_done, name, \
|
|
|
|
TP_PROTO( \
|
|
|
|
const struct inode *old_dir, \
|
|
|
|
const struct dentry *old_dentry, \
|
|
|
|
const struct inode *new_dir, \
|
|
|
|
const struct dentry *new_dentry, \
|
|
|
|
int error \
|
|
|
|
), \
|
|
|
|
TP_ARGS(old_dir, old_dentry, new_dir, \
|
|
|
|
new_dentry, error))
|
|
|
|
|
|
|
|
DEFINE_NFS_RENAME_EVENT(nfs_rename_enter);
|
|
|
|
DEFINE_NFS_RENAME_EVENT_DONE(nfs_rename_exit);
|
|
|
|
|
|
|
|
DEFINE_NFS_RENAME_EVENT_DONE(nfs_sillyrename_rename);
|
|
|
|
|
|
|
|
TRACE_EVENT(nfs_sillyrename_unlink,
|
|
|
|
TP_PROTO(
|
|
|
|
const struct nfs_unlinkdata *data,
|
|
|
|
int error
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_ARGS(data, error),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__field(dev_t, dev)
|
2019-06-19 14:33:58 +00:00
|
|
|
__field(unsigned long, error)
|
2013-08-21 16:08:45 +00:00
|
|
|
__field(u64, dir)
|
|
|
|
__dynamic_array(char, name, data->args.name.len + 1)
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
2016-04-29 03:56:31 +00:00
|
|
|
struct inode *dir = d_inode(data->dentry->d_parent);
|
2013-08-21 16:08:45 +00:00
|
|
|
size_t len = data->args.name.len;
|
|
|
|
__entry->dev = dir->i_sb->s_dev;
|
|
|
|
__entry->dir = NFS_FILEID(dir);
|
2019-06-19 14:33:58 +00:00
|
|
|
__entry->error = -error;
|
2016-07-01 23:44:36 +00:00
|
|
|
memcpy(__get_str(name),
|
2013-08-21 16:08:45 +00:00
|
|
|
data->args.name.name, len);
|
2016-07-01 23:44:36 +00:00
|
|
|
__get_str(name)[len] = 0;
|
2013-08-21 16:08:45 +00:00
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk(
|
2019-06-19 14:33:58 +00:00
|
|
|
"error=%ld (%s) name=%02x:%02x:%llu/%s",
|
2021-10-22 20:17:03 +00:00
|
|
|
-__entry->error, show_nfs_status(__entry->error),
|
2013-08-21 16:08:45 +00:00
|
|
|
MAJOR(__entry->dev), MINOR(__entry->dev),
|
|
|
|
(unsigned long long)__entry->dir,
|
|
|
|
__get_str(name)
|
|
|
|
)
|
|
|
|
);
|
2017-08-21 19:00:49 +00:00
|
|
|
|
2023-01-19 21:33:49 +00:00
|
|
|
DECLARE_EVENT_CLASS(nfs_folio_event,
|
2021-10-16 22:02:51 +00:00
|
|
|
TP_PROTO(
|
|
|
|
const struct inode *inode,
|
2023-01-19 21:33:41 +00:00
|
|
|
struct folio *folio
|
2021-10-16 22:02:51 +00:00
|
|
|
),
|
|
|
|
|
2023-01-19 21:33:41 +00:00
|
|
|
TP_ARGS(inode, folio),
|
2021-10-16 22:02:51 +00:00
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__field(dev_t, dev)
|
|
|
|
__field(u32, fhandle)
|
|
|
|
__field(u64, fileid)
|
|
|
|
__field(u64, version)
|
|
|
|
__field(loff_t, offset)
|
2023-01-19 21:33:49 +00:00
|
|
|
__field(u32, count)
|
2021-10-16 22:02:51 +00:00
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
const struct nfs_inode *nfsi = NFS_I(inode);
|
|
|
|
|
|
|
|
__entry->dev = inode->i_sb->s_dev;
|
|
|
|
__entry->fileid = nfsi->fileid;
|
|
|
|
__entry->fhandle = nfs_fhandle_hash(&nfsi->fh);
|
|
|
|
__entry->version = inode_peek_iversion_raw(inode);
|
2023-01-19 21:33:41 +00:00
|
|
|
__entry->offset = folio_file_pos(folio);
|
2023-01-19 21:33:49 +00:00
|
|
|
__entry->count = nfs_folio_length(folio);
|
2021-10-16 22:02:51 +00:00
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk(
|
2023-01-19 21:33:49 +00:00
|
|
|
"fileid=%02x:%02x:%llu fhandle=0x%08x version=%llu "
|
|
|
|
"offset=%lld count=%u",
|
2021-10-16 22:02:51 +00:00
|
|
|
MAJOR(__entry->dev), MINOR(__entry->dev),
|
|
|
|
(unsigned long long)__entry->fileid,
|
|
|
|
__entry->fhandle, __entry->version,
|
2023-01-19 21:33:49 +00:00
|
|
|
__entry->offset, __entry->count
|
2021-10-16 22:02:51 +00:00
|
|
|
)
|
|
|
|
);
|
|
|
|
|
2023-01-19 21:33:49 +00:00
|
|
|
#define DEFINE_NFS_FOLIO_EVENT(name) \
|
|
|
|
DEFINE_EVENT(nfs_folio_event, name, \
|
|
|
|
TP_PROTO( \
|
|
|
|
const struct inode *inode, \
|
|
|
|
struct folio *folio \
|
|
|
|
), \
|
|
|
|
TP_ARGS(inode, folio))
|
|
|
|
|
|
|
|
DECLARE_EVENT_CLASS(nfs_folio_event_done,
|
2021-10-16 22:02:51 +00:00
|
|
|
TP_PROTO(
|
|
|
|
const struct inode *inode,
|
2023-01-19 21:33:41 +00:00
|
|
|
struct folio *folio,
|
2021-10-16 22:02:51 +00:00
|
|
|
int ret
|
|
|
|
),
|
|
|
|
|
2023-01-19 21:33:41 +00:00
|
|
|
TP_ARGS(inode, folio, ret),
|
2021-10-16 22:02:51 +00:00
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__field(dev_t, dev)
|
|
|
|
__field(u32, fhandle)
|
|
|
|
__field(int, ret)
|
|
|
|
__field(u64, fileid)
|
|
|
|
__field(u64, version)
|
|
|
|
__field(loff_t, offset)
|
2023-01-19 21:33:49 +00:00
|
|
|
__field(u32, count)
|
2021-10-16 22:02:51 +00:00
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
const struct nfs_inode *nfsi = NFS_I(inode);
|
|
|
|
|
|
|
|
__entry->dev = inode->i_sb->s_dev;
|
|
|
|
__entry->fileid = nfsi->fileid;
|
|
|
|
__entry->fhandle = nfs_fhandle_hash(&nfsi->fh);
|
|
|
|
__entry->version = inode_peek_iversion_raw(inode);
|
2023-01-19 21:33:41 +00:00
|
|
|
__entry->offset = folio_file_pos(folio);
|
2023-01-19 21:33:49 +00:00
|
|
|
__entry->count = nfs_folio_length(folio);
|
2021-10-16 22:02:51 +00:00
|
|
|
__entry->ret = ret;
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk(
|
2023-01-19 21:33:49 +00:00
|
|
|
"fileid=%02x:%02x:%llu fhandle=0x%08x version=%llu "
|
|
|
|
"offset=%lld count=%u ret=%d",
|
2021-10-16 22:02:51 +00:00
|
|
|
MAJOR(__entry->dev), MINOR(__entry->dev),
|
|
|
|
(unsigned long long)__entry->fileid,
|
|
|
|
__entry->fhandle, __entry->version,
|
2023-01-19 21:33:49 +00:00
|
|
|
__entry->offset, __entry->count, __entry->ret
|
2021-10-16 22:02:51 +00:00
|
|
|
)
|
|
|
|
);
|
|
|
|
|
2023-01-19 21:33:49 +00:00
|
|
|
#define DEFINE_NFS_FOLIO_EVENT_DONE(name) \
|
|
|
|
DEFINE_EVENT(nfs_folio_event_done, name, \
|
|
|
|
TP_PROTO( \
|
|
|
|
const struct inode *inode, \
|
|
|
|
struct folio *folio, \
|
|
|
|
int ret \
|
|
|
|
), \
|
|
|
|
TP_ARGS(inode, folio, ret))
|
|
|
|
|
|
|
|
DEFINE_NFS_FOLIO_EVENT(nfs_aop_readpage);
|
|
|
|
DEFINE_NFS_FOLIO_EVENT_DONE(nfs_aop_readpage_done);
|
|
|
|
|
2023-01-19 21:33:50 +00:00
|
|
|
DEFINE_NFS_FOLIO_EVENT(nfs_writeback_folio);
|
|
|
|
DEFINE_NFS_FOLIO_EVENT_DONE(nfs_writeback_folio_done);
|
|
|
|
|
2023-01-19 21:33:49 +00:00
|
|
|
DEFINE_NFS_FOLIO_EVENT(nfs_invalidate_folio);
|
|
|
|
DEFINE_NFS_FOLIO_EVENT_DONE(nfs_launder_folio_done);
|
|
|
|
|
2021-10-16 22:02:51 +00:00
|
|
|
TRACE_EVENT(nfs_aop_readahead,
|
|
|
|
TP_PROTO(
|
|
|
|
const struct inode *inode,
|
2022-01-22 20:54:52 +00:00
|
|
|
loff_t pos,
|
2021-10-16 22:02:51 +00:00
|
|
|
unsigned int nr_pages
|
|
|
|
),
|
|
|
|
|
2022-01-22 20:54:52 +00:00
|
|
|
TP_ARGS(inode, pos, nr_pages),
|
2021-10-16 22:02:51 +00:00
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__field(dev_t, dev)
|
|
|
|
__field(u32, fhandle)
|
|
|
|
__field(u64, fileid)
|
|
|
|
__field(u64, version)
|
2021-11-02 19:51:55 +00:00
|
|
|
__field(loff_t, offset)
|
2021-10-16 22:02:51 +00:00
|
|
|
__field(unsigned int, nr_pages)
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
const struct nfs_inode *nfsi = NFS_I(inode);
|
|
|
|
|
|
|
|
__entry->dev = inode->i_sb->s_dev;
|
|
|
|
__entry->fileid = nfsi->fileid;
|
|
|
|
__entry->fhandle = nfs_fhandle_hash(&nfsi->fh);
|
|
|
|
__entry->version = inode_peek_iversion_raw(inode);
|
2022-01-22 20:54:52 +00:00
|
|
|
__entry->offset = pos;
|
2021-10-16 22:02:51 +00:00
|
|
|
__entry->nr_pages = nr_pages;
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk(
|
2021-11-02 19:51:55 +00:00
|
|
|
"fileid=%02x:%02x:%llu fhandle=0x%08x version=%llu offset=%lld nr_pages=%u",
|
2021-10-16 22:02:51 +00:00
|
|
|
MAJOR(__entry->dev), MINOR(__entry->dev),
|
|
|
|
(unsigned long long)__entry->fileid,
|
|
|
|
__entry->fhandle, __entry->version,
|
2021-11-02 19:51:55 +00:00
|
|
|
__entry->offset, __entry->nr_pages
|
2021-10-16 22:02:51 +00:00
|
|
|
)
|
|
|
|
);
|
|
|
|
|
|
|
|
TRACE_EVENT(nfs_aop_readahead_done,
|
|
|
|
TP_PROTO(
|
|
|
|
const struct inode *inode,
|
|
|
|
unsigned int nr_pages,
|
|
|
|
int ret
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_ARGS(inode, nr_pages, ret),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__field(dev_t, dev)
|
|
|
|
__field(u32, fhandle)
|
|
|
|
__field(int, ret)
|
|
|
|
__field(u64, fileid)
|
|
|
|
__field(u64, version)
|
2021-11-02 19:51:55 +00:00
|
|
|
__field(loff_t, offset)
|
2021-10-16 22:02:51 +00:00
|
|
|
__field(unsigned int, nr_pages)
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
const struct nfs_inode *nfsi = NFS_I(inode);
|
|
|
|
|
|
|
|
__entry->dev = inode->i_sb->s_dev;
|
|
|
|
__entry->fileid = nfsi->fileid;
|
|
|
|
__entry->fhandle = nfs_fhandle_hash(&nfsi->fh);
|
|
|
|
__entry->version = inode_peek_iversion_raw(inode);
|
|
|
|
__entry->nr_pages = nr_pages;
|
|
|
|
__entry->ret = ret;
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk(
|
|
|
|
"fileid=%02x:%02x:%llu fhandle=0x%08x version=%llu nr_pages=%u ret=%d",
|
|
|
|
MAJOR(__entry->dev), MINOR(__entry->dev),
|
|
|
|
(unsigned long long)__entry->fileid,
|
|
|
|
__entry->fhandle, __entry->version,
|
|
|
|
__entry->nr_pages, __entry->ret
|
|
|
|
)
|
|
|
|
);
|
|
|
|
|
2017-08-21 19:00:49 +00:00
|
|
|
TRACE_EVENT(nfs_initiate_read,
|
|
|
|
TP_PROTO(
|
2020-01-06 20:25:08 +00:00
|
|
|
const struct nfs_pgio_header *hdr
|
2017-08-21 19:00:49 +00:00
|
|
|
),
|
|
|
|
|
2020-01-06 20:25:08 +00:00
|
|
|
TP_ARGS(hdr),
|
2017-08-21 19:00:49 +00:00
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__field(dev_t, dev)
|
|
|
|
__field(u32, fhandle)
|
|
|
|
__field(u64, fileid)
|
2020-01-06 20:25:08 +00:00
|
|
|
__field(loff_t, offset)
|
|
|
|
__field(u32, count)
|
2017-08-21 19:00:49 +00:00
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
2020-01-06 20:25:08 +00:00
|
|
|
const struct inode *inode = hdr->inode;
|
2017-08-21 19:00:49 +00:00
|
|
|
const struct nfs_inode *nfsi = NFS_I(inode);
|
2020-01-06 20:25:08 +00:00
|
|
|
const struct nfs_fh *fh = hdr->args.fh ?
|
|
|
|
hdr->args.fh : &nfsi->fh;
|
2017-08-21 19:00:49 +00:00
|
|
|
|
2020-01-06 20:25:08 +00:00
|
|
|
__entry->offset = hdr->args.offset;
|
|
|
|
__entry->count = hdr->args.count;
|
2017-08-21 19:00:49 +00:00
|
|
|
__entry->dev = inode->i_sb->s_dev;
|
|
|
|
__entry->fileid = nfsi->fileid;
|
2020-01-06 20:25:08 +00:00
|
|
|
__entry->fhandle = nfs_fhandle_hash(fh);
|
2017-08-21 19:00:49 +00:00
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk(
|
|
|
|
"fileid=%02x:%02x:%llu fhandle=0x%08x "
|
2020-01-06 20:25:08 +00:00
|
|
|
"offset=%lld count=%u",
|
2017-08-21 19:00:49 +00:00
|
|
|
MAJOR(__entry->dev), MINOR(__entry->dev),
|
|
|
|
(unsigned long long)__entry->fileid,
|
|
|
|
__entry->fhandle,
|
2020-01-06 20:25:08 +00:00
|
|
|
(long long)__entry->offset, __entry->count
|
2017-08-21 19:00:49 +00:00
|
|
|
)
|
|
|
|
);
|
|
|
|
|
|
|
|
TRACE_EVENT(nfs_readpage_done,
|
|
|
|
TP_PROTO(
|
2020-01-06 20:25:08 +00:00
|
|
|
const struct rpc_task *task,
|
|
|
|
const struct nfs_pgio_header *hdr
|
2017-08-21 19:00:49 +00:00
|
|
|
),
|
|
|
|
|
2020-01-06 20:25:08 +00:00
|
|
|
TP_ARGS(task, hdr),
|
2017-08-21 19:00:49 +00:00
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__field(dev_t, dev)
|
|
|
|
__field(u32, fhandle)
|
2020-05-12 21:14:05 +00:00
|
|
|
__field(u64, fileid)
|
|
|
|
__field(loff_t, offset)
|
|
|
|
__field(u32, arg_count)
|
|
|
|
__field(u32, res_count)
|
|
|
|
__field(bool, eof)
|
2022-08-09 17:59:09 +00:00
|
|
|
__field(int, error)
|
2020-05-12 21:14:05 +00:00
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
const struct inode *inode = hdr->inode;
|
|
|
|
const struct nfs_inode *nfsi = NFS_I(inode);
|
|
|
|
const struct nfs_fh *fh = hdr->args.fh ?
|
|
|
|
hdr->args.fh : &nfsi->fh;
|
|
|
|
|
2022-08-09 17:59:09 +00:00
|
|
|
__entry->error = task->tk_status;
|
2020-05-12 21:14:05 +00:00
|
|
|
__entry->offset = hdr->args.offset;
|
|
|
|
__entry->arg_count = hdr->args.count;
|
|
|
|
__entry->res_count = hdr->res.count;
|
|
|
|
__entry->eof = hdr->res.eof;
|
|
|
|
__entry->dev = inode->i_sb->s_dev;
|
|
|
|
__entry->fileid = nfsi->fileid;
|
|
|
|
__entry->fhandle = nfs_fhandle_hash(fh);
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk(
|
2022-08-09 17:59:09 +00:00
|
|
|
"error=%d fileid=%02x:%02x:%llu fhandle=0x%08x "
|
|
|
|
"offset=%lld count=%u res=%u%s", __entry->error,
|
2020-05-12 21:14:05 +00:00
|
|
|
MAJOR(__entry->dev), MINOR(__entry->dev),
|
|
|
|
(unsigned long long)__entry->fileid,
|
|
|
|
__entry->fhandle,
|
|
|
|
(long long)__entry->offset, __entry->arg_count,
|
2022-08-09 17:59:09 +00:00
|
|
|
__entry->res_count, __entry->eof ? " eof" : ""
|
2020-05-12 21:14:05 +00:00
|
|
|
)
|
|
|
|
);
|
|
|
|
|
|
|
|
TRACE_EVENT(nfs_readpage_short,
|
|
|
|
TP_PROTO(
|
|
|
|
const struct rpc_task *task,
|
|
|
|
const struct nfs_pgio_header *hdr
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_ARGS(task, hdr),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__field(dev_t, dev)
|
|
|
|
__field(u32, fhandle)
|
2017-08-21 19:00:49 +00:00
|
|
|
__field(u64, fileid)
|
2020-01-06 20:25:08 +00:00
|
|
|
__field(loff_t, offset)
|
|
|
|
__field(u32, arg_count)
|
|
|
|
__field(u32, res_count)
|
|
|
|
__field(bool, eof)
|
2022-08-09 17:59:09 +00:00
|
|
|
__field(int, error)
|
2017-08-21 19:00:49 +00:00
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
2020-01-06 20:25:08 +00:00
|
|
|
const struct inode *inode = hdr->inode;
|
2017-08-21 19:00:49 +00:00
|
|
|
const struct nfs_inode *nfsi = NFS_I(inode);
|
2020-01-06 20:25:08 +00:00
|
|
|
const struct nfs_fh *fh = hdr->args.fh ?
|
|
|
|
hdr->args.fh : &nfsi->fh;
|
|
|
|
|
2022-08-09 17:59:09 +00:00
|
|
|
__entry->error = task->tk_status;
|
2020-01-06 20:25:08 +00:00
|
|
|
__entry->offset = hdr->args.offset;
|
|
|
|
__entry->arg_count = hdr->args.count;
|
|
|
|
__entry->res_count = hdr->res.count;
|
|
|
|
__entry->eof = hdr->res.eof;
|
2017-08-21 19:00:49 +00:00
|
|
|
__entry->dev = inode->i_sb->s_dev;
|
|
|
|
__entry->fileid = nfsi->fileid;
|
2020-01-06 20:25:08 +00:00
|
|
|
__entry->fhandle = nfs_fhandle_hash(fh);
|
2017-08-21 19:00:49 +00:00
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk(
|
2022-08-09 17:59:09 +00:00
|
|
|
"error=%d fileid=%02x:%02x:%llu fhandle=0x%08x "
|
|
|
|
"offset=%lld count=%u res=%u%s", __entry->error,
|
2017-08-21 19:00:49 +00:00
|
|
|
MAJOR(__entry->dev), MINOR(__entry->dev),
|
|
|
|
(unsigned long long)__entry->fileid,
|
|
|
|
__entry->fhandle,
|
2020-01-06 20:25:08 +00:00
|
|
|
(long long)__entry->offset, __entry->arg_count,
|
2022-08-09 17:59:09 +00:00
|
|
|
__entry->res_count, __entry->eof ? " eof" : ""
|
2017-08-21 19:00:49 +00:00
|
|
|
)
|
|
|
|
);
|
|
|
|
|
2022-03-01 19:37:26 +00:00
|
|
|
|
2020-05-12 21:14:11 +00:00
|
|
|
TRACE_EVENT(nfs_pgio_error,
|
|
|
|
TP_PROTO(
|
|
|
|
const struct nfs_pgio_header *hdr,
|
|
|
|
int error,
|
|
|
|
loff_t pos
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_ARGS(hdr, error, pos),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__field(dev_t, dev)
|
|
|
|
__field(u32, fhandle)
|
|
|
|
__field(u64, fileid)
|
|
|
|
__field(loff_t, offset)
|
|
|
|
__field(u32, arg_count)
|
|
|
|
__field(u32, res_count)
|
|
|
|
__field(loff_t, pos)
|
2022-08-09 17:59:09 +00:00
|
|
|
__field(int, error)
|
2020-05-12 21:14:11 +00:00
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
const struct inode *inode = hdr->inode;
|
|
|
|
const struct nfs_inode *nfsi = NFS_I(inode);
|
|
|
|
const struct nfs_fh *fh = hdr->args.fh ?
|
|
|
|
hdr->args.fh : &nfsi->fh;
|
|
|
|
|
2022-08-09 17:59:09 +00:00
|
|
|
__entry->error = error;
|
2020-05-12 21:14:11 +00:00
|
|
|
__entry->offset = hdr->args.offset;
|
|
|
|
__entry->arg_count = hdr->args.count;
|
|
|
|
__entry->res_count = hdr->res.count;
|
|
|
|
__entry->dev = inode->i_sb->s_dev;
|
|
|
|
__entry->fileid = nfsi->fileid;
|
|
|
|
__entry->fhandle = nfs_fhandle_hash(fh);
|
|
|
|
),
|
|
|
|
|
2022-08-09 17:59:09 +00:00
|
|
|
TP_printk("error=%d fileid=%02x:%02x:%llu fhandle=0x%08x "
|
|
|
|
"offset=%lld count=%u res=%u pos=%llu", __entry->error,
|
2020-05-12 21:14:11 +00:00
|
|
|
MAJOR(__entry->dev), MINOR(__entry->dev),
|
|
|
|
(unsigned long long)__entry->fileid, __entry->fhandle,
|
|
|
|
(long long)__entry->offset, __entry->arg_count, __entry->res_count,
|
2022-08-09 17:59:09 +00:00
|
|
|
__entry->pos
|
2020-05-12 21:14:11 +00:00
|
|
|
)
|
|
|
|
);
|
|
|
|
|
2017-08-21 19:00:49 +00:00
|
|
|
TRACE_EVENT(nfs_initiate_write,
|
|
|
|
TP_PROTO(
|
2020-01-06 20:25:09 +00:00
|
|
|
const struct nfs_pgio_header *hdr
|
2017-08-21 19:00:49 +00:00
|
|
|
),
|
|
|
|
|
2020-01-06 20:25:09 +00:00
|
|
|
TP_ARGS(hdr),
|
2017-08-21 19:00:49 +00:00
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__field(dev_t, dev)
|
|
|
|
__field(u32, fhandle)
|
|
|
|
__field(u64, fileid)
|
2020-01-06 20:25:09 +00:00
|
|
|
__field(loff_t, offset)
|
|
|
|
__field(u32, count)
|
2021-10-22 20:17:03 +00:00
|
|
|
__field(unsigned long, stable)
|
2017-08-21 19:00:49 +00:00
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
2020-01-06 20:25:09 +00:00
|
|
|
const struct inode *inode = hdr->inode;
|
2017-08-21 19:00:49 +00:00
|
|
|
const struct nfs_inode *nfsi = NFS_I(inode);
|
2020-01-06 20:25:09 +00:00
|
|
|
const struct nfs_fh *fh = hdr->args.fh ?
|
|
|
|
hdr->args.fh : &nfsi->fh;
|
2017-08-21 19:00:49 +00:00
|
|
|
|
2020-01-06 20:25:09 +00:00
|
|
|
__entry->offset = hdr->args.offset;
|
|
|
|
__entry->count = hdr->args.count;
|
|
|
|
__entry->stable = hdr->args.stable;
|
2017-08-21 19:00:49 +00:00
|
|
|
__entry->dev = inode->i_sb->s_dev;
|
|
|
|
__entry->fileid = nfsi->fileid;
|
2020-01-06 20:25:09 +00:00
|
|
|
__entry->fhandle = nfs_fhandle_hash(fh);
|
2017-08-21 19:00:49 +00:00
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk(
|
|
|
|
"fileid=%02x:%02x:%llu fhandle=0x%08x "
|
2020-01-06 20:25:09 +00:00
|
|
|
"offset=%lld count=%u stable=%s",
|
2017-08-21 19:00:49 +00:00
|
|
|
MAJOR(__entry->dev), MINOR(__entry->dev),
|
|
|
|
(unsigned long long)__entry->fileid,
|
|
|
|
__entry->fhandle,
|
2020-01-06 20:25:09 +00:00
|
|
|
(long long)__entry->offset, __entry->count,
|
2021-10-22 20:17:03 +00:00
|
|
|
show_nfs_stable_how(__entry->stable)
|
2017-08-21 19:00:49 +00:00
|
|
|
)
|
|
|
|
);
|
|
|
|
|
|
|
|
TRACE_EVENT(nfs_writeback_done,
|
|
|
|
TP_PROTO(
|
2020-01-06 20:25:09 +00:00
|
|
|
const struct rpc_task *task,
|
|
|
|
const struct nfs_pgio_header *hdr
|
2017-08-21 19:00:49 +00:00
|
|
|
),
|
|
|
|
|
2020-01-06 20:25:09 +00:00
|
|
|
TP_ARGS(task, hdr),
|
2017-08-21 19:00:49 +00:00
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__field(dev_t, dev)
|
|
|
|
__field(u32, fhandle)
|
|
|
|
__field(u64, fileid)
|
2020-01-06 20:25:09 +00:00
|
|
|
__field(loff_t, offset)
|
|
|
|
__field(u32, arg_count)
|
|
|
|
__field(u32, res_count)
|
2022-08-09 17:59:09 +00:00
|
|
|
__field(int, error)
|
2021-10-22 20:17:03 +00:00
|
|
|
__field(unsigned long, stable)
|
2020-01-06 20:25:09 +00:00
|
|
|
__array(char, verifier, NFS4_VERIFIER_SIZE)
|
2017-08-21 19:00:49 +00:00
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
2020-01-06 20:25:09 +00:00
|
|
|
const struct inode *inode = hdr->inode;
|
2017-08-21 19:00:49 +00:00
|
|
|
const struct nfs_inode *nfsi = NFS_I(inode);
|
2020-01-06 20:25:09 +00:00
|
|
|
const struct nfs_fh *fh = hdr->args.fh ?
|
|
|
|
hdr->args.fh : &nfsi->fh;
|
|
|
|
const struct nfs_writeverf *verf = hdr->res.verf;
|
2017-08-21 19:00:49 +00:00
|
|
|
|
2022-08-09 17:59:09 +00:00
|
|
|
__entry->error = task->tk_status;
|
2020-01-06 20:25:09 +00:00
|
|
|
__entry->offset = hdr->args.offset;
|
|
|
|
__entry->arg_count = hdr->args.count;
|
|
|
|
__entry->res_count = hdr->res.count;
|
|
|
|
__entry->stable = verf->committed;
|
|
|
|
memcpy(__entry->verifier,
|
|
|
|
&verf->verifier,
|
|
|
|
NFS4_VERIFIER_SIZE);
|
2017-08-21 19:00:49 +00:00
|
|
|
__entry->dev = inode->i_sb->s_dev;
|
|
|
|
__entry->fileid = nfsi->fileid;
|
2020-01-06 20:25:09 +00:00
|
|
|
__entry->fhandle = nfs_fhandle_hash(fh);
|
2017-08-21 19:00:49 +00:00
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk(
|
2022-08-09 17:59:09 +00:00
|
|
|
"error=%d fileid=%02x:%02x:%llu fhandle=0x%08x "
|
|
|
|
"offset=%lld count=%u res=%u stable=%s "
|
|
|
|
"verifier=%s", __entry->error,
|
2017-08-21 19:00:49 +00:00
|
|
|
MAJOR(__entry->dev), MINOR(__entry->dev),
|
|
|
|
(unsigned long long)__entry->fileid,
|
|
|
|
__entry->fhandle,
|
2020-01-06 20:25:09 +00:00
|
|
|
(long long)__entry->offset, __entry->arg_count,
|
2022-08-09 17:59:09 +00:00
|
|
|
__entry->res_count,
|
2021-10-22 20:17:03 +00:00
|
|
|
show_nfs_stable_how(__entry->stable),
|
|
|
|
show_nfs4_verifier(__entry->verifier)
|
2017-08-21 19:00:49 +00:00
|
|
|
)
|
|
|
|
);
|
|
|
|
|
2019-12-23 15:28:33 +00:00
|
|
|
DECLARE_EVENT_CLASS(nfs_page_error_class,
|
|
|
|
TP_PROTO(
|
2022-08-09 16:50:28 +00:00
|
|
|
const struct inode *inode,
|
2019-12-23 15:28:33 +00:00
|
|
|
const struct nfs_page *req,
|
|
|
|
int error
|
|
|
|
),
|
|
|
|
|
2022-08-09 16:50:28 +00:00
|
|
|
TP_ARGS(inode, req, error),
|
2019-12-23 15:28:33 +00:00
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
2022-08-09 16:50:28 +00:00
|
|
|
__field(dev_t, dev)
|
|
|
|
__field(u32, fhandle)
|
|
|
|
__field(u64, fileid)
|
|
|
|
__field(loff_t, offset)
|
|
|
|
__field(unsigned int, count)
|
2019-12-23 15:28:33 +00:00
|
|
|
__field(int, error)
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
2022-08-09 16:50:28 +00:00
|
|
|
const struct nfs_inode *nfsi = NFS_I(inode);
|
|
|
|
__entry->dev = inode->i_sb->s_dev;
|
|
|
|
__entry->fileid = nfsi->fileid;
|
|
|
|
__entry->fhandle = nfs_fhandle_hash(&nfsi->fh);
|
|
|
|
__entry->offset = req_offset(req);
|
|
|
|
__entry->count = req->wb_bytes;
|
2019-12-23 15:28:33 +00:00
|
|
|
__entry->error = error;
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk(
|
2022-08-09 16:50:28 +00:00
|
|
|
"error=%d fileid=%02x:%02x:%llu fhandle=0x%08x "
|
|
|
|
"offset=%lld count=%u", __entry->error,
|
|
|
|
MAJOR(__entry->dev), MINOR(__entry->dev),
|
|
|
|
(unsigned long long)__entry->fileid,
|
|
|
|
__entry->fhandle, __entry->offset,
|
|
|
|
__entry->count
|
2019-12-23 15:28:33 +00:00
|
|
|
)
|
|
|
|
);
|
|
|
|
|
|
|
|
#define DEFINE_NFS_PAGEERR_EVENT(name) \
|
|
|
|
DEFINE_EVENT(nfs_page_error_class, name, \
|
|
|
|
TP_PROTO( \
|
2022-08-09 16:50:28 +00:00
|
|
|
const struct inode *inode, \
|
2019-12-23 15:28:33 +00:00
|
|
|
const struct nfs_page *req, \
|
|
|
|
int error \
|
|
|
|
), \
|
2022-08-09 16:50:28 +00:00
|
|
|
TP_ARGS(inode, req, error))
|
2019-12-23 15:28:33 +00:00
|
|
|
|
|
|
|
DEFINE_NFS_PAGEERR_EVENT(nfs_write_error);
|
|
|
|
DEFINE_NFS_PAGEERR_EVENT(nfs_comp_error);
|
|
|
|
DEFINE_NFS_PAGEERR_EVENT(nfs_commit_error);
|
|
|
|
|
2017-08-21 19:00:49 +00:00
|
|
|
TRACE_EVENT(nfs_initiate_commit,
|
|
|
|
TP_PROTO(
|
|
|
|
const struct nfs_commit_data *data
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_ARGS(data),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__field(dev_t, dev)
|
|
|
|
__field(u32, fhandle)
|
|
|
|
__field(u64, fileid)
|
2020-01-06 20:25:10 +00:00
|
|
|
__field(loff_t, offset)
|
|
|
|
__field(u32, count)
|
2017-08-21 19:00:49 +00:00
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
const struct inode *inode = data->inode;
|
|
|
|
const struct nfs_inode *nfsi = NFS_I(inode);
|
2020-01-06 20:25:10 +00:00
|
|
|
const struct nfs_fh *fh = data->args.fh ?
|
|
|
|
data->args.fh : &nfsi->fh;
|
2017-08-21 19:00:49 +00:00
|
|
|
|
|
|
|
__entry->offset = data->args.offset;
|
|
|
|
__entry->count = data->args.count;
|
|
|
|
__entry->dev = inode->i_sb->s_dev;
|
|
|
|
__entry->fileid = nfsi->fileid;
|
2020-01-06 20:25:10 +00:00
|
|
|
__entry->fhandle = nfs_fhandle_hash(fh);
|
2017-08-21 19:00:49 +00:00
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk(
|
|
|
|
"fileid=%02x:%02x:%llu fhandle=0x%08x "
|
2020-01-06 20:25:10 +00:00
|
|
|
"offset=%lld count=%u",
|
2017-08-21 19:00:49 +00:00
|
|
|
MAJOR(__entry->dev), MINOR(__entry->dev),
|
|
|
|
(unsigned long long)__entry->fileid,
|
|
|
|
__entry->fhandle,
|
2020-01-06 20:25:10 +00:00
|
|
|
(long long)__entry->offset, __entry->count
|
2017-08-21 19:00:49 +00:00
|
|
|
)
|
|
|
|
);
|
|
|
|
|
|
|
|
TRACE_EVENT(nfs_commit_done,
|
|
|
|
TP_PROTO(
|
2020-01-06 20:25:10 +00:00
|
|
|
const struct rpc_task *task,
|
2017-08-21 19:00:49 +00:00
|
|
|
const struct nfs_commit_data *data
|
|
|
|
),
|
|
|
|
|
2020-01-06 20:25:10 +00:00
|
|
|
TP_ARGS(task, data),
|
2017-08-21 19:00:49 +00:00
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__field(dev_t, dev)
|
|
|
|
__field(u32, fhandle)
|
|
|
|
__field(u64, fileid)
|
2020-01-06 20:25:10 +00:00
|
|
|
__field(loff_t, offset)
|
2022-08-09 17:59:09 +00:00
|
|
|
__field(int, error)
|
2021-10-22 20:17:03 +00:00
|
|
|
__field(unsigned long, stable)
|
2020-01-06 20:25:10 +00:00
|
|
|
__array(char, verifier, NFS4_VERIFIER_SIZE)
|
2017-08-21 19:00:49 +00:00
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
const struct inode *inode = data->inode;
|
|
|
|
const struct nfs_inode *nfsi = NFS_I(inode);
|
2020-01-06 20:25:10 +00:00
|
|
|
const struct nfs_fh *fh = data->args.fh ?
|
|
|
|
data->args.fh : &nfsi->fh;
|
|
|
|
const struct nfs_writeverf *verf = data->res.verf;
|
2017-08-21 19:00:49 +00:00
|
|
|
|
2022-08-09 17:59:09 +00:00
|
|
|
__entry->error = task->tk_status;
|
2017-08-21 19:00:49 +00:00
|
|
|
__entry->offset = data->args.offset;
|
2020-01-06 20:25:10 +00:00
|
|
|
__entry->stable = verf->committed;
|
|
|
|
memcpy(__entry->verifier,
|
|
|
|
&verf->verifier,
|
|
|
|
NFS4_VERIFIER_SIZE);
|
2017-08-21 19:00:49 +00:00
|
|
|
__entry->dev = inode->i_sb->s_dev;
|
|
|
|
__entry->fileid = nfsi->fileid;
|
2020-01-06 20:25:10 +00:00
|
|
|
__entry->fhandle = nfs_fhandle_hash(fh);
|
2017-08-21 19:00:49 +00:00
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk(
|
2022-08-09 17:59:09 +00:00
|
|
|
"error=%d fileid=%02x:%02x:%llu fhandle=0x%08x "
|
|
|
|
"offset=%lld stable=%s verifier=%s", __entry->error,
|
2017-08-21 19:00:49 +00:00
|
|
|
MAJOR(__entry->dev), MINOR(__entry->dev),
|
|
|
|
(unsigned long long)__entry->fileid,
|
|
|
|
__entry->fhandle,
|
2022-08-09 17:59:09 +00:00
|
|
|
(long long)__entry->offset,
|
2021-10-22 20:17:03 +00:00
|
|
|
show_nfs_stable_how(__entry->stable),
|
|
|
|
show_nfs4_verifier(__entry->verifier)
|
2017-08-21 19:00:49 +00:00
|
|
|
)
|
|
|
|
);
|
|
|
|
|
2022-07-22 18:12:18 +00:00
|
|
|
#define nfs_show_direct_req_flags(v) \
|
|
|
|
__print_flags(v, "|", \
|
|
|
|
{ NFS_ODIRECT_DO_COMMIT, "DO_COMMIT" }, \
|
|
|
|
{ NFS_ODIRECT_RESCHED_WRITES, "RESCHED_WRITES" }, \
|
|
|
|
{ NFS_ODIRECT_SHOULD_DIRTY, "SHOULD DIRTY" }, \
|
|
|
|
{ NFS_ODIRECT_DONE, "DONE" } )
|
|
|
|
|
|
|
|
DECLARE_EVENT_CLASS(nfs_direct_req_class,
|
|
|
|
TP_PROTO(
|
|
|
|
const struct nfs_direct_req *dreq
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_ARGS(dreq),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__field(dev_t, dev)
|
|
|
|
__field(u64, fileid)
|
|
|
|
__field(u32, fhandle)
|
2022-08-09 17:46:41 +00:00
|
|
|
__field(loff_t, offset)
|
2022-07-22 18:12:18 +00:00
|
|
|
__field(ssize_t, count)
|
|
|
|
__field(ssize_t, bytes_left)
|
|
|
|
__field(ssize_t, error)
|
|
|
|
__field(int, flags)
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
const struct inode *inode = dreq->inode;
|
|
|
|
const struct nfs_inode *nfsi = NFS_I(inode);
|
|
|
|
const struct nfs_fh *fh = &nfsi->fh;
|
|
|
|
|
|
|
|
__entry->dev = inode->i_sb->s_dev;
|
|
|
|
__entry->fileid = nfsi->fileid;
|
|
|
|
__entry->fhandle = nfs_fhandle_hash(fh);
|
2022-08-09 17:46:41 +00:00
|
|
|
__entry->offset = dreq->io_start;
|
2022-07-22 18:12:18 +00:00
|
|
|
__entry->count = dreq->count;
|
|
|
|
__entry->bytes_left = dreq->bytes_left;
|
|
|
|
__entry->error = dreq->error;
|
|
|
|
__entry->flags = dreq->flags;
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk(
|
2022-08-09 17:46:41 +00:00
|
|
|
"error=%zd fileid=%02x:%02x:%llu fhandle=0x%08x "
|
|
|
|
"offset=%lld count=%zd bytes_left=%zd flags=%s",
|
|
|
|
__entry->error, MAJOR(__entry->dev),
|
|
|
|
MINOR(__entry->dev),
|
2022-07-22 18:12:18 +00:00
|
|
|
(unsigned long long)__entry->fileid,
|
2022-08-09 17:46:41 +00:00
|
|
|
__entry->fhandle, __entry->offset,
|
|
|
|
__entry->count, __entry->bytes_left,
|
|
|
|
nfs_show_direct_req_flags(__entry->flags)
|
2022-07-22 18:12:18 +00:00
|
|
|
)
|
|
|
|
);
|
|
|
|
|
|
|
|
#define DEFINE_NFS_DIRECT_REQ_EVENT(name) \
|
|
|
|
DEFINE_EVENT(nfs_direct_req_class, name, \
|
|
|
|
TP_PROTO( \
|
|
|
|
const struct nfs_direct_req *dreq \
|
|
|
|
), \
|
|
|
|
TP_ARGS(dreq))
|
|
|
|
|
|
|
|
DEFINE_NFS_DIRECT_REQ_EVENT(nfs_direct_commit_complete);
|
|
|
|
DEFINE_NFS_DIRECT_REQ_EVENT(nfs_direct_resched_write);
|
|
|
|
DEFINE_NFS_DIRECT_REQ_EVENT(nfs_direct_write_complete);
|
|
|
|
DEFINE_NFS_DIRECT_REQ_EVENT(nfs_direct_write_completion);
|
|
|
|
DEFINE_NFS_DIRECT_REQ_EVENT(nfs_direct_write_schedule_iovec);
|
|
|
|
DEFINE_NFS_DIRECT_REQ_EVENT(nfs_direct_write_reschedule_io);
|
|
|
|
|
2019-11-01 19:33:55 +00:00
|
|
|
TRACE_EVENT(nfs_fh_to_dentry,
|
|
|
|
TP_PROTO(
|
|
|
|
const struct super_block *sb,
|
|
|
|
const struct nfs_fh *fh,
|
|
|
|
u64 fileid,
|
|
|
|
int error
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_ARGS(sb, fh, fileid, error),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__field(int, error)
|
|
|
|
__field(dev_t, dev)
|
|
|
|
__field(u32, fhandle)
|
|
|
|
__field(u64, fileid)
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
__entry->error = error;
|
|
|
|
__entry->dev = sb->s_dev;
|
|
|
|
__entry->fileid = fileid;
|
|
|
|
__entry->fhandle = nfs_fhandle_hash(fh);
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk(
|
|
|
|
"error=%d fileid=%02x:%02x:%llu fhandle=0x%08x ",
|
|
|
|
__entry->error,
|
|
|
|
MAJOR(__entry->dev), MINOR(__entry->dev),
|
|
|
|
(unsigned long long)__entry->fileid,
|
|
|
|
__entry->fhandle
|
|
|
|
)
|
|
|
|
);
|
|
|
|
|
2022-07-22 19:08:24 +00:00
|
|
|
TRACE_EVENT(nfs_mount_assign,
|
|
|
|
TP_PROTO(
|
|
|
|
const char *option,
|
|
|
|
const char *value
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_ARGS(option, value),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__string(option, option)
|
|
|
|
__string(value, value)
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
__assign_str(option, option);
|
|
|
|
__assign_str(value, value);
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk("option %s=%s",
|
|
|
|
__get_str(option), __get_str(value)
|
|
|
|
)
|
|
|
|
);
|
|
|
|
|
|
|
|
TRACE_EVENT(nfs_mount_option,
|
|
|
|
TP_PROTO(
|
|
|
|
const struct fs_parameter *param
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_ARGS(param),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__string(option, param->key)
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
__assign_str(option, param->key);
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk("option %s", __get_str(option))
|
|
|
|
);
|
|
|
|
|
|
|
|
TRACE_EVENT(nfs_mount_path,
|
|
|
|
TP_PROTO(
|
|
|
|
const char *path
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_ARGS(path),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__string(path, path)
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
__assign_str(path, path);
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk("path='%s'", __get_str(path))
|
|
|
|
);
|
|
|
|
|
2021-04-01 17:54:19 +00:00
|
|
|
DECLARE_EVENT_CLASS(nfs_xdr_event,
|
2019-02-11 16:24:26 +00:00
|
|
|
TP_PROTO(
|
2019-06-19 14:34:09 +00:00
|
|
|
const struct xdr_stream *xdr,
|
2019-02-11 16:24:26 +00:00
|
|
|
int error
|
|
|
|
),
|
|
|
|
|
2019-06-19 14:34:09 +00:00
|
|
|
TP_ARGS(xdr, error),
|
2019-02-11 16:24:26 +00:00
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
2019-06-19 14:34:09 +00:00
|
|
|
__field(unsigned int, task_id)
|
|
|
|
__field(unsigned int, client_id)
|
|
|
|
__field(u32, xid)
|
2020-05-12 21:14:00 +00:00
|
|
|
__field(int, version)
|
2019-06-19 14:33:58 +00:00
|
|
|
__field(unsigned long, error)
|
2020-05-12 21:14:00 +00:00
|
|
|
__string(program,
|
|
|
|
xdr->rqst->rq_task->tk_client->cl_program->name)
|
|
|
|
__string(procedure,
|
|
|
|
xdr->rqst->rq_task->tk_msg.rpc_proc->p_name)
|
2019-02-11 16:24:26 +00:00
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
2019-06-19 14:34:09 +00:00
|
|
|
const struct rpc_rqst *rqstp = xdr->rqst;
|
|
|
|
const struct rpc_task *task = rqstp->rq_task;
|
|
|
|
|
|
|
|
__entry->task_id = task->tk_pid;
|
|
|
|
__entry->client_id = task->tk_client->cl_clid;
|
|
|
|
__entry->xid = be32_to_cpu(rqstp->rq_xid);
|
2020-05-12 21:14:00 +00:00
|
|
|
__entry->version = task->tk_client->cl_vers;
|
2019-02-11 16:24:26 +00:00
|
|
|
__entry->error = error;
|
2020-05-12 21:14:00 +00:00
|
|
|
__assign_str(program,
|
2021-06-12 15:42:27 +00:00
|
|
|
task->tk_client->cl_program->name);
|
|
|
|
__assign_str(procedure, task->tk_msg.rpc_proc->p_name);
|
2019-02-11 16:24:26 +00:00
|
|
|
),
|
|
|
|
|
2021-10-16 22:02:24 +00:00
|
|
|
TP_printk(SUNRPC_TRACE_TASK_SPECIFIER
|
|
|
|
" xid=0x%08x %sv%d %s error=%ld (%s)",
|
2019-06-19 14:34:09 +00:00
|
|
|
__entry->task_id, __entry->client_id, __entry->xid,
|
2020-05-12 21:14:00 +00:00
|
|
|
__get_str(program), __entry->version,
|
|
|
|
__get_str(procedure), -__entry->error,
|
2021-10-22 20:17:03 +00:00
|
|
|
show_nfs_status(__entry->error)
|
2019-02-11 16:24:26 +00:00
|
|
|
)
|
|
|
|
);
|
2021-04-01 17:54:19 +00:00
|
|
|
#define DEFINE_NFS_XDR_EVENT(name) \
|
|
|
|
DEFINE_EVENT(nfs_xdr_event, name, \
|
|
|
|
TP_PROTO( \
|
|
|
|
const struct xdr_stream *xdr, \
|
|
|
|
int error \
|
|
|
|
), \
|
|
|
|
TP_ARGS(xdr, error))
|
|
|
|
DEFINE_NFS_XDR_EVENT(nfs_xdr_status);
|
2021-04-01 18:03:26 +00:00
|
|
|
DEFINE_NFS_XDR_EVENT(nfs_xdr_bad_filehandle);
|
2019-02-11 16:24:26 +00:00
|
|
|
|
2013-08-19 22:59:33 +00:00
|
|
|
#endif /* _TRACE_NFS_H */
|
|
|
|
|
|
|
|
#undef TRACE_INCLUDE_PATH
|
|
|
|
#define TRACE_INCLUDE_PATH .
|
|
|
|
#define TRACE_INCLUDE_FILE nfstrace
|
|
|
|
/* This part must be outside protection */
|
|
|
|
#include <trace/define_trace.h>
|