From: kernel test robot <lkp@intel.com>
To: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Cc: oe-kbuild-all@lists.linux.dev
Subject: [kkdwivedi:res-lock-base 18/26] kernel/locking/qspinlock_stat.h:38: multiple definition of `lockevent_read'; kernel/locking/qspinlock.o:kernel/locking/qspinlock_stat.h:38: first defined here
Date: Tue, 18 Feb 2025 03:05:57 +0800 [thread overview]
Message-ID: <202502180215.TiFAcPLM-lkp@intel.com> (raw)
tree: https://github.com/kkdwivedi/linux res-lock-base
head: f998e0817b8a89691123f4a4a6e1277c22523695
commit: 2a7700316f24b476a25243d28d4e19c517814836 [18/26] rqspinlock: Add entry to Makefile, MAINTAINERS
config: i386-buildonly-randconfig-004-20250217 (https://download.01.org/0day-ci/archive/20250218/202502180215.TiFAcPLM-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250218/202502180215.TiFAcPLM-lkp@intel.com/reproduce)
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/202502180215.TiFAcPLM-lkp@intel.com/
All errors (new ones prefixed by >>):
ld: kernel/locking/rqspinlock.o: in function `lockevent_read':
>> kernel/locking/qspinlock_stat.h:38: multiple definition of `lockevent_read'; kernel/locking/qspinlock.o:kernel/locking/qspinlock_stat.h:38: first defined here
>> ld: kernel/locking/rqspinlock.o:(.discard+0x0): multiple definition of `__pcpu_unique_qnodes'; kernel/locking/qspinlock.o:(.discard+0x0): first defined here
>> ld: kernel/locking/rqspinlock.o:(.discard+0x7): multiple definition of `__pcpu_unique_pv_kick_time'; kernel/locking/qspinlock.o:(.discard+0x4): first defined here
vim +38 kernel/locking/qspinlock_stat.h
45e898b735620f Waiman Long 2015-11-09 24
45e898b735620f Waiman Long 2015-11-09 25 /*
fb346fd9fc081c Waiman Long 2019-04-04 26 * Function to read and return the PV qspinlock counts.
45e898b735620f Waiman Long 2015-11-09 27 *
45e898b735620f Waiman Long 2015-11-09 28 * The following counters are handled specially:
ad53fa10fa9e81 Waiman Long 2019-04-04 29 * 1. pv_latency_kick
45e898b735620f Waiman Long 2015-11-09 30 * Average kick latency (ns) = pv_latency_kick/pv_kick_unlock
ad53fa10fa9e81 Waiman Long 2019-04-04 31 * 2. pv_latency_wake
45e898b735620f Waiman Long 2015-11-09 32 * Average wake latency (ns) = pv_latency_wake/pv_kick_wake
ad53fa10fa9e81 Waiman Long 2019-04-04 33 * 3. pv_hash_hops
45e898b735620f Waiman Long 2015-11-09 34 * Average hops/hash = pv_hash_hops/pv_kick_unlock
45e898b735620f Waiman Long 2015-11-09 35 */
fb346fd9fc081c Waiman Long 2019-04-04 36 ssize_t lockevent_read(struct file *file, char __user *user_buf,
45e898b735620f Waiman Long 2015-11-09 37 size_t count, loff_t *ppos)
45e898b735620f Waiman Long 2015-11-09 @38 {
45e898b735620f Waiman Long 2015-11-09 39 char buf[64];
ad53fa10fa9e81 Waiman Long 2019-04-04 40 int cpu, id, len;
ad53fa10fa9e81 Waiman Long 2019-04-04 41 u64 sum = 0, kicks = 0;
45e898b735620f Waiman Long 2015-11-09 42
45e898b735620f Waiman Long 2015-11-09 43 /*
45e898b735620f Waiman Long 2015-11-09 44 * Get the counter ID stored in file->f_inode->i_private
45e898b735620f Waiman Long 2015-11-09 45 */
ad53fa10fa9e81 Waiman Long 2019-04-04 46 id = (long)file_inode(file)->i_private;
45e898b735620f Waiman Long 2015-11-09 47
ad53fa10fa9e81 Waiman Long 2019-04-04 48 if (id >= lockevent_num)
45e898b735620f Waiman Long 2015-11-09 49 return -EBADF;
45e898b735620f Waiman Long 2015-11-09 50
45e898b735620f Waiman Long 2015-11-09 51 for_each_possible_cpu(cpu) {
ad53fa10fa9e81 Waiman Long 2019-04-04 52 sum += per_cpu(lockevents[id], cpu);
45e898b735620f Waiman Long 2015-11-09 53 /*
ad53fa10fa9e81 Waiman Long 2019-04-04 54 * Need to sum additional counters for some of them
45e898b735620f Waiman Long 2015-11-09 55 */
ad53fa10fa9e81 Waiman Long 2019-04-04 56 switch (id) {
45e898b735620f Waiman Long 2015-11-09 57
ad53fa10fa9e81 Waiman Long 2019-04-04 58 case LOCKEVENT_pv_latency_kick:
ad53fa10fa9e81 Waiman Long 2019-04-04 59 case LOCKEVENT_pv_hash_hops:
ad53fa10fa9e81 Waiman Long 2019-04-04 60 kicks += per_cpu(EVENT_COUNT(pv_kick_unlock), cpu);
45e898b735620f Waiman Long 2015-11-09 61 break;
45e898b735620f Waiman Long 2015-11-09 62
ad53fa10fa9e81 Waiman Long 2019-04-04 63 case LOCKEVENT_pv_latency_wake:
ad53fa10fa9e81 Waiman Long 2019-04-04 64 kicks += per_cpu(EVENT_COUNT(pv_kick_wake), cpu);
45e898b735620f Waiman Long 2015-11-09 65 break;
45e898b735620f Waiman Long 2015-11-09 66 }
45e898b735620f Waiman Long 2015-11-09 67 }
45e898b735620f Waiman Long 2015-11-09 68
ad53fa10fa9e81 Waiman Long 2019-04-04 69 if (id == LOCKEVENT_pv_hash_hops) {
6687659568e2ec Davidlohr Bueso 2016-04-17 70 u64 frac = 0;
45e898b735620f Waiman Long 2015-11-09 71
6687659568e2ec Davidlohr Bueso 2016-04-17 72 if (kicks) {
ad53fa10fa9e81 Waiman Long 2019-04-04 73 frac = 100ULL * do_div(sum, kicks);
45e898b735620f Waiman Long 2015-11-09 74 frac = DIV_ROUND_CLOSEST_ULL(frac, kicks);
6687659568e2ec Davidlohr Bueso 2016-04-17 75 }
45e898b735620f Waiman Long 2015-11-09 76
45e898b735620f Waiman Long 2015-11-09 77 /*
45e898b735620f Waiman Long 2015-11-09 78 * Return a X.XX decimal number
45e898b735620f Waiman Long 2015-11-09 79 */
ad53fa10fa9e81 Waiman Long 2019-04-04 80 len = snprintf(buf, sizeof(buf) - 1, "%llu.%02llu\n",
ad53fa10fa9e81 Waiman Long 2019-04-04 81 sum, frac);
45e898b735620f Waiman Long 2015-11-09 82 } else {
45e898b735620f Waiman Long 2015-11-09 83 /*
45e898b735620f Waiman Long 2015-11-09 84 * Round to the nearest ns
45e898b735620f Waiman Long 2015-11-09 85 */
ad53fa10fa9e81 Waiman Long 2019-04-04 86 if ((id == LOCKEVENT_pv_latency_kick) ||
ad53fa10fa9e81 Waiman Long 2019-04-04 87 (id == LOCKEVENT_pv_latency_wake)) {
45e898b735620f Waiman Long 2015-11-09 88 if (kicks)
ad53fa10fa9e81 Waiman Long 2019-04-04 89 sum = DIV_ROUND_CLOSEST_ULL(sum, kicks);
45e898b735620f Waiman Long 2015-11-09 90 }
ad53fa10fa9e81 Waiman Long 2019-04-04 91 len = snprintf(buf, sizeof(buf) - 1, "%llu\n", sum);
45e898b735620f Waiman Long 2015-11-09 92 }
45e898b735620f Waiman Long 2015-11-09 93
45e898b735620f Waiman Long 2015-11-09 94 return simple_read_from_buffer(user_buf, count, ppos, buf, len);
45e898b735620f Waiman Long 2015-11-09 95 }
45e898b735620f Waiman Long 2015-11-09 96
:::::: The code at line 38 was first introduced by commit
:::::: 45e898b735620f426eddf105fc886d2966593a58 locking/pvqspinlock: Collect slowpath lock statistics
:::::: TO: Waiman Long <Waiman.Long@hpe.com>
:::::: CC: Ingo Molnar <mingo@kernel.org>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2025-02-17 19:06 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=202502180215.TiFAcPLM-lkp@intel.com \
--to=lkp@intel.com \
--cc=memxor@gmail.com \
--cc=oe-kbuild-all@lists.linux.dev \
/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 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.