All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [peterz-queue:perf/core 10/10] kernel/events/core.c:3831:30: warning: 'cpuctx' is used uninitialized in this function
@ 2021-06-22 22:42 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2021-06-22 22:42 UTC (permalink / raw
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 3234 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git perf/core
head:   a918097a296b40b4e4f7a75edf4380a293b84eb5
commit: a918097a296b40b4e4f7a75edf4380a293b84eb5 [10/10] perf: Fix task context PMU for Hetero
config: nds32-randconfig-r002-20210622 (attached as .config)
compiler: nds32le-linux-gcc (GCC) 9.3.0
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=a918097a296b40b4e4f7a75edf4380a293b84eb5
        git remote add peterz-queue https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git
        git fetch --no-tags peterz-queue perf/core
        git checkout a918097a296b40b4e4f7a75edf4380a293b84eb5
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=nds32 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   kernel/events/core.c: In function 'perf_event_context_sched_in':
>> kernel/events/core.c:3831:30: warning: 'cpuctx' is used uninitialized in this function [-Wuninitialized]
    3831 |  pmu = ctx->pmu = cpuctx->ctx.pmu;
         |                   ~~~~~~~~~~~^~~~


vim +/cpuctx +3831 kernel/events/core.c

  3820	
  3821	static void perf_event_context_sched_in(struct perf_event_context *ctx,
  3822						struct task_struct *task)
  3823	{
  3824		struct perf_cpu_context *cpuctx;
  3825		struct pmu *pmu;
  3826	
  3827		/*
  3828		 * HACK: for HETEROGENEOUS the task context might have switched to a
  3829		 * different PMU, force (re)set the context,
  3830		 */
> 3831		pmu = ctx->pmu = cpuctx->ctx.pmu;
  3832	
  3833		cpuctx = __get_cpu_context(ctx);
  3834		if (cpuctx->task_ctx == ctx) {
  3835			if (cpuctx->sched_cb_usage)
  3836				__perf_pmu_sched_task(cpuctx, true);
  3837			return;
  3838		}
  3839	
  3840		perf_ctx_lock(cpuctx, ctx);
  3841		/*
  3842		 * We must check ctx->nr_events while holding ctx->lock, such
  3843		 * that we serialize against perf_install_in_context().
  3844		 */
  3845		if (!ctx->nr_events)
  3846			goto unlock;
  3847	
  3848		perf_pmu_disable(pmu);
  3849		/*
  3850		 * We want to keep the following priority order:
  3851		 * cpu pinned (that don't need to move), task pinned,
  3852		 * cpu flexible, task flexible.
  3853		 *
  3854		 * However, if task's ctx is not carrying any pinned
  3855		 * events, no need to flip the cpuctx's events around.
  3856		 */
  3857		if (!RB_EMPTY_ROOT(&ctx->pinned_groups.tree))
  3858			cpu_ctx_sched_out(cpuctx, EVENT_FLEXIBLE);
  3859		perf_event_sched_in(cpuctx, ctx, task);
  3860	
  3861		if (cpuctx->sched_cb_usage && pmu->sched_task)
  3862			pmu->sched_task(cpuctx->task_ctx, true);
  3863	
  3864		perf_pmu_enable(pmu);
  3865	
  3866	unlock:
  3867		perf_ctx_unlock(cpuctx, ctx);
  3868	}
  3869	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 29578 bytes --]

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

only message in thread, other threads:[~2021-06-22 22:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-06-22 22:42 [peterz-queue:perf/core 10/10] kernel/events/core.c:3831:30: warning: 'cpuctx' is used uninitialized in this function kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.