linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Yang Jihong <yangjihong1@huawei.com>,
	rostedt@goodmis.org, peterz@infradead.org, mingo@redhat.com,
	acme@kernel.org, mark.rutland@arm.com,
	alexander.shishkin@linux.intel.com, jolsa@kernel.org,
	namhyung@kernel.org, linux-kernel@vger.kernel.org,
	linux-perf-users@vger.kernel.org
Cc: kbuild-all@lists.01.org, yangjihong1@huawei.com
Subject: Re: [PATCH] perf/core: Fix syzkaller reported issue "Internal error in read_pmevcntrn"
Date: Fri, 5 Aug 2022 05:48:48 +0800	[thread overview]
Message-ID: <202208050525.mCzcYS6u-lkp@intel.com> (raw)
In-Reply-To: <20220804105918.113833-1-yangjihong1@huawei.com>

Hi Yang,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on tip/perf/core]
[also build test ERROR on linus/master v5.19 next-20220804]
[cannot apply to acme/perf/core]
[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/Yang-Jihong/perf-core-Fix-syzkaller-reported-issue-Internal-error-in-read_pmevcntrn/20220804-190347
base:   https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 326ecc15c61c349cd49d1700ff9e3e31c6fd1cd5
config: x86_64-randconfig-a015 (https://download.01.org/0day-ci/archive/20220805/202208050525.mCzcYS6u-lkp@intel.com/config)
compiler: gcc-11 (Debian 11.3.0-3) 11.3.0
reproduce (this is a W=1 build):
        # https://github.com/intel-lab-lkp/linux/commit/9c758a8d3d13d1ac89f651850b79d91b23b41b02
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Yang-Jihong/perf-core-Fix-syzkaller-reported-issue-Internal-error-in-read_pmevcntrn/20220804-190347
        git checkout 9c758a8d3d13d1ac89f651850b79d91b23b41b02
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        make 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@intel.com>

All errors (new ones prefixed by >>):

   In file included from include/linux/spinlock.h:54,
                    from include/linux/wait.h:9,
                    from include/linux/wait_bit.h:8,
                    from include/linux/fs.h:6,
                    from kernel/events/core.c:11:
   kernel/events/core.c: In function 'perf_output_read_group':
>> kernel/events/core.c:6942:27: error: 'flags' undeclared (first use in this function)
    6942 |         local_irq_restore(flags);
         |                           ^~~~~
   include/linux/typecheck.h:11:16: note: in definition of macro 'typecheck'
      11 |         typeof(x) __dummy2; \
         |                ^
   include/linux/irqflags.h:228:22: note: in expansion of macro 'raw_irqs_disabled_flags'
     228 |                 if (!raw_irqs_disabled_flags(flags))    \
         |                      ^~~~~~~~~~~~~~~~~~~~~~~
   kernel/events/core.c:6942:9: note: in expansion of macro 'local_irq_restore'
    6942 |         local_irq_restore(flags);
         |         ^~~~~~~~~~~~~~~~~
   kernel/events/core.c:6942:27: note: each undeclared identifier is reported only once for each function it appears in
    6942 |         local_irq_restore(flags);
         |                           ^~~~~
   include/linux/typecheck.h:11:16: note: in definition of macro 'typecheck'
      11 |         typeof(x) __dummy2; \
         |                ^
   include/linux/irqflags.h:228:22: note: in expansion of macro 'raw_irqs_disabled_flags'
     228 |                 if (!raw_irqs_disabled_flags(flags))    \
         |                      ^~~~~~~~~~~~~~~~~~~~~~~
   kernel/events/core.c:6942:9: note: in expansion of macro 'local_irq_restore'
    6942 |         local_irq_restore(flags);
         |         ^~~~~~~~~~~~~~~~~
   include/linux/typecheck.h:12:25: warning: comparison of distinct pointer types lacks a cast
      12 |         (void)(&__dummy == &__dummy2); \
         |                         ^~
   include/linux/irqflags.h:193:17: note: in expansion of macro 'typecheck'
     193 |                 typecheck(unsigned long, flags);        \
         |                 ^~~~~~~~~
   include/linux/irqflags.h:228:22: note: in expansion of macro 'raw_irqs_disabled_flags'
     228 |                 if (!raw_irqs_disabled_flags(flags))    \
         |                      ^~~~~~~~~~~~~~~~~~~~~~~
   kernel/events/core.c:6942:9: note: in expansion of macro 'local_irq_restore'
    6942 |         local_irq_restore(flags);
         |         ^~~~~~~~~~~~~~~~~
   include/linux/typecheck.h:12:25: warning: comparison of distinct pointer types lacks a cast
      12 |         (void)(&__dummy == &__dummy2); \
         |                         ^~
   include/linux/irqflags.h:182:17: note: in expansion of macro 'typecheck'
     182 |                 typecheck(unsigned long, flags);        \
         |                 ^~~~~~~~~
   include/linux/irqflags.h:230:17: note: in expansion of macro 'raw_local_irq_restore'
     230 |                 raw_local_irq_restore(flags);           \
         |                 ^~~~~~~~~~~~~~~~~~~~~
   kernel/events/core.c:6942:9: note: in expansion of macro 'local_irq_restore'
    6942 |         local_irq_restore(flags);
         |         ^~~~~~~~~~~~~~~~~


vim +/flags +6942 kernel/events/core.c

  6896	
  6897	static void perf_output_read_group(struct perf_output_handle *handle,
  6898				    struct perf_event *event,
  6899				    u64 enabled, u64 running)
  6900	{
  6901		struct perf_event *leader = event->group_leader, *sub;
  6902		u64 read_format = event->attr.read_format;
  6903		u64 values[6];
  6904		int n = 0;
  6905	
  6906		values[n++] = 1 + leader->nr_siblings;
  6907	
  6908		if (read_format & PERF_FORMAT_TOTAL_TIME_ENABLED)
  6909			values[n++] = enabled;
  6910	
  6911		if (read_format & PERF_FORMAT_TOTAL_TIME_RUNNING)
  6912			values[n++] = running;
  6913	
  6914		if ((leader != event) &&
  6915		    (leader->state == PERF_EVENT_STATE_ACTIVE))
  6916			leader->pmu->read(leader);
  6917	
  6918		values[n++] = perf_event_count(leader);
  6919		if (read_format & PERF_FORMAT_ID)
  6920			values[n++] = primary_event_id(leader);
  6921		if (read_format & PERF_FORMAT_LOST)
  6922			values[n++] = atomic64_read(&leader->lost_samples);
  6923	
  6924		__output_copy(handle, values, n * sizeof(u64));
  6925	
  6926		for_each_sibling_event(sub, leader) {
  6927			n = 0;
  6928	
  6929			if ((sub != event) &&
  6930			    (sub->state == PERF_EVENT_STATE_ACTIVE))
  6931				sub->pmu->read(sub);
  6932	
  6933			values[n++] = perf_event_count(sub);
  6934			if (read_format & PERF_FORMAT_ID)
  6935				values[n++] = primary_event_id(sub);
  6936			if (read_format & PERF_FORMAT_LOST)
  6937				values[n++] = atomic64_read(&sub->lost_samples);
  6938	
  6939			__output_copy(handle, values, n * sizeof(u64));
  6940		}
  6941	
> 6942		local_irq_restore(flags);
  6943	}
  6944	

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

  parent reply	other threads:[~2022-08-04 21:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-04 10:59 [PATCH] perf/core: Fix syzkaller reported issue "Internal error in read_pmevcntrn" Yang Jihong
2022-08-04 18:55 ` kernel test robot
2022-08-04 21:48 ` kernel test robot [this message]
2022-08-05  0:41 ` kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202208050525.mCzcYS6u-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=acme@kernel.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=jolsa@kernel.org \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=yangjihong1@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).