[peterz-queue:perf/wip.rewrite 5/5] kernel/events/core.c:846:3: error: 'continue' statement not in loop statement

From: kernel test robot
Date: Mon Aug 22 2022 - 16:02:35 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git perf/wip.rewrite
head: 596b8cc92a97fa8defbff896dc9baedef441b983
commit: 596b8cc92a97fa8defbff896dc9baedef441b983 [5/5] Signed-off-by: Peter Zijlstra (Intel) <peterz@xxxxxxxxxxxxx>
config: x86_64-randconfig-a004-20220822 (https://download.01.org/0day-ci/archive/20220823/202208230329.okV9Yjck-lkp@xxxxxxxxx/config)
compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project f28c006a5895fc0e329fe15fead81e37457cb1d1)
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://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git/commit/?id=596b8cc92a97fa8defbff896dc9baedef441b983
git remote add peterz-queue https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git
git fetch --no-tags peterz-queue perf/wip.rewrite
git checkout 596b8cc92a97fa8defbff896dc9baedef441b983
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All errors (new ones prefixed by >>):

>> kernel/events/core.c:846:3: error: 'continue' statement not in loop statement
continue;
^
kernel/events/core.c:4220:29: warning: variable 'task_ctx' set but not used [-Wunused-but-set-variable]
struct perf_event_context *task_ctx = NULL;
^
kernel/events/core.c:4790:1: warning: no previous prototype for function 'find_get_pmu_context' [-Wmissing-prototypes]
find_get_pmu_context(struct pmu *pmu, struct perf_event_context *ctx,
^
kernel/events/core.c:4789:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
struct perf_event_pmu_context *
^
static
kernel/events/core.c:12029:2: error: call to undeclared function 'mutex_lock_double'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
mutex_lock_double(&event->mmap_mutex, &output_event->mmap_mutex);
^
2 warnings and 2 errors generated.


vim +/continue +846 kernel/events/core.c

e5d1367f17ba6a kernel/perf_event.c Stephane Eranian 2011-02-14 831
e5d1367f17ba6a kernel/perf_event.c Stephane Eranian 2011-02-14 832 /*
e5d1367f17ba6a kernel/perf_event.c Stephane Eranian 2011-02-14 833 * reschedule events based on the cgroup constraint of task.
e5d1367f17ba6a kernel/perf_event.c Stephane Eranian 2011-02-14 834 */
96492a6c558acb kernel/events/core.c Chengming Zhou 2022-03-29 835 static void perf_cgroup_switch(struct task_struct *task)
e5d1367f17ba6a kernel/perf_event.c Stephane Eranian 2011-02-14 836 {
596b8cc92a97fa kernel/events/core.c Peter Zijlstra 2022-06-15 837 struct perf_cpu_context *cpuctx = this_cpu_ptr(&cpu_context);
96492a6c558acb kernel/events/core.c Chengming Zhou 2022-03-29 838 struct perf_cgroup *cgrp;
058fe1c0440e68 kernel/events/core.c David Carrillo-Cisneros 2017-01-18 839 struct list_head *list;
e5d1367f17ba6a kernel/perf_event.c Stephane Eranian 2011-02-14 840 unsigned long flags;
e5d1367f17ba6a kernel/perf_event.c Stephane Eranian 2011-02-14 841
96492a6c558acb kernel/events/core.c Chengming Zhou 2022-03-29 842 cgrp = perf_cgroup_from_task(task, NULL);
96492a6c558acb kernel/events/core.c Chengming Zhou 2022-03-29 843
058fe1c0440e68 kernel/events/core.c David Carrillo-Cisneros 2017-01-18 844 WARN_ON_ONCE(cpuctx->ctx.nr_cgroups == 0);
96492a6c558acb kernel/events/core.c Chengming Zhou 2022-03-29 845 if (READ_ONCE(cpuctx->cgrp) == cgrp)
96492a6c558acb kernel/events/core.c Chengming Zhou 2022-03-29 @846 continue;
e5d1367f17ba6a kernel/perf_event.c Stephane Eranian 2011-02-14 847
facc43071cc0d4 kernel/events/core.c Peter Zijlstra 2011-04-09 848 perf_ctx_lock(cpuctx, cpuctx->task_ctx);
6a606214738273 kernel/events/core.c Peter Zijlstra 2022-01-13 849 perf_ctx_disable(&cpuctx->ctx);
e5d1367f17ba6a kernel/perf_event.c Stephane Eranian 2011-02-14 850
6a606214738273 kernel/events/core.c Peter Zijlstra 2022-01-13 851 ctx_sched_out(&cpuctx->ctx, EVENT_ALL);
e5d1367f17ba6a kernel/perf_event.c Stephane Eranian 2011-02-14 852 /*
e5d1367f17ba6a kernel/perf_event.c Stephane Eranian 2011-02-14 853 * must not be done before ctxswout due
96492a6c558acb kernel/events/core.c Chengming Zhou 2022-03-29 854 * to update_cgrp_time_from_cpuctx() in
96492a6c558acb kernel/events/core.c Chengming Zhou 2022-03-29 855 * ctx_sched_out()
e5d1367f17ba6a kernel/perf_event.c Stephane Eranian 2011-02-14 856 */
96492a6c558acb kernel/events/core.c Chengming Zhou 2022-03-29 857 cpuctx->cgrp = cgrp;
95cf59ea72331d kernel/events/core.c Peter Zijlstra 2012-10-02 858 /*
95cf59ea72331d kernel/events/core.c Peter Zijlstra 2012-10-02 859 * set cgrp before ctxsw in to allow
a0827713e298d0 kernel/events/core.c Chengming Zhou 2022-03-29 860 * perf_cgroup_set_timestamp() in ctx_sched_in()
a0827713e298d0 kernel/events/core.c Chengming Zhou 2022-03-29 861 * to not have to pass task around
e5d1367f17ba6a kernel/perf_event.c Stephane Eranian 2011-02-14 862 */
6a606214738273 kernel/events/core.c Peter Zijlstra 2022-01-13 863 ctx_sched_in(&cpuctx->ctx, EVENT_ALL);
96492a6c558acb kernel/events/core.c Chengming Zhou 2022-03-29 864
6a606214738273 kernel/events/core.c Peter Zijlstra 2022-01-13 865 perf_ctx_enable(&cpuctx->ctx);
facc43071cc0d4 kernel/events/core.c Peter Zijlstra 2011-04-09 866 perf_ctx_unlock(cpuctx, cpuctx->task_ctx);
facc43071cc0d4 kernel/events/core.c Peter Zijlstra 2011-04-09 867 }
e5d1367f17ba6a kernel/perf_event.c Stephane Eranian 2011-02-14 868

:::::: The code at line 846 was first introduced by commit
:::::: 96492a6c558acb56124844d1409d9ef8624a0322 perf/core: Fix perf_cgroup_switch()

:::::: TO: Chengming Zhou <zhouchengming@xxxxxxxxxxxxx>
:::::: CC: Peter Zijlstra <peterz@xxxxxxxxxxxxx>

--
0-DAY CI Kernel Test Service
https://01.org/lkp