Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
* kernel/bpf/helpers.c:2893:60: warning: declaration of 'enum psi_states' will not be visible outside of this function
@ 2026-05-09 20:36 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2026-05-09 20:36 UTC (permalink / raw)
  To: Vernon Yang; +Cc: llvm, oe-kbuild-all, 0day robot

tree:   https://github.com/intel-lab-lkp/linux/commits/Vernon-Yang/psi-add-psi_group_flush_stats-function/20260509-210713
head:   4a4580a71f5884e16d331476b601322cc2d41af7
commit: edf653aa3964af51ae2f2b180bcb0f6cfa26c8f7 bpf: add bpf_cgroup_{flush_stats,stall} function
date:   7 hours ago
config: x86_64-kexec (https://download.01.org/0day-ci/archive/20260509/202605092231.VD6i30e4-lkp@intel.com/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260509/202605092231.VD6i30e4-lkp@intel.com/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@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202605092231.VD6i30e4-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> kernel/bpf/helpers.c:2893:60: warning: declaration of 'enum psi_states' will not be visible outside of this function [-Wvisibility]
    2893 | __bpf_kfunc u64 bpf_cgroup_stall(struct cgroup *cgrp, enum psi_states states)
         |                                                            ^
   kernel/bpf/helpers.c:2893:71: error: variable has incomplete type 'enum psi_states'
    2893 | __bpf_kfunc u64 bpf_cgroup_stall(struct cgroup *cgrp, enum psi_states states)
         |                                                                       ^
   kernel/bpf/helpers.c:2893:60: note: forward declaration of 'enum psi_states'
    2893 | __bpf_kfunc u64 bpf_cgroup_stall(struct cgroup *cgrp, enum psi_states states)
         |                                                            ^
   kernel/bpf/helpers.c:2897:40: error: use of undeclared identifier 'NR_PSI_STATES'; did you mean 'NR_NODE_STATES'?
    2897 |         if (unlikely(!group || (u32)states >= NR_PSI_STATES - 1))
         |                                               ^~~~~~~~~~~~~
         |                                               NR_NODE_STATES
   include/linux/compiler.h:77:42: note: expanded from macro 'unlikely'
      77 | # define unlikely(x)    __builtin_expect(!!(x), 0)
         |                                             ^
   include/linux/nodemask.h:396:2: note: 'NR_NODE_STATES' declared here
     396 |         NR_NODE_STATES
         |         ^
   kernel/bpf/helpers.c:2900:24: error: no member named 'total' in 'struct psi_group'
    2900 |         return div_u64(group->total[PSI_AVGS][states], NSEC_PER_MSEC);
         |                        ~~~~~  ^
   kernel/bpf/helpers.c:2900:30: error: use of undeclared identifier 'PSI_AVGS'
    2900 |         return div_u64(group->total[PSI_AVGS][states], NSEC_PER_MSEC);
         |                                     ^
   kernel/bpf/helpers.c:2914:2: error: call to undeclared function 'psi_group_flush_stats'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
    2914 |         psi_group_flush_stats(group);
         |         ^
   1 warning and 5 errors generated.


vim +2893 kernel/bpf/helpers.c

  2885	
  2886	/**
  2887	 * bpf_cgroup_stall - acquire the total stall time of cgroup
  2888	 * @cgrp: cgroup struct
  2889	 * @states: psi states
  2890	 *
  2891	 * Return the total stall time.
  2892	 */
> 2893	__bpf_kfunc u64 bpf_cgroup_stall(struct cgroup *cgrp, enum psi_states states)
  2894	{
  2895		struct psi_group *group = cgroup_psi(cgrp);
  2896	
  2897		if (unlikely(!group || (u32)states >= NR_PSI_STATES - 1))
  2898			return (u64)-1;
  2899	
  2900		return div_u64(group->total[PSI_AVGS][states], NSEC_PER_MSEC);
  2901	}
  2902	

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-05-09 20:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-09 20:36 kernel/bpf/helpers.c:2893:60: warning: declaration of 'enum psi_states' will not be visible outside of this function kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox