diff mbox series

[1/7] NFSv4.2 add tracepoint to SEEK

Message ID 20211018220314.85115-2-olga.kornievskaia@gmail.com (mailing list archive)
State New, archived
Headers show
Series NFSv4.2 add tracepoints to sparse files and copy | expand

Commit Message

Olga Kornievskaia Oct. 18, 2021, 10:03 p.m. UTC
From: Olga Kornievskaia <kolga@netapp.com>

Add a tracepoint to the SEEK operation.

Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
---
 fs/nfs/nfs42proc.c |  1 +
 fs/nfs/nfs4trace.h | 65 ++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 66 insertions(+)

Comments

Schumaker, Anna Oct. 19, 2021, 5:08 p.m. UTC | #1
Hi Olga,

On Mon, Oct 18, 2021 at 6:05 PM Olga Kornievskaia
<olga.kornievskaia@gmail.com> wrote:
>
> From: Olga Kornievskaia <kolga@netapp.com>
>
> Add a tracepoint to the SEEK operation.

Compiling with CONFIG_NFS_V4_1=y but CONFIG_NFS_V4_2=n gives me the following:

In file included from fs/nfs/nfs4trace.h:11,
                 from fs/nfs/nfs4state.c:63:
fs/nfs/nfs4trace.h:2432:38: error: ‘struct nfs42_seek_res’ declared
inside parameter list will not be visible outside of this definition
or declaration [-Werror]
 2432 |                         const struct nfs42_seek_res *res,

You probably need to check for CONFIG_NFS_V4_2 inside nfs4trace.h

Anna

>
> Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
> ---
>  fs/nfs/nfs42proc.c |  1 +
>  fs/nfs/nfs4trace.h | 65 ++++++++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 66 insertions(+)
>
> diff --git a/fs/nfs/nfs42proc.c b/fs/nfs/nfs42proc.c
> index a24349512ffe..87c0dcb8823b 100644
> --- a/fs/nfs/nfs42proc.c
> +++ b/fs/nfs/nfs42proc.c
> @@ -678,6 +678,7 @@ static loff_t _nfs42_proc_llseek(struct file *filep,
>
>         status = nfs4_call_sync(server->client, server, &msg,
>                                 &args.seq_args, &res.seq_res, 0);
> +       trace_nfs4_llseek(inode, &args, &res, status);
>         if (status == -ENOTSUPP)
>                 server->caps &= ~NFS_CAP_SEEK;
>         if (status)
> diff --git a/fs/nfs/nfs4trace.h b/fs/nfs/nfs4trace.h
> index 7a2567aa2b86..81dcbfca7f74 100644
> --- a/fs/nfs/nfs4trace.h
> +++ b/fs/nfs/nfs4trace.h
> @@ -2417,6 +2417,71 @@ TRACE_EVENT(ff_layout_commit_error,
>                 )
>  );
>
> +TRACE_DEFINE_ENUM(NFS4_CONTENT_DATA);
> +TRACE_DEFINE_ENUM(NFS4_CONTENT_HOLE);
> +
> +#define show_llseek_mode(what)                 \
> +       __print_symbolic(what,                  \
> +               { NFS4_CONTENT_DATA, "DATA" },          \
> +               { NFS4_CONTENT_HOLE, "HOLE" })
> +
> +TRACE_EVENT(nfs4_llseek,
> +               TP_PROTO(
> +                       const struct inode *inode,
> +                       const struct nfs42_seek_args *args,
> +                       const struct nfs42_seek_res *res,
> +                       int error
> +               ),
> +
> +               TP_ARGS(inode, args, res, error),
> +
> +               TP_STRUCT__entry(
> +                       __field(unsigned long, error)
> +                       __field(u32, fhandle)
> +                       __field(u32, fileid)
> +                       __field(dev_t, dev)
> +                       __field(int, stateid_seq)
> +                       __field(u32, stateid_hash)
> +                       __field(loff_t, offset_s)
> +                       __field(u32, what)
> +                       __field(loff_t, offset_r)
> +                       __field(u32, eof)
> +               ),
> +
> +               TP_fast_assign(
> +                       const struct nfs_inode *nfsi = NFS_I(inode);
> +                       const struct nfs_fh *fh = args->sa_fh;
> +
> +                       __entry->fileid = nfsi->fileid;
> +                       __entry->dev = inode->i_sb->s_dev;
> +                       __entry->fhandle = nfs_fhandle_hash(fh);
> +                       __entry->offset_s = args->sa_offset;
> +                       __entry->error = error < 0 ? -error : 0;
> +                       __entry->stateid_seq =
> +                               be32_to_cpu(args->sa_stateid.seqid);
> +                       __entry->stateid_hash =
> +                               nfs_stateid_hash(&args->sa_stateid);
> +                       __entry->what = args->sa_what;
> +                       __entry->offset_r = error < 0 ? 0 : res->sr_offset;
> +                       __entry->eof = error < 0 ? 0 : res->sr_eof;
> +               ),
> +
> +               TP_printk(
> +                       "error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x "
> +                       "stateid=%d:0x%08x offset_s=%llu what=%s "
> +                       "offset_r=%llu eof=%u",
> +                       -__entry->error,
> +                       show_nfsv4_errors(__entry->error),
> +                       MAJOR(__entry->dev), MINOR(__entry->dev),
> +                       (unsigned long long)__entry->fileid,
> +                       __entry->fhandle,
> +                       __entry->stateid_seq, __entry->stateid_hash,
> +                       __entry->offset_s,
> +                       show_llseek_mode(__entry->what),
> +                       __entry->offset_r,
> +                       __entry->eof
> +               )
> +);
>
>  #endif /* CONFIG_NFS_V4_1 */
>
> --
> 2.27.0
>
kernel test robot Oct. 27, 2021, 7:50 a.m. UTC | #2
Hi Olga,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on trondmy-nfs/linux-next]
[also build test ERROR on v5.15-rc7 next-20211026]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Olga-Kornievskaia/NFSv4-2-add-tracepoints-to-sparse-files-and-copy/20211019-060455
base:   git://git.linux-nfs.org/projects/trondmy/linux-nfs.git linux-next
config: csky-randconfig-r035-20211027 (attached as .config)
compiler: csky-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/39d7e45f3011c0936f8a56eb73dd1abca1ff448d
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Olga-Kornievskaia/NFSv4-2-add-tracepoints-to-sparse-files-and-copy/20211019-060455
        git checkout 39d7e45f3011c0936f8a56eb73dd1abca1ff448d
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=csky 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All error/warnings (new ones prefixed by >>):

   In file included from include/linux/bitops.h:33,
                    from include/linux/kernel.h:12,
                    from include/linux/list.h:9,
                    from include/linux/preempt.h:11,
                    from include/linux/spinlock.h:55,
                    from include/linux/mmzone.h:8,
                    from include/linux/gfp.h:6,
                    from include/linux/mm.h:10,
                    from fs/nfs/nfs4proc.c:38:
   arch/csky/include/asm/bitops.h:77: warning: "__clear_bit" redefined
      77 | #define __clear_bit(nr, vaddr) clear_bit(nr, vaddr)
         | 
   In file included from arch/csky/include/asm/bitops.h:76,
                    from include/linux/bitops.h:33,
                    from include/linux/kernel.h:12,
                    from include/linux/list.h:9,
                    from include/linux/preempt.h:11,
                    from include/linux/spinlock.h:55,
                    from include/linux/mmzone.h:8,
                    from include/linux/gfp.h:6,
                    from include/linux/mm.h:10,
                    from fs/nfs/nfs4proc.c:38:
   include/asm-generic/bitops/non-atomic.h:34: note: this is the location of the previous definition
      34 | #define __clear_bit arch___clear_bit
         | 
   In file included from fs/nfs/nfs4trace.h:11,
                    from fs/nfs/nfs4proc.c:72:
>> fs/nfs/nfs4trace.h:2432:38: warning: 'struct nfs42_seek_res' declared inside parameter list will not be visible outside of this definition or declaration
    2432 |                         const struct nfs42_seek_res *res,
         |                                      ^~~~~~~~~~~~~~
   include/linux/tracepoint.h:242:39: note: in definition of macro '__DECLARE_TRACE'
     242 |         extern int __traceiter_##name(data_proto);                      \
         |                                       ^~~~~~~~~~
   include/linux/tracepoint.h:421:25: note: in expansion of macro 'PARAMS'
     421 |                         PARAMS(void *__data, proto))
         |                         ^~~~~~
   include/linux/tracepoint.h:553:9: note: in expansion of macro 'DECLARE_TRACE'
     553 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
         |         ^~~~~~~~~~~~~
   include/linux/tracepoint.h:553:29: note: in expansion of macro 'PARAMS'
     553 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
         |                             ^~~~~~
   fs/nfs/nfs4trace.h:2428:1: note: in expansion of macro 'TRACE_EVENT'
    2428 | TRACE_EVENT(nfs4_llseek,
         | ^~~~~~~~~~~
   fs/nfs/nfs4trace.h:2429:17: note: in expansion of macro 'TP_PROTO'
    2429 |                 TP_PROTO(
         |                 ^~~~~~~~
>> fs/nfs/nfs4trace.h:2431:38: warning: 'struct nfs42_seek_args' declared inside parameter list will not be visible outside of this definition or declaration
    2431 |                         const struct nfs42_seek_args *args,
         |                                      ^~~~~~~~~~~~~~~
   include/linux/tracepoint.h:242:39: note: in definition of macro '__DECLARE_TRACE'
     242 |         extern int __traceiter_##name(data_proto);                      \
         |                                       ^~~~~~~~~~
   include/linux/tracepoint.h:421:25: note: in expansion of macro 'PARAMS'
     421 |                         PARAMS(void *__data, proto))
         |                         ^~~~~~
   include/linux/tracepoint.h:553:9: note: in expansion of macro 'DECLARE_TRACE'
     553 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
         |         ^~~~~~~~~~~~~
   include/linux/tracepoint.h:553:29: note: in expansion of macro 'PARAMS'
     553 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
         |                             ^~~~~~
   fs/nfs/nfs4trace.h:2428:1: note: in expansion of macro 'TRACE_EVENT'
    2428 | TRACE_EVENT(nfs4_llseek,
         | ^~~~~~~~~~~
   fs/nfs/nfs4trace.h:2429:17: note: in expansion of macro 'TP_PROTO'
    2429 |                 TP_PROTO(
         |                 ^~~~~~~~
>> fs/nfs/nfs4trace.h:2432:38: warning: 'struct nfs42_seek_res' declared inside parameter list will not be visible outside of this definition or declaration
    2432 |                         const struct nfs42_seek_res *res,
         |                                      ^~~~~~~~~~~~~~
   include/linux/tracepoint.h:245:41: note: in definition of macro '__DECLARE_TRACE'
     245 |         static inline void trace_##name(proto)                          \
         |                                         ^~~~~
   include/linux/tracepoint.h:419:31: note: in expansion of macro 'PARAMS'
     419 |         __DECLARE_TRACE(name, PARAMS(proto), PARAMS(args),              \
         |                               ^~~~~~
   include/linux/tracepoint.h:553:9: note: in expansion of macro 'DECLARE_TRACE'
     553 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
         |         ^~~~~~~~~~~~~
   include/linux/tracepoint.h:553:29: note: in expansion of macro 'PARAMS'
     553 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
         |                             ^~~~~~
   fs/nfs/nfs4trace.h:2428:1: note: in expansion of macro 'TRACE_EVENT'
    2428 | TRACE_EVENT(nfs4_llseek,
         | ^~~~~~~~~~~
   fs/nfs/nfs4trace.h:2429:17: note: in expansion of macro 'TP_PROTO'
    2429 |                 TP_PROTO(
         |                 ^~~~~~~~
>> fs/nfs/nfs4trace.h:2431:38: warning: 'struct nfs42_seek_args' declared inside parameter list will not be visible outside of this definition or declaration
    2431 |                         const struct nfs42_seek_args *args,
         |                                      ^~~~~~~~~~~~~~~
   include/linux/tracepoint.h:245:41: note: in definition of macro '__DECLARE_TRACE'
     245 |         static inline void trace_##name(proto)                          \
         |                                         ^~~~~
   include/linux/tracepoint.h:419:31: note: in expansion of macro 'PARAMS'
     419 |         __DECLARE_TRACE(name, PARAMS(proto), PARAMS(args),              \
         |                               ^~~~~~
   include/linux/tracepoint.h:553:9: note: in expansion of macro 'DECLARE_TRACE'
     553 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
         |         ^~~~~~~~~~~~~
   include/linux/tracepoint.h:553:29: note: in expansion of macro 'PARAMS'
     553 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
         |                             ^~~~~~
   fs/nfs/nfs4trace.h:2428:1: note: in expansion of macro 'TRACE_EVENT'
    2428 | TRACE_EVENT(nfs4_llseek,
         | ^~~~~~~~~~~
   fs/nfs/nfs4trace.h:2429:17: note: in expansion of macro 'TP_PROTO'
    2429 |                 TP_PROTO(
         |                 ^~~~~~~~
   fs/nfs/nfs4trace.h: In function 'trace_nfs4_llseek':
>> fs/nfs/nfs4trace.h:2436:32: error: passing argument 3 of '__traceiter_nfs4_llseek' from incompatible pointer type [-Werror=incompatible-pointer-types]
    2436 |                 TP_ARGS(inode, args, res, error),
         |                                ^~~~
         |                                |
         |                                const struct nfs42_seek_args *
   include/linux/tracepoint.h:177:66: note: in definition of macro '__DO_TRACE_CALL'
     177 | #define __DO_TRACE_CALL(name, args)     __traceiter_##name(NULL, args)
         |                                                                  ^~~~
   include/linux/tracepoint.h:206:39: note: in expansion of macro 'TP_ARGS'
     206 |                 __DO_TRACE_CALL(name, TP_ARGS(args));                   \
         |                                       ^~~~~~~
   include/linux/tracepoint.h:248:25: note: in expansion of macro '__DO_TRACE'
     248 |                         __DO_TRACE(name,                                \
         |                         ^~~~~~~~~~
   include/linux/tracepoint.h:249:33: note: in expansion of macro 'TP_ARGS'
     249 |                                 TP_ARGS(args),                          \
         |                                 ^~~~~~~
   include/linux/tracepoint.h:419:9: note: in expansion of macro '__DECLARE_TRACE'
     419 |         __DECLARE_TRACE(name, PARAMS(proto), PARAMS(args),              \
         |         ^~~~~~~~~~~~~~~
   include/linux/tracepoint.h:419:46: note: in expansion of macro 'PARAMS'
     419 |         __DECLARE_TRACE(name, PARAMS(proto), PARAMS(args),              \
         |                                              ^~~~~~
   include/linux/tracepoint.h:553:9: note: in expansion of macro 'DECLARE_TRACE'
     553 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
         |         ^~~~~~~~~~~~~
   include/linux/tracepoint.h:553:44: note: in expansion of macro 'PARAMS'
     553 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
         |                                            ^~~~~~
   fs/nfs/nfs4trace.h:2428:1: note: in expansion of macro 'TRACE_EVENT'
    2428 | TRACE_EVENT(nfs4_llseek,
         | ^~~~~~~~~~~
   fs/nfs/nfs4trace.h:2436:17: note: in expansion of macro 'TP_ARGS'
    2436 |                 TP_ARGS(inode, args, res, error),
         |                 ^~~~~~~
   fs/nfs/nfs4trace.h:2431:55: note: expected 'const struct nfs42_seek_args *' but argument is of type 'const struct nfs42_seek_args *'
    2431 |                         const struct nfs42_seek_args *args,
         |                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
   include/linux/tracepoint.h:242:39: note: in definition of macro '__DECLARE_TRACE'
     242 |         extern int __traceiter_##name(data_proto);                      \
         |                                       ^~~~~~~~~~
   include/linux/tracepoint.h:421:25: note: in expansion of macro 'PARAMS'
     421 |                         PARAMS(void *__data, proto))
         |                         ^~~~~~
   include/linux/tracepoint.h:553:9: note: in expansion of macro 'DECLARE_TRACE'
     553 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
         |         ^~~~~~~~~~~~~
   include/linux/tracepoint.h:553:29: note: in expansion of macro 'PARAMS'
     553 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
         |                             ^~~~~~
   fs/nfs/nfs4trace.h:2428:1: note: in expansion of macro 'TRACE_EVENT'
    2428 | TRACE_EVENT(nfs4_llseek,
         | ^~~~~~~~~~~
   fs/nfs/nfs4trace.h:2429:17: note: in expansion of macro 'TP_PROTO'
    2429 |                 TP_PROTO(
         |                 ^~~~~~~~
   fs/nfs/nfs4trace.h:2436:38: error: passing argument 4 of '__traceiter_nfs4_llseek' from incompatible pointer type [-Werror=incompatible-pointer-types]
    2436 |                 TP_ARGS(inode, args, res, error),
         |                                      ^~~
         |                                      |
         |                                      const struct nfs42_seek_res *
   include/linux/tracepoint.h:177:66: note: in definition of macro '__DO_TRACE_CALL'
     177 | #define __DO_TRACE_CALL(name, args)     __traceiter_##name(NULL, args)
         |                                                                  ^~~~
   include/linux/tracepoint.h:206:39: note: in expansion of macro 'TP_ARGS'
     206 |                 __DO_TRACE_CALL(name, TP_ARGS(args));                   \
         |                                       ^~~~~~~
   include/linux/tracepoint.h:248:25: note: in expansion of macro '__DO_TRACE'
     248 |                         __DO_TRACE(name,                                \
         |                         ^~~~~~~~~~
   include/linux/tracepoint.h:249:33: note: in expansion of macro 'TP_ARGS'
     249 |                                 TP_ARGS(args),                          \
         |                                 ^~~~~~~
   include/linux/tracepoint.h:419:9: note: in expansion of macro '__DECLARE_TRACE'
     419 |         __DECLARE_TRACE(name, PARAMS(proto), PARAMS(args),              \
         |         ^~~~~~~~~~~~~~~
   include/linux/tracepoint.h:419:46: note: in expansion of macro 'PARAMS'
     419 |         __DECLARE_TRACE(name, PARAMS(proto), PARAMS(args),              \
         |                                              ^~~~~~
   include/linux/tracepoint.h:553:9: note: in expansion of macro 'DECLARE_TRACE'
     553 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
         |         ^~~~~~~~~~~~~
   include/linux/tracepoint.h:553:44: note: in expansion of macro 'PARAMS'
     553 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
         |                                            ^~~~~~
   fs/nfs/nfs4trace.h:2428:1: note: in expansion of macro 'TRACE_EVENT'
    2428 | TRACE_EVENT(nfs4_llseek,
         | ^~~~~~~~~~~
   fs/nfs/nfs4trace.h:2436:17: note: in expansion of macro 'TP_ARGS'
    2436 |                 TP_ARGS(inode, args, res, error),
         |                 ^~~~~~~
   fs/nfs/nfs4trace.h:2432:54: note: expected 'const struct nfs42_seek_res *' but argument is of type 'const struct nfs42_seek_res *'
    2432 |                         const struct nfs42_seek_res *res,
         |                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
   include/linux/tracepoint.h:242:39: note: in definition of macro '__DECLARE_TRACE'
     242 |         extern int __traceiter_##name(data_proto);                      \
         |                                       ^~~~~~~~~~
   include/linux/tracepoint.h:421:25: note: in expansion of macro 'PARAMS'
     421 |                         PARAMS(void *__data, proto))
         |                         ^~~~~~
   include/linux/tracepoint.h:553:9: note: in expansion of macro 'DECLARE_TRACE'
     553 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
         |         ^~~~~~~~~~~~~
   include/linux/tracepoint.h:553:29: note: in expansion of macro 'PARAMS'
     553 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
         |                             ^~~~~~
   fs/nfs/nfs4trace.h:2428:1: note: in expansion of macro 'TRACE_EVENT'
    2428 | TRACE_EVENT(nfs4_llseek,
         | ^~~~~~~~~~~
   fs/nfs/nfs4trace.h:2429:17: note: in expansion of macro 'TP_PROTO'
    2429 |                 TP_PROTO(
         |                 ^~~~~~~~
   fs/nfs/nfs4trace.h: At top level:
>> fs/nfs/nfs4trace.h:2432:38: warning: 'struct nfs42_seek_res' declared inside parameter list will not be visible outside of this definition or declaration
    2432 |                         const struct nfs42_seek_res *res,
         |                                      ^~~~~~~~~~~~~~
   include/linux/tracepoint.h:218:51: note: in definition of macro '__DECLARE_TRACE_RCU'
     218 |         static inline void trace_##name##_rcuidle(proto)                \
         |                                                   ^~~~~
   include/linux/tracepoint.h:257:35: note: in expansion of macro 'PARAMS'
     257 |         __DECLARE_TRACE_RCU(name, PARAMS(proto), PARAMS(args),          \
         |                                   ^~~~~~
   include/linux/tracepoint.h:419:9: note: in expansion of macro '__DECLARE_TRACE'
     419 |         __DECLARE_TRACE(name, PARAMS(proto), PARAMS(args),              \
         |         ^~~~~~~~~~~~~~~
   include/linux/tracepoint.h:419:31: note: in expansion of macro 'PARAMS'
     419 |         __DECLARE_TRACE(name, PARAMS(proto), PARAMS(args),              \
         |                               ^~~~~~
   include/linux/tracepoint.h:553:9: note: in expansion of macro 'DECLARE_TRACE'
     553 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
         |         ^~~~~~~~~~~~~
   include/linux/tracepoint.h:553:29: note: in expansion of macro 'PARAMS'
     553 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
         |                             ^~~~~~
   fs/nfs/nfs4trace.h:2428:1: note: in expansion of macro 'TRACE_EVENT'
    2428 | TRACE_EVENT(nfs4_llseek,
         | ^~~~~~~~~~~
   fs/nfs/nfs4trace.h:2429:17: note: in expansion of macro 'TP_PROTO'
    2429 |                 TP_PROTO(
         |                 ^~~~~~~~
>> fs/nfs/nfs4trace.h:2431:38: warning: 'struct nfs42_seek_args' declared inside parameter list will not be visible outside of this definition or declaration
    2431 |                         const struct nfs42_seek_args *args,
         |                                      ^~~~~~~~~~~~~~~
   include/linux/tracepoint.h:218:51: note: in definition of macro '__DECLARE_TRACE_RCU'
     218 |         static inline void trace_##name##_rcuidle(proto)                \
         |                                                   ^~~~~
   include/linux/tracepoint.h:257:35: note: in expansion of macro 'PARAMS'
     257 |         __DECLARE_TRACE_RCU(name, PARAMS(proto), PARAMS(args),          \
         |                                   ^~~~~~
   include/linux/tracepoint.h:419:9: note: in expansion of macro '__DECLARE_TRACE'
     419 |         __DECLARE_TRACE(name, PARAMS(proto), PARAMS(args),              \
         |         ^~~~~~~~~~~~~~~
   include/linux/tracepoint.h:419:31: note: in expansion of macro 'PARAMS'
     419 |         __DECLARE_TRACE(name, PARAMS(proto), PARAMS(args),              \
         |                               ^~~~~~
   include/linux/tracepoint.h:553:9: note: in expansion of macro 'DECLARE_TRACE'
     553 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
         |         ^~~~~~~~~~~~~
   include/linux/tracepoint.h:553:29: note: in expansion of macro 'PARAMS'
     553 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
         |                             ^~~~~~
   fs/nfs/nfs4trace.h:2428:1: note: in expansion of macro 'TRACE_EVENT'
    2428 | TRACE_EVENT(nfs4_llseek,
         | ^~~~~~~~~~~
   fs/nfs/nfs4trace.h:2429:17: note: in expansion of macro 'TP_PROTO'
    2429 |                 TP_PROTO(
         |                 ^~~~~~~~
   fs/nfs/nfs4trace.h: In function 'trace_nfs4_llseek_rcuidle':
>> fs/nfs/nfs4trace.h:2436:32: error: passing argument 3 of '__traceiter_nfs4_llseek' from incompatible pointer type [-Werror=incompatible-pointer-types]
    2436 |                 TP_ARGS(inode, args, res, error),
         |                                ^~~~
         |                                |
         |                                const struct nfs42_seek_args *
   include/linux/tracepoint.h:177:66: note: in definition of macro '__DO_TRACE_CALL'
     177 | #define __DO_TRACE_CALL(name, args)     __traceiter_##name(NULL, args)
         |                                                                  ^~~~
   include/linux/tracepoint.h:206:39: note: in expansion of macro 'TP_ARGS'
     206 |                 __DO_TRACE_CALL(name, TP_ARGS(args));                   \
         |                                       ^~~~~~~
   include/linux/tracepoint.h:221:25: note: in expansion of macro '__DO_TRACE'
     221 |                         __DO_TRACE(name,                                \
         |                         ^~~~~~~~~~
   include/linux/tracepoint.h:222:33: note: in expansion of macro 'TP_ARGS'
     222 |                                 TP_ARGS(args),                          \
         |                                 ^~~~~~~
   include/linux/tracepoint.h:257:9: note: in expansion of macro '__DECLARE_TRACE_RCU'
     257 |         __DECLARE_TRACE_RCU(name, PARAMS(proto), PARAMS(args),          \
         |         ^~~~~~~~~~~~~~~~~~~
   include/linux/tracepoint.h:257:50: note: in expansion of macro 'PARAMS'
     257 |         __DECLARE_TRACE_RCU(name, PARAMS(proto), PARAMS(args),          \
         |                                                  ^~~~~~
   include/linux/tracepoint.h:419:9: note: in expansion of macro '__DECLARE_TRACE'
     419 |         __DECLARE_TRACE(name, PARAMS(proto), PARAMS(args),              \
         |         ^~~~~~~~~~~~~~~
   include/linux/tracepoint.h:419:46: note: in expansion of macro 'PARAMS'
     419 |         __DECLARE_TRACE(name, PARAMS(proto), PARAMS(args),              \
         |                                              ^~~~~~
   include/linux/tracepoint.h:553:9: note: in expansion of macro 'DECLARE_TRACE'
     553 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
         |         ^~~~~~~~~~~~~
   include/linux/tracepoint.h:553:44: note: in expansion of macro 'PARAMS'
     553 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
         |                                            ^~~~~~
   fs/nfs/nfs4trace.h:2428:1: note: in expansion of macro 'TRACE_EVENT'
    2428 | TRACE_EVENT(nfs4_llseek,
         | ^~~~~~~~~~~
   fs/nfs/nfs4trace.h:2436:17: note: in expansion of macro 'TP_ARGS'
    2436 |                 TP_ARGS(inode, args, res, error),
         |                 ^~~~~~~
   fs/nfs/nfs4trace.h:2431:55: note: expected 'const struct nfs42_seek_args *' but argument is of type 'const struct nfs42_seek_args *'
    2431 |                         const struct nfs42_seek_args *args,
         |                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
   include/linux/tracepoint.h:242:39: note: in definition of macro '__DECLARE_TRACE'
     242 |         extern int __traceiter_##name(data_proto);                      \
         |                                       ^~~~~~~~~~
   include/linux/tracepoint.h:421:25: note: in expansion of macro 'PARAMS'
     421 |                         PARAMS(void *__data, proto))
         |                         ^~~~~~
   include/linux/tracepoint.h:553:9: note: in expansion of macro 'DECLARE_TRACE'
     553 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
         |         ^~~~~~~~~~~~~
   include/linux/tracepoint.h:553:29: note: in expansion of macro 'PARAMS'
     553 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
         |                             ^~~~~~
   fs/nfs/nfs4trace.h:2428:1: note: in expansion of macro 'TRACE_EVENT'
    2428 | TRACE_EVENT(nfs4_llseek,
         | ^~~~~~~~~~~
   fs/nfs/nfs4trace.h:2429:17: note: in expansion of macro 'TP_PROTO'
    2429 |                 TP_PROTO(
         |                 ^~~~~~~~
   fs/nfs/nfs4trace.h:2436:38: error: passing argument 4 of '__traceiter_nfs4_llseek' from incompatible pointer type [-Werror=incompatible-pointer-types]
    2436 |                 TP_ARGS(inode, args, res, error),
         |                                      ^~~
         |                                      |
         |                                      const struct nfs42_seek_res *
   include/linux/tracepoint.h:177:66: note: in definition of macro '__DO_TRACE_CALL'
     177 | #define __DO_TRACE_CALL(name, args)     __traceiter_##name(NULL, args)
         |                                                                  ^~~~
   include/linux/tracepoint.h:206:39: note: in expansion of macro 'TP_ARGS'
     206 |                 __DO_TRACE_CALL(name, TP_ARGS(args));                   \
         |                                       ^~~~~~~
   include/linux/tracepoint.h:221:25: note: in expansion of macro '__DO_TRACE'
     221 |                         __DO_TRACE(name,                                \
         |                         ^~~~~~~~~~
   include/linux/tracepoint.h:222:33: note: in expansion of macro 'TP_ARGS'
     222 |                                 TP_ARGS(args),                          \
         |                                 ^~~~~~~
   include/linux/tracepoint.h:257:9: note: in expansion of macro '__DECLARE_TRACE_RCU'
     257 |         __DECLARE_TRACE_RCU(name, PARAMS(proto), PARAMS(args),          \
         |         ^~~~~~~~~~~~~~~~~~~
   include/linux/tracepoint.h:257:50: note: in expansion of macro 'PARAMS'
     257 |         __DECLARE_TRACE_RCU(name, PARAMS(proto), PARAMS(args),          \
         |                                                  ^~~~~~
   include/linux/tracepoint.h:419:9: note: in expansion of macro '__DECLARE_TRACE'
     419 |         __DECLARE_TRACE(name, PARAMS(proto), PARAMS(args),              \
         |         ^~~~~~~~~~~~~~~
   include/linux/tracepoint.h:419:46: note: in expansion of macro 'PARAMS'
     419 |         __DECLARE_TRACE(name, PARAMS(proto), PARAMS(args),              \
         |                                              ^~~~~~
   include/linux/tracepoint.h:553:9: note: in expansion of macro 'DECLARE_TRACE'
     553 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
         |         ^~~~~~~~~~~~~
   include/linux/tracepoint.h:553:44: note: in expansion of macro 'PARAMS'
     553 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
         |                                            ^~~~~~
   fs/nfs/nfs4trace.h:2428:1: note: in expansion of macro 'TRACE_EVENT'
    2428 | TRACE_EVENT(nfs4_llseek,
         | ^~~~~~~~~~~
   fs/nfs/nfs4trace.h:2436:17: note: in expansion of macro 'TP_ARGS'
    2436 |                 TP_ARGS(inode, args, res, error),
         |                 ^~~~~~~
   fs/nfs/nfs4trace.h:2432:54: note: expected 'const struct nfs42_seek_res *' but argument is of type 'const struct nfs42_seek_res *'
    2432 |                         const struct nfs42_seek_res *res,
         |                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
   include/linux/tracepoint.h:242:39: note: in definition of macro '__DECLARE_TRACE'
     242 |         extern int __traceiter_##name(data_proto);                      \
         |                                       ^~~~~~~~~~
   include/linux/tracepoint.h:421:25: note: in expansion of macro 'PARAMS'
     421 |                         PARAMS(void *__data, proto))
         |                         ^~~~~~
   include/linux/tracepoint.h:553:9: note: in expansion of macro 'DECLARE_TRACE'
     553 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
         |         ^~~~~~~~~~~~~
   include/linux/tracepoint.h:553:29: note: in expansion of macro 'PARAMS'
     553 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
         |                             ^~~~~~
   fs/nfs/nfs4trace.h:2428:1: note: in expansion of macro 'TRACE_EVENT'
    2428 | TRACE_EVENT(nfs4_llseek,
         | ^~~~~~~~~~~
   fs/nfs/nfs4trace.h:2429:17: note: in expansion of macro 'TP_PROTO'
    2429 |                 TP_PROTO(
         |                 ^~~~~~~~
   fs/nfs/nfs4trace.h: At top level:
>> fs/nfs/nfs4trace.h:2432:38: warning: 'struct nfs42_seek_res' declared inside parameter list will not be visible outside of this definition or declaration
    2432 |                         const struct nfs42_seek_res *res,
         |                                      ^~~~~~~~~~~~~~
   include/linux/tracepoint.h:260:45: note: in definition of macro '__DECLARE_TRACE'
     260 |         register_trace_##name(void (*probe)(data_proto), void *data)    \
         |                                             ^~~~~~~~~~
   include/linux/tracepoint.h:421:25: note: in expansion of macro 'PARAMS'
     421 |                         PARAMS(void *__data, proto))
         |                         ^~~~~~
   include/linux/tracepoint.h:553:9: note: in expansion of macro 'DECLARE_TRACE'
     553 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
         |         ^~~~~~~~~~~~~
   include/linux/tracepoint.h:553:29: note: in expansion of macro 'PARAMS'
     553 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
         |                             ^~~~~~
   fs/nfs/nfs4trace.h:2428:1: note: in expansion of macro 'TRACE_EVENT'
    2428 | TRACE_EVENT(nfs4_llseek,
         | ^~~~~~~~~~~
   fs/nfs/nfs4trace.h:2429:17: note: in expansion of macro 'TP_PROTO'
    2429 |                 TP_PROTO(
         |                 ^~~~~~~~
>> fs/nfs/nfs4trace.h:2431:38: warning: 'struct nfs42_seek_args' declared inside parameter list will not be visible outside of this definition or declaration
    2431 |                         const struct nfs42_seek_args *args,
         |                                      ^~~~~~~~~~~~~~~
   include/linux/tracepoint.h:260:45: note: in definition of macro '__DECLARE_TRACE'
     260 |         register_trace_##name(void (*probe)(data_proto), void *data)    \
         |                                             ^~~~~~~~~~
   include/linux/tracepoint.h:421:25: note: in expansion of macro 'PARAMS'
     421 |                         PARAMS(void *__data, proto))
         |                         ^~~~~~
   include/linux/tracepoint.h:553:9: note: in expansion of macro 'DECLARE_TRACE'
     553 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
         |         ^~~~~~~~~~~~~
   include/linux/tracepoint.h:553:29: note: in expansion of macro 'PARAMS'
     553 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
         |                             ^~~~~~
   fs/nfs/nfs4trace.h:2428:1: note: in expansion of macro 'TRACE_EVENT'
    2428 | TRACE_EVENT(nfs4_llseek,
         | ^~~~~~~~~~~
   fs/nfs/nfs4trace.h:2429:17: note: in expansion of macro 'TP_PROTO'
    2429 |                 TP_PROTO(
         |                 ^~~~~~~~
>> fs/nfs/nfs4trace.h:2432:38: warning: 'struct nfs42_seek_res' declared inside parameter list will not be visible outside of this definition or declaration
    2432 |                         const struct nfs42_seek_res *res,
         |                                      ^~~~~~~~~~~~~~
   include/linux/tracepoint.h:266:50: note: in definition of macro '__DECLARE_TRACE'
     266 |         register_trace_prio_##name(void (*probe)(data_proto), void *data,\
         |                                                  ^~~~~~~~~~
   include/linux/tracepoint.h:421:25: note: in expansion of macro 'PARAMS'
     421 |                         PARAMS(void *__data, proto))
         |                         ^~~~~~
   include/linux/tracepoint.h:553:9: note: in expansion of macro 'DECLARE_TRACE'
     553 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
         |         ^~~~~~~~~~~~~
   include/linux/tracepoint.h:553:29: note: in expansion of macro 'PARAMS'
     553 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
         |                             ^~~~~~
   fs/nfs/nfs4trace.h:2428:1: note: in expansion of macro 'TRACE_EVENT'
    2428 | TRACE_EVENT(nfs4_llseek,
         | ^~~~~~~~~~~
   fs/nfs/nfs4trace.h:2429:17: note: in expansion of macro 'TP_PROTO'
    2429 |                 TP_PROTO(
         |                 ^~~~~~~~
>> fs/nfs/nfs4trace.h:2431:38: warning: 'struct nfs42_seek_args' declared inside parameter list will not be visible outside of this definition or declaration
    2431 |                         const struct nfs42_seek_args *args,
         |                                      ^~~~~~~~~~~~~~~
   include/linux/tracepoint.h:266:50: note: in definition of macro '__DECLARE_TRACE'
     266 |         register_trace_prio_##name(void (*probe)(data_proto), void *data,\
         |                                                  ^~~~~~~~~~
   include/linux/tracepoint.h:421:25: note: in expansion of macro 'PARAMS'
     421 |                         PARAMS(void *__data, proto))
         |                         ^~~~~~
   include/linux/tracepoint.h:553:9: note: in expansion of macro 'DECLARE_TRACE'
     553 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
         |         ^~~~~~~~~~~~~
   include/linux/tracepoint.h:553:29: note: in expansion of macro 'PARAMS'
     553 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
         |                             ^~~~~~
   fs/nfs/nfs4trace.h:2428:1: note: in expansion of macro 'TRACE_EVENT'
    2428 | TRACE_EVENT(nfs4_llseek,
         | ^~~~~~~~~~~
   fs/nfs/nfs4trace.h:2429:17: note: in expansion of macro 'TP_PROTO'
    2429 |                 TP_PROTO(
         |                 ^~~~~~~~
>> fs/nfs/nfs4trace.h:2432:38: warning: 'struct nfs42_seek_res' declared inside parameter list will not be visible outside of this definition or declaration
    2432 |                         const struct nfs42_seek_res *res,
         |                                      ^~~~~~~~~~~~~~
   include/linux/tracepoint.h:273:47: note: in definition of macro '__DECLARE_TRACE'
     273 |         unregister_trace_##name(void (*probe)(data_proto), void *data)  \
         |                                               ^~~~~~~~~~
   include/linux/tracepoint.h:421:25: note: in expansion of macro 'PARAMS'
     421 |                         PARAMS(void *__data, proto))
         |                         ^~~~~~
   include/linux/tracepoint.h:553:9: note: in expansion of macro 'DECLARE_TRACE'
     553 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
         |         ^~~~~~~~~~~~~
   include/linux/tracepoint.h:553:29: note: in expansion of macro 'PARAMS'
     553 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
         |                             ^~~~~~
   fs/nfs/nfs4trace.h:2428:1: note: in expansion of macro 'TRACE_EVENT'
    2428 | TRACE_EVENT(nfs4_llseek,
         | ^~~~~~~~~~~
   fs/nfs/nfs4trace.h:2429:17: note: in expansion of macro 'TP_PROTO'
    2429 |                 TP_PROTO(
         |                 ^~~~~~~~
>> fs/nfs/nfs4trace.h:2431:38: warning: 'struct nfs42_seek_args' declared inside parameter list will not be visible outside of this definition or declaration
    2431 |                         const struct nfs42_seek_args *args,
         |                                      ^~~~~~~~~~~~~~~
   include/linux/tracepoint.h:273:47: note: in definition of macro '__DECLARE_TRACE'
     273 |         unregister_trace_##name(void (*probe)(data_proto), void *data)  \
         |                                               ^~~~~~~~~~
   include/linux/tracepoint.h:421:25: note: in expansion of macro 'PARAMS'
     421 |                         PARAMS(void *__data, proto))
         |                         ^~~~~~
   include/linux/tracepoint.h:553:9: note: in expansion of macro 'DECLARE_TRACE'
     553 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
         |         ^~~~~~~~~~~~~
   include/linux/tracepoint.h:553:29: note: in expansion of macro 'PARAMS'
     553 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
         |                             ^~~~~~
   fs/nfs/nfs4trace.h:2428:1: note: in expansion of macro 'TRACE_EVENT'
    2428 | TRACE_EVENT(nfs4_llseek,
         | ^~~~~~~~~~~
   fs/nfs/nfs4trace.h:2429:17: note: in expansion of macro 'TP_PROTO'
    2429 |                 TP_PROTO(
         |                 ^~~~~~~~
>> fs/nfs/nfs4trace.h:2432:38: warning: 'struct nfs42_seek_res' declared inside parameter list will not be visible outside of this definition or declaration
    2432 |                         const struct nfs42_seek_res *res,
         |                                      ^~~~~~~~~~~~~~
   include/linux/tracepoint.h:279:53: note: in definition of macro '__DECLARE_TRACE'
     279 |         check_trace_callback_type_##name(void (*cb)(data_proto))        \
         |                                                     ^~~~~~~~~~
   include/linux/tracepoint.h:421:25: note: in expansion of macro 'PARAMS'
     421 |                         PARAMS(void *__data, proto))
         |                         ^~~~~~
   include/linux/tracepoint.h:553:9: note: in expansion of macro 'DECLARE_TRACE'
     553 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
         |         ^~~~~~~~~~~~~
   include/linux/tracepoint.h:553:29: note: in expansion of macro 'PARAMS'
     553 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
         |                             ^~~~~~
   fs/nfs/nfs4trace.h:2428:1: note: in expansion of macro 'TRACE_EVENT'
    2428 | TRACE_EVENT(nfs4_llseek,
         | ^~~~~~~~~~~
   fs/nfs/nfs4trace.h:2429:17: note: in expansion of macro 'TP_PROTO'
    2429 |                 TP_PROTO(
         |                 ^~~~~~~~
>> fs/nfs/nfs4trace.h:2431:38: warning: 'struct nfs42_seek_args' declared inside parameter list will not be visible outside of this definition or declaration
    2431 |                         const struct nfs42_seek_args *args,
         |                                      ^~~~~~~~~~~~~~~
   include/linux/tracepoint.h:279:53: note: in definition of macro '__DECLARE_TRACE'
     279 |         check_trace_callback_type_##name(void (*cb)(data_proto))        \
         |                                                     ^~~~~~~~~~
   include/linux/tracepoint.h:421:25: note: in expansion of macro 'PARAMS'
     421 |                         PARAMS(void *__data, proto))
         |                         ^~~~~~
   include/linux/tracepoint.h:553:9: note: in expansion of macro 'DECLARE_TRACE'
     553 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
         |         ^~~~~~~~~~~~~
   include/linux/tracepoint.h:553:29: note: in expansion of macro 'PARAMS'
     553 |         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
         |                             ^~~~~~
   fs/nfs/nfs4trace.h:2428:1: note: in expansion of macro 'TRACE_EVENT'
    2428 | TRACE_EVENT(nfs4_llseek,
         | ^~~~~~~~~~~
   fs/nfs/nfs4trace.h:2429:17: note: in expansion of macro 'TP_PROTO'
    2429 |                 TP_PROTO(
         |                 ^~~~~~~~
   fs/nfs/nfs4proc.c: In function 'nfs4_proc_create_session':
   fs/nfs/nfs4proc.c:9104:19: warning: variable 'ptr' set but not used [-Wunused-but-set-variable]
    9104 |         unsigned *ptr;
         |                   ^~~
   cc1: some warnings being treated as errors
..


vim +/__traceiter_nfs4_llseek +2436 fs/nfs/nfs4trace.h

  2422	
  2423	#define show_llseek_mode(what)			\
  2424		__print_symbolic(what,			\
  2425			{ NFS4_CONTENT_DATA, "DATA" },		\
  2426			{ NFS4_CONTENT_HOLE, "HOLE" })
  2427	
> 2428	TRACE_EVENT(nfs4_llseek,
  2429			TP_PROTO(
  2430				const struct inode *inode,
> 2431				const struct nfs42_seek_args *args,
> 2432				const struct nfs42_seek_res *res,
  2433				int error
  2434			),
  2435	
> 2436			TP_ARGS(inode, args, res, error),
  2437	
  2438			TP_STRUCT__entry(
  2439				__field(unsigned long, error)
  2440				__field(u32, fhandle)
  2441				__field(u32, fileid)
  2442				__field(dev_t, dev)
  2443				__field(int, stateid_seq)
  2444				__field(u32, stateid_hash)
  2445				__field(loff_t, offset_s)
  2446				__field(u32, what)
  2447				__field(loff_t, offset_r)
  2448				__field(u32, eof)
  2449			),
  2450	
  2451			TP_fast_assign(
  2452				const struct nfs_inode *nfsi = NFS_I(inode);
  2453				const struct nfs_fh *fh = args->sa_fh;
  2454	
  2455				__entry->fileid = nfsi->fileid;
  2456				__entry->dev = inode->i_sb->s_dev;
  2457				__entry->fhandle = nfs_fhandle_hash(fh);
  2458				__entry->offset_s = args->sa_offset;
  2459				__entry->error = error < 0 ? -error : 0;
  2460				__entry->stateid_seq =
  2461					be32_to_cpu(args->sa_stateid.seqid);
  2462				__entry->stateid_hash =
  2463					nfs_stateid_hash(&args->sa_stateid);
  2464				__entry->what = args->sa_what;
  2465				__entry->offset_r = error < 0 ? 0 : res->sr_offset;
  2466				__entry->eof = error < 0 ? 0 : res->sr_eof;
  2467			),
  2468	
  2469			TP_printk(
  2470				"error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x "
  2471				"stateid=%d:0x%08x offset_s=%llu what=%s "
  2472				"offset_r=%llu eof=%u",
  2473				-__entry->error,
  2474				show_nfsv4_errors(__entry->error),
  2475				MAJOR(__entry->dev), MINOR(__entry->dev),
  2476				(unsigned long long)__entry->fileid,
  2477				__entry->fhandle,
  2478				__entry->stateid_seq, __entry->stateid_hash,
  2479				__entry->offset_s,
  2480				show_llseek_mode(__entry->what),
  2481				__entry->offset_r,
  2482				__entry->eof
  2483			)
  2484	);
  2485	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
diff mbox series

Patch

diff --git a/fs/nfs/nfs42proc.c b/fs/nfs/nfs42proc.c
index a24349512ffe..87c0dcb8823b 100644
--- a/fs/nfs/nfs42proc.c
+++ b/fs/nfs/nfs42proc.c
@@ -678,6 +678,7 @@  static loff_t _nfs42_proc_llseek(struct file *filep,
 
 	status = nfs4_call_sync(server->client, server, &msg,
 				&args.seq_args, &res.seq_res, 0);
+	trace_nfs4_llseek(inode, &args, &res, status);
 	if (status == -ENOTSUPP)
 		server->caps &= ~NFS_CAP_SEEK;
 	if (status)
diff --git a/fs/nfs/nfs4trace.h b/fs/nfs/nfs4trace.h
index 7a2567aa2b86..81dcbfca7f74 100644
--- a/fs/nfs/nfs4trace.h
+++ b/fs/nfs/nfs4trace.h
@@ -2417,6 +2417,71 @@  TRACE_EVENT(ff_layout_commit_error,
 		)
 );
 
+TRACE_DEFINE_ENUM(NFS4_CONTENT_DATA);
+TRACE_DEFINE_ENUM(NFS4_CONTENT_HOLE);
+
+#define show_llseek_mode(what)			\
+	__print_symbolic(what,			\
+		{ NFS4_CONTENT_DATA, "DATA" },		\
+		{ NFS4_CONTENT_HOLE, "HOLE" })
+
+TRACE_EVENT(nfs4_llseek,
+		TP_PROTO(
+			const struct inode *inode,
+			const struct nfs42_seek_args *args,
+			const struct nfs42_seek_res *res,
+			int error
+		),
+
+		TP_ARGS(inode, args, res, error),
+
+		TP_STRUCT__entry(
+			__field(unsigned long, error)
+			__field(u32, fhandle)
+			__field(u32, fileid)
+			__field(dev_t, dev)
+			__field(int, stateid_seq)
+			__field(u32, stateid_hash)
+			__field(loff_t, offset_s)
+			__field(u32, what)
+			__field(loff_t, offset_r)
+			__field(u32, eof)
+		),
+
+		TP_fast_assign(
+			const struct nfs_inode *nfsi = NFS_I(inode);
+			const struct nfs_fh *fh = args->sa_fh;
+
+			__entry->fileid = nfsi->fileid;
+			__entry->dev = inode->i_sb->s_dev;
+			__entry->fhandle = nfs_fhandle_hash(fh);
+			__entry->offset_s = args->sa_offset;
+			__entry->error = error < 0 ? -error : 0;
+			__entry->stateid_seq =
+				be32_to_cpu(args->sa_stateid.seqid);
+			__entry->stateid_hash =
+				nfs_stateid_hash(&args->sa_stateid);
+			__entry->what = args->sa_what;
+			__entry->offset_r = error < 0 ? 0 : res->sr_offset;
+			__entry->eof = error < 0 ? 0 : res->sr_eof;
+		),
+
+		TP_printk(
+			"error=%ld (%s) fileid=%02x:%02x:%llu fhandle=0x%08x "
+			"stateid=%d:0x%08x offset_s=%llu what=%s "
+			"offset_r=%llu eof=%u",
+			-__entry->error,
+			show_nfsv4_errors(__entry->error),
+			MAJOR(__entry->dev), MINOR(__entry->dev),
+			(unsigned long long)__entry->fileid,
+			__entry->fhandle,
+			__entry->stateid_seq, __entry->stateid_hash,
+			__entry->offset_s,
+			show_llseek_mode(__entry->what),
+			__entry->offset_r,
+			__entry->eof
+		)
+);
 
 #endif /* CONFIG_NFS_V4_1 */