[openeuler:OLK-6.6 3098/3098] kernel/bpf-rvi/common_kfuncs.c:75:18: warning: no previous prototype for 'bpf_si_memswinfo'
tree: https://gitee.com/openeuler/kernel.git OLK-6.6 head: faa195bad3afed3c326917fb4cd36e0bd311220c commit: b3aa368c1f9f8f3acee4703cfebb30e7a909df9f [3098/3098] bpf-rvi: Add bpf_si_memswinfo() kfunc config: x86_64-randconfig-001-20251104 (https://download.01.org/0day-ci/archive/20251105/202511050050.0VfB10bw-lkp@i...) compiler: gcc-14 (Debian 14.2.0-19) 14.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251105/202511050050.0VfB10bw-lkp@i...) 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/202511050050.0VfB10bw-lkp@intel.com/ All warnings (new ones prefixed by >>): kernel/bpf-rvi/common_kfuncs.c:18:32: warning: no previous prototype for 'bpf_mem_cgroup_from_task' [-Wmissing-prototypes] 18 | __bpf_kfunc struct mem_cgroup *bpf_mem_cgroup_from_task(struct task_struct *p) | ^~~~~~~~~~~~~~~~~~~~~~~~ kernel/bpf-rvi/common_kfuncs.c:27:35: warning: no previous prototype for 'bpf_task_active_pid_ns' [-Wmissing-prototypes] 27 | __bpf_kfunc struct pid_namespace *bpf_task_active_pid_ns(struct task_struct *task) | ^~~~~~~~~~~~~~~~~~~~~~ kernel/bpf-rvi/common_kfuncs.c:32:17: warning: no previous prototype for 'bpf_pidns_nr_tasks' [-Wmissing-prototypes] 32 | __bpf_kfunc u64 bpf_pidns_nr_tasks(struct pid_namespace *ns) | ^~~~~~~~~~~~~~~~~~ kernel/bpf-rvi/common_kfuncs.c:46:17: warning: no previous prototype for 'bpf_pidns_last_pid' [-Wmissing-prototypes] 46 | __bpf_kfunc u32 bpf_pidns_last_pid(struct pid_namespace *ns) | ^~~~~~~~~~~~~~~~~~
kernel/bpf-rvi/common_kfuncs.c:75:18: warning: no previous prototype for 'bpf_si_memswinfo' [-Wmissing-prototypes] 75 | __bpf_kfunc void bpf_si_memswinfo(struct bpf_sysinfo *bsi) | ^~~~~~~~~~~~~~~~
vim +/bpf_si_memswinfo +75 kernel/bpf-rvi/common_kfuncs.c 22 23 /* 24 * Loadavg related kfuncs 25 */ 26
27 __bpf_kfunc struct pid_namespace *bpf_task_active_pid_ns(struct task_struct *task) 28 { 29 return task_active_pid_ns(task); 30 } 31 32 __bpf_kfunc u64 bpf_pidns_nr_tasks(struct pid_namespace *ns) 33 { 34 struct pid_iter iter = {}; 35 u32 nr_running = 0, nr_threads = 0; 36 37 for_each_task_in_pidns(iter, ns) { 38 nr_threads++; 39 if (task_is_running(iter.task)) 40 nr_running++; 41 } 42 43 return (u64)nr_running << 32 | nr_threads; 44 } 45 46 __bpf_kfunc u32 bpf_pidns_last_pid(struct pid_namespace *ns) 47 { 48 return idr_get_cursor(&ns->idr) - 1; 49 } 50 51 /* 52 * Swaps related kfuncs 53 */ 54 55 /* 56 * no padding member "_f" compared to struct sysinfo, because sizeof(_f) 57 * maybe zero and not supported by bpf_verifier. 58 */ 59 struct bpf_sysinfo { 60 __kernel_long_t uptime; /* Seconds since boot */ 61 __kernel_ulong_t loads[3]; /* 1, 5, and 15 minute load averages */ 62 __kernel_ulong_t totalram; /* Total usable main memory size */ 63 __kernel_ulong_t freeram; /* Available memory size */ 64 __kernel_ulong_t sharedram; /* Amount of shared memory */ 65 __kernel_ulong_t bufferram; /* Memory used by buffers */ 66 __kernel_ulong_t totalswap; /* Total swap space size */ 67 __kernel_ulong_t freeswap; /* swap space still available */ 68 __u16 procs; /* Number of current processes */ 69 __u16 pad; /* Explicit padding for m68k */ 70 __kernel_ulong_t totalhigh; /* Total high memory size */ 71 __kernel_ulong_t freehigh; /* Available high memory size */ 72 __u32 mem_unit; /* Memory unit size in bytes */ 73 }; 74 75 __bpf_kfunc void bpf_si_memswinfo(struct bpf_sysinfo *bsi) 76 { 77 struct sysinfo *si = (struct sysinfo *)bsi; 78 79 if (si) { 80 si_meminfo(si); 81 si_swapinfo(si); 82 } 83 } 84
-- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
participants (1)
-
kernel test robot