All of lore.kernel.org
 help / color / mirror / Atom feed
* [jirislaby:devel 26/50] arch/x86/events/intel/ds.c:1680:9: sparse: sparse: too long token expansion
@ 2020-06-02 17:25 kbuild test robot
  0 siblings, 0 replies; only message in thread
From: kbuild test robot @ 2020-06-02 17:25 UTC (permalink / raw)
  To: kbuild-all

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/jirislaby/linux.git devel
head:   ee0ee29f0a9eee7ef2b4db85375544fd048f8343
commit: 04ee605f3b4a02028b5247e8160e006c66bd5b74 [26/50] include condition in the BUG_ON/WARN_ON output
config: i386-randconfig-s001-20200602 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-13) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.1-244-g0ee050a8-dirty
        git checkout 04ee605f3b4a02028b5247e8160e006c66bd5b74
        # save the attached .config to linux build tree
        make W=1 C=1 ARCH=i386 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'

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


sparse warnings: (new ones prefixed by >>)

>> arch/x86/events/intel/ds.c:1680:9: sparse: sparse: too long token expansion

vim +1680 arch/x86/events/intel/ds.c

5bee2cc69d986e2 Kan Liang 2018-02-12  1662  
d31fc13fdcb20e1 Kan Liang 2018-02-12  1663  /*
d31fc13fdcb20e1 Kan Liang 2018-02-12  1664   * Special variant of intel_pmu_save_and_restart() for auto-reload.
d31fc13fdcb20e1 Kan Liang 2018-02-12  1665   */
d31fc13fdcb20e1 Kan Liang 2018-02-12  1666  static int
d31fc13fdcb20e1 Kan Liang 2018-02-12  1667  intel_pmu_save_and_restart_reload(struct perf_event *event, int count)
d31fc13fdcb20e1 Kan Liang 2018-02-12  1668  {
d31fc13fdcb20e1 Kan Liang 2018-02-12  1669  	struct hw_perf_event *hwc = &event->hw;
d31fc13fdcb20e1 Kan Liang 2018-02-12  1670  	int shift = 64 - x86_pmu.cntval_bits;
d31fc13fdcb20e1 Kan Liang 2018-02-12  1671  	u64 period = hwc->sample_period;
d31fc13fdcb20e1 Kan Liang 2018-02-12  1672  	u64 prev_raw_count, new_raw_count;
d31fc13fdcb20e1 Kan Liang 2018-02-12  1673  	s64 new, old;
d31fc13fdcb20e1 Kan Liang 2018-02-12  1674  
d31fc13fdcb20e1 Kan Liang 2018-02-12  1675  	WARN_ON(!period);
d31fc13fdcb20e1 Kan Liang 2018-02-12  1676  
d31fc13fdcb20e1 Kan Liang 2018-02-12  1677  	/*
d31fc13fdcb20e1 Kan Liang 2018-02-12  1678  	 * drain_pebs() only happens when the PMU is disabled.
d31fc13fdcb20e1 Kan Liang 2018-02-12  1679  	 */
d31fc13fdcb20e1 Kan Liang 2018-02-12 @1680  	WARN_ON(this_cpu_read(cpu_hw_events.enabled));
d31fc13fdcb20e1 Kan Liang 2018-02-12  1681  
d31fc13fdcb20e1 Kan Liang 2018-02-12  1682  	prev_raw_count = local64_read(&hwc->prev_count);
d31fc13fdcb20e1 Kan Liang 2018-02-12  1683  	rdpmcl(hwc->event_base_rdpmc, new_raw_count);
d31fc13fdcb20e1 Kan Liang 2018-02-12  1684  	local64_set(&hwc->prev_count, new_raw_count);
d31fc13fdcb20e1 Kan Liang 2018-02-12  1685  
d31fc13fdcb20e1 Kan Liang 2018-02-12  1686  	/*
d31fc13fdcb20e1 Kan Liang 2018-02-12  1687  	 * Since the counter increments a negative counter value and
d31fc13fdcb20e1 Kan Liang 2018-02-12  1688  	 * overflows on the sign switch, giving the interval:
d31fc13fdcb20e1 Kan Liang 2018-02-12  1689  	 *
d31fc13fdcb20e1 Kan Liang 2018-02-12  1690  	 *   [-period, 0]
d31fc13fdcb20e1 Kan Liang 2018-02-12  1691  	 *
d31fc13fdcb20e1 Kan Liang 2018-02-12  1692  	 * the difference between two consequtive reads is:
d31fc13fdcb20e1 Kan Liang 2018-02-12  1693  	 *
d31fc13fdcb20e1 Kan Liang 2018-02-12  1694  	 *   A) value2 - value1;
d31fc13fdcb20e1 Kan Liang 2018-02-12  1695  	 *      when no overflows have happened in between,
d31fc13fdcb20e1 Kan Liang 2018-02-12  1696  	 *
d31fc13fdcb20e1 Kan Liang 2018-02-12  1697  	 *   B) (0 - value1) + (value2 - (-period));
d31fc13fdcb20e1 Kan Liang 2018-02-12  1698  	 *      when one overflow happened in between,
d31fc13fdcb20e1 Kan Liang 2018-02-12  1699  	 *
d31fc13fdcb20e1 Kan Liang 2018-02-12  1700  	 *   C) (0 - value1) + (n - 1) * (period) + (value2 - (-period));
d31fc13fdcb20e1 Kan Liang 2018-02-12  1701  	 *      when @n overflows happened in between.
d31fc13fdcb20e1 Kan Liang 2018-02-12  1702  	 *
d31fc13fdcb20e1 Kan Liang 2018-02-12  1703  	 * Here A) is the obvious difference, B) is the extension to the
d31fc13fdcb20e1 Kan Liang 2018-02-12  1704  	 * discrete interval, where the first term is to the top of the
d31fc13fdcb20e1 Kan Liang 2018-02-12  1705  	 * interval and the second term is from the bottom of the next
d31fc13fdcb20e1 Kan Liang 2018-02-12  1706  	 * interval and C) the extension to multiple intervals, where the
d31fc13fdcb20e1 Kan Liang 2018-02-12  1707  	 * middle term is the whole intervals covered.
d31fc13fdcb20e1 Kan Liang 2018-02-12  1708  	 *
d31fc13fdcb20e1 Kan Liang 2018-02-12  1709  	 * An equivalent of C, by reduction, is:
d31fc13fdcb20e1 Kan Liang 2018-02-12  1710  	 *
d31fc13fdcb20e1 Kan Liang 2018-02-12  1711  	 *   value2 - value1 + n * period
d31fc13fdcb20e1 Kan Liang 2018-02-12  1712  	 */
d31fc13fdcb20e1 Kan Liang 2018-02-12  1713  	new = ((s64)(new_raw_count << shift) >> shift);
d31fc13fdcb20e1 Kan Liang 2018-02-12  1714  	old = ((s64)(prev_raw_count << shift) >> shift);
d31fc13fdcb20e1 Kan Liang 2018-02-12  1715  	local64_add(new - old + count * period, &event->count);
d31fc13fdcb20e1 Kan Liang 2018-02-12  1716  
f861854e1b435b2 Kan Liang 2020-01-21  1717  	local64_set(&hwc->period_left, -new);
f861854e1b435b2 Kan Liang 2020-01-21  1718  
d31fc13fdcb20e1 Kan Liang 2018-02-12  1719  	perf_event_update_userpage(event);
d31fc13fdcb20e1 Kan Liang 2018-02-12  1720  
d31fc13fdcb20e1 Kan Liang 2018-02-12  1721  	return 0;
d31fc13fdcb20e1 Kan Liang 2018-02-12  1722  }
d31fc13fdcb20e1 Kan Liang 2018-02-12  1723  

:::::: The code at line 1680 was first introduced by commit
:::::: d31fc13fdcb20e1c317f9a7dd6273c18fbd58308 perf/x86/intel: Fix event update for auto-reload

:::::: TO: Kan Liang <kan.liang@linux.intel.com>
:::::: CC: Ingo Molnar <mingo@kernel.org>

---
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: 37389 bytes --]

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

only message in thread, other threads:[~2020-06-02 17:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-02 17:25 [jirislaby:devel 26/50] arch/x86/events/intel/ds.c:1680:9: sparse: sparse: too long token expansion kbuild 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.