openzfs / zfs

OpenZFS on Linux and FreeBSD
https://openzfs.github.io/openzfs-docs
Other
10.4k stars 1.72k forks source link

Kernel 6.9.8 trace_event_raw_event_zfs_dbuf_class function error, against ZFS HEAD, on kernel build #16342

Open thehaven opened 1 month ago

thehaven commented 1 month ago

System information

Type Version/Name
Distribution Name Gentoo
Distribution Version amd64/23.0/systemd
Kernel Version linux-6.9.8-gentoo
Architecture x86_64
OpenZFS Version commit 4367312760612cb755acfc218ffeda8eb35ce509 (HEAD -> master, origin/master, origin/HEAD)

Describe the problem you're observing

I am statically compling zfs into linux-6.9.8-gentoo as per this script: https://gist.github.com/thehaven/6946427 and getting the following error (including output from second run for brevity):

saratoga /usr/src/linux # make -j 81                                                                                                      17:33:22 [38/7421]
mkdir -p /usr/src/linux-6.9.8-gentoo/tools/objtool && make O=/usr/src/linux-6.9.8-gentoo subdir=tools/objtool --no-print-directory -C objtool
  INSTALL libsubcmd_headers
  CALL    scripts/checksyscalls.sh
  CC      fs/zfs/os/linux/zfs/trace.o
In file included from ./include/trace/define_trace.h:102,
                 from ./include/zfs/os/linux/zfs/sys/trace_dbuf.h:158,
                 from fs/zfs/os/linux/zfs/trace.c:45:
./include/zfs/os/linux/zfs/sys/trace_dbuf.h: In function ‘trace_event_raw_event_zfs_dbuf_class’:
./include/trace/stages/stage6_event_callback.h:9:17: error: expected ‘;’ before ‘entry’
    9 | #define __entry entry
      |                 ^~~~~
./include/trace/trace_events.h:402:11: note: in definition of macro ‘DECLARE_EVENT_CLASS’
  402 |         { assign; }                                                     \
      |           ^~~~~~
./include/zfs/os/linux/zfs/sys/trace_dbuf.h:111:9: note: in expansion of macro ‘TP_fast_assign’
  111 |         TP_fast_assign(DBUF_TP_FAST_ASSIGN),
      |         ^~~~~~~~~~~~~~
./include/zfs/os/linux/zfs/sys/trace_dbuf.h:84:17: note: in expansion of macro ‘__entry’
   84 |                 __entry->ds_object = 0;                                 \
      |                 ^~~~~~~
./include/zfs/os/linux/zfs/sys/trace_dbuf.h:111:24: note: in expansion of macro ‘DBUF_TP_FAST_ASSIGN’
  111 |         TP_fast_assign(DBUF_TP_FAST_ASSIGN),
      |                        ^~~~~~~~~~~~~~~~~~~
./include/zfs/os/linux/zfs/sys/trace_dbuf.h: In function ‘trace_event_raw_event_zfs_dbuf_state_class’:
./include/trace/stages/stage6_event_callback.h:9:17: error: expected ‘;’ before ‘entry’
    9 | #define __entry entry
      |                 ^~~~~
./include/trace/trace_events.h:402:11: note: in definition of macro ‘DECLARE_EVENT_CLASS’
  402 |         { assign; }                                                     \
      |           ^~~~~~
./include/zfs/os/linux/zfs/sys/trace_dbuf.h:119:9: note: in expansion of macro ‘TP_fast_assign’
  119 |         TP_fast_assign(DBUF_TP_FAST_ASSIGN),
      |         ^~~~~~~~~~~~~~
./include/zfs/os/linux/zfs/sys/trace_dbuf.h:84:17: note: in expansion of macro ‘__entry’
   84 |                 __entry->ds_object = 0;                                 \
      |                 ^~~~~~~
./include/zfs/os/linux/zfs/sys/trace_dbuf.h:119:24: note: in expansion of macro ‘DBUF_TP_FAST_ASSIGN’
  119 |         TP_fast_assign(DBUF_TP_FAST_ASSIGN),
      |                        ^~~~~~~~~~~~~~~~~~~
./include/zfs/os/linux/zfs/sys/trace_dbuf.h: In function ‘trace_event_raw_event_zfs_dbuf_evict_one_class’:
./include/trace/stages/stage6_event_callback.h:9:17: error: expected ‘;’ before ‘entry’
    9 | #define __entry entry
      |                 ^~~~~
./include/trace/trace_events.h:402:11: note: in definition of macro ‘DECLARE_EVENT_CLASS’
  402 |         { assign; }                                                     \
      |           ^~~~~~
./include/zfs/os/linux/zfs/sys/trace_dbuf.h:141:9: note: in expansion of macro ‘TP_fast_assign’
  141 |         TP_fast_assign(DBUF_TP_FAST_ASSIGN),
      |         ^~~~~~~~~~~~~~
./include/zfs/os/linux/zfs/sys/trace_dbuf.h:84:17: note: in expansion of macro ‘__entry’
   84 |                 __entry->ds_object = 0;                                 \
      |                 ^~~~~~~
./include/zfs/os/linux/zfs/sys/trace_dbuf.h:141:24: note: in expansion of macro ‘DBUF_TP_FAST_ASSIGN’
  141 |         TP_fast_assign(DBUF_TP_FAST_ASSIGN),
      |                        ^~~~~~~~~~~~~~~~~~~
In file included from ./include/trace/define_trace.h:103:
./include/zfs/os/linux/zfs/sys/trace_dbuf.h: In function ‘perf_trace_zfs_dbuf_class’:
./include/trace/stages/stage6_event_callback.h:9:17: error: expected ‘;’ before ‘entry’
    9 | #define __entry entry
      |                 ^~~~~
./include/trace/perf.h:51:11: note: in definition of macro ‘DECLARE_EVENT_CLASS’
   51 |         { assign; }                                                     \
      |           ^~~~~~
./include/zfs/os/linux/zfs/sys/trace_dbuf.h:111:9: note: in expansion of macro ‘TP_fast_assign’
  111 |         TP_fast_assign(DBUF_TP_FAST_ASSIGN),
      |         ^~~~~~~~~~~~~~
./include/zfs/os/linux/zfs/sys/trace_dbuf.h:84:17: note: in expansion of macro ‘__entry’
   84 |                 __entry->ds_object = 0;                                 \
      |                 ^~~~~~~
./include/zfs/os/linux/zfs/sys/trace_dbuf.h:111:24: note: in expansion of macro ‘DBUF_TP_FAST_ASSIGN’
  111 |         TP_fast_assign(DBUF_TP_FAST_ASSIGN),
      |                        ^~~~~~~~~~~~~~~~~~~
./include/zfs/os/linux/zfs/sys/trace_dbuf.h: In function ‘perf_trace_zfs_dbuf_state_class’:
./include/trace/stages/stage6_event_callback.h:9:17: error: expected ‘;’ before ‘entry’
    9 | #define __entry entry
      |                 ^~~~~
./include/trace/perf.h:51:11: note: in definition of macro ‘DECLARE_EVENT_CLASS’
   51 |         { assign; }                                                     \
      |           ^~~~~~
./include/zfs/os/linux/zfs/sys/trace_dbuf.h:119:9: note: in expansion of macro ‘TP_fast_assign’
  119 |         TP_fast_assign(DBUF_TP_FAST_ASSIGN),
      |         ^~~~~~~~~~~~~~
./include/zfs/os/linux/zfs/sys/trace_dbuf.h:84:17: note: in expansion of macro ‘__entry’
   84 |                 __entry->ds_object = 0;                                 \
      |                 ^~~~~~~
./include/zfs/os/linux/zfs/sys/trace_dbuf.h:119:24: note: in expansion of macro ‘DBUF_TP_FAST_ASSIGN’
  119 |         TP_fast_assign(DBUF_TP_FAST_ASSIGN),
      |                        ^~~~~~~~~~~~~~~~~~~
./include/zfs/os/linux/zfs/sys/trace_dbuf.h: In function ‘perf_trace_zfs_dbuf_evict_one_class’:
./include/trace/stages/stage6_event_callback.h:9:17: error: expected ‘;’ before ‘entry’
    9 | #define __entry entry
      |                 ^~~~~
./include/trace/perf.h:51:11: note: in definition of macro ‘DECLARE_EVENT_CLASS’
   51 |         { assign; }                                                     \
      |           ^~~~~~
./include/zfs/os/linux/zfs/sys/trace_dbuf.h:141:9: note: in expansion of macro ‘TP_fast_assign’
  141 |         TP_fast_assign(DBUF_TP_FAST_ASSIGN),
      |         ^~~~~~~~~~~~~~
./include/zfs/os/linux/zfs/sys/trace_dbuf.h:84:17: note: in expansion of macro ‘__entry’
   84 |                 __entry->ds_object = 0;                                 \
      |                 ^~~~~~~
./include/zfs/os/linux/zfs/sys/trace_dbuf.h:141:24: note: in expansion of macro ‘DBUF_TP_FAST_ASSIGN’
  141 |         TP_fast_assign(DBUF_TP_FAST_ASSIGN),
      |                        ^~~~~~~~~~~~~~~~~~~
make[4]: *** [scripts/Makefile.build:244: fs/zfs/os/linux/zfs/trace.o] Error 1
make[3]: *** [scripts/Makefile.build:485: fs/zfs] Error 2
make[2]: *** [scripts/Makefile.build:485: fs] Error 2
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [/usr/src/linux-6.9.8-gentoo/Makefile:1918: .] Error 2
make: *** [Makefile:240: __sub-make] Error 2

Describe how to reproduce the problem

Its a standard kernel build with no changes to the config from my existing running kernel (6.8.7-gentoo). I run the script linked above to statically compile zfs into linux-6.9.8-gentoo and get the failure indicated.

Thanks in advance for your time, if you need any more info I'm happy to provide.

tonyhutter commented 1 month ago

Does f7d8b1333699957de59d72fc57c9a771951f6582 fix the build?

thehaven commented 1 month ago

Does f7d8b13 fix the build?

Tested against linux-6.9.8-gentoo and worked fine. Thanks.

tonyhutter commented 1 month ago

Does f7d8b13 fix the build?

Tested against linux-6.9.8-gentoo and worked fine. Thanks.

I've included that patch in the upcoming zfs-2.2.5 release (https://github.com/openzfs/zfs/pull/16359).