Re: [PATCH] ftrace: Show subops in enabled_functions

From: kernel test robot
Date: Thu Apr 10 2025 - 11:47:55 EST


Hi Steven,

kernel test robot noticed the following build errors:

[auto build test ERROR on trace/for-next]
[also build test ERROR on linus/master v6.15-rc1 next-20250410]
[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#_base_tree_information]

url: https://github.com/intel-lab-lkp/linux/commits/Steven-Rostedt/ftrace-Show-subops-in-enabled_functions/20250409-214345
base: https://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace for-next
patch link: https://lore.kernel.org/r/20250409094226.23f75293%40gandalf.local.home
patch subject: [PATCH] ftrace: Show subops in enabled_functions
config: i386-buildonly-randconfig-001-20250410 (https://download.01.org/0day-ci/archive/20250410/202504102339.KxLwdUFJ-lkp@xxxxxxxxx/config)
compiler: clang version 20.1.2 (https://github.com/llvm/llvm-project 58df0ef89dd64126512e4ee27b4ac3fd8ddf6247)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250410/202504102339.KxLwdUFJ-lkp@xxxxxxxxx/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202504102339.KxLwdUFJ-lkp@xxxxxxxxx/

All errors (new ones prefixed by >>):

>> kernel/trace/ftrace.c:4342:11: error: incomplete definition of type 'struct fgraph_ops'
4342 | gops = container_of(subops, struct fgraph_ops, ops);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/container_of.h:20:47: note: expanded from macro 'container_of'
20 | static_assert(__same_type(*(ptr), ((type *)0)->member) || \
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
21 | __same_type(*(ptr), void), \
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
22 | "pointer type mismatch in container_of()"); \
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/compiler_types.h:483:74: note: expanded from macro '__same_type'
483 | #define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b))
| ^
include/linux/build_bug.h:77:50: note: expanded from macro 'static_assert'
77 | #define static_assert(expr, ...) __static_assert(expr, ##__VA_ARGS__, #expr)
| ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:78:56: note: expanded from macro '__static_assert'
78 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
| ^~~~
include/linux/ftrace.h:1158:8: note: forward declaration of 'struct fgraph_ops'
1158 | struct fgraph_ops;
| ^
>> kernel/trace/ftrace.c:4342:11: error: offsetof of incomplete type 'struct fgraph_ops'
4342 | gops = container_of(subops, struct fgraph_ops, ops);
| ^ ~~~~~~
include/linux/container_of.h:23:21: note: expanded from macro 'container_of'
23 | ((type *)(__mptr - offsetof(type, member))); })
| ^ ~~~~
include/linux/stddef.h:16:32: note: expanded from macro 'offsetof'
16 | #define offsetof(TYPE, MEMBER) __builtin_offsetof(TYPE, MEMBER)
| ^ ~~~~
include/linux/ftrace.h:1158:8: note: forward declaration of 'struct fgraph_ops'
1158 | struct fgraph_ops;
| ^
kernel/trace/ftrace.c:4344:20: error: incomplete definition of type 'struct fgraph_ops'
4344 | (void *)gops->entryfunc,
| ~~~~^
include/linux/ftrace.h:1158:8: note: forward declaration of 'struct fgraph_ops'
1158 | struct fgraph_ops;
| ^
kernel/trace/ftrace.c:4345:20: error: incomplete definition of type 'struct fgraph_ops'
4345 | (void *)gops->retfunc);
| ~~~~^
include/linux/ftrace.h:1158:8: note: forward declaration of 'struct fgraph_ops'
1158 | struct fgraph_ops;
| ^
4 errors generated.


vim +4342 kernel/trace/ftrace.c

4325
4326 static void print_subops(struct seq_file *m, struct ftrace_ops *ops, struct dyn_ftrace *rec)
4327 {
4328 struct ftrace_ops *subops;
4329 bool first = true;
4330
4331 list_for_each_entry(subops, &ops->subop_list, list) {
4332 if (!((subops->flags & FTRACE_OPS_FL_ENABLED) &&
4333 hash_contains_ip(rec->ip, subops->func_hash)))
4334 continue;
4335 if (first) {
4336 seq_printf(m, "\tsubops:");
4337 first = false;
4338 }
4339 if (subops->flags & FTRACE_OPS_FL_GRAPH) {
4340 struct fgraph_ops *gops;
4341
> 4342 gops = container_of(subops, struct fgraph_ops, ops);
4343 seq_printf(m, " {ent:%pS ret:%pS}",
4344 (void *)gops->entryfunc,
4345 (void *)gops->retfunc);
4346 continue;
4347 }
4348 if (subops->trampoline) {
4349 seq_printf(m, " {%pS (%pS)}",
4350 (void *)subops->trampoline,
4351 (void *)subops->func);
4352 add_trampoline_func(m, subops, rec);
4353 } else {
4354 seq_printf(m, " {%pS}",
4355 (void *)subops->func);
4356 }
4357 }
4358 }
4359

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki