Re: [PATCH v3 2/8] locking/lockdep: Display irq_context names in /proc/lockdep_chains

From: kbuild test robot
Date: Fri Jan 17 2020 - 17:12:28 EST


Hi Waiman,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on tip/locking/core]
[also build test ERROR on tip/auto-latest linus/master arm-perf/for-next/perf v5.5-rc6 next-20200117]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url: https://github.com/0day-ci/linux/commits/Waiman-Long/locking-lockdep-Reuse-zapped-chain_hlocks-entries/20200117-093009
base: https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 1a365e822372ba24c9da0822bc583894f6f3d821
config: sparc64-allmodconfig (attached as .config)
compiler: sparc64-linux-gcc (GCC) 7.5.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
GCC_VERSION=7.5.0 make.cross ARCH=sparc64

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

All errors (new ones prefixed by >>):

kernel/locking/lockdep_proc.c: In function 'lc_show':
>> kernel/locking/lockdep_proc.c:133:4: error: 'LOCK_CHAIN_HARDIRQ_CONTEXT' undeclared (first use in this function); did you mean 'LOCK_USED_IN_HARDIRQ_READ'?
[LOCK_CHAIN_HARDIRQ_CONTEXT] = "hardirq",
^~~~~~~~~~~~~~~~~~~~~~~~~~
LOCK_USED_IN_HARDIRQ_READ
kernel/locking/lockdep_proc.c:133:4: note: each undeclared identifier is reported only once for each function it appears in
>> kernel/locking/lockdep_proc.c:133:4: error: array index in initializer not of integer type
kernel/locking/lockdep_proc.c:133:4: note: (near initialization for 'irq_strs')
>> kernel/locking/lockdep_proc.c:134:4: error: 'LOCK_CHAIN_SOFTIRQ_CONTEXT' undeclared (first use in this function); did you mean 'LOCK_CHAIN_HARDIRQ_CONTEXT'?
[LOCK_CHAIN_SOFTIRQ_CONTEXT] = "softirq",
^~~~~~~~~~~~~~~~~~~~~~~~~~
LOCK_CHAIN_HARDIRQ_CONTEXT
kernel/locking/lockdep_proc.c:134:4: error: array index in initializer not of integer type
kernel/locking/lockdep_proc.c:134:4: note: (near initialization for 'irq_strs')
kernel/locking/lockdep_proc.c:135:4: error: array index in initializer not of integer type
[LOCK_CHAIN_SOFTIRQ_CONTEXT|
^~~~~~~~~~~~~~~~~~~~~~~~~~
kernel/locking/lockdep_proc.c:135:4: note: (near initialization for 'irq_strs')

vim +133 kernel/locking/lockdep_proc.c

125
126 static int lc_show(struct seq_file *m, void *v)
127 {
128 struct lock_chain *chain = v;
129 struct lock_class *class;
130 int i;
131 static const char * const irq_strs[] = {
132 [0] = "0",
> 133 [LOCK_CHAIN_HARDIRQ_CONTEXT] = "hardirq",
> 134 [LOCK_CHAIN_SOFTIRQ_CONTEXT] = "softirq",
135 [LOCK_CHAIN_SOFTIRQ_CONTEXT|
136 LOCK_CHAIN_HARDIRQ_CONTEXT] = "hardirq|softirq",
137 };
138
139 if (v == SEQ_START_TOKEN) {
140 if (nr_chain_hlocks > MAX_LOCKDEP_CHAIN_HLOCKS)
141 seq_printf(m, "(buggered) ");
142 seq_printf(m, "all lock chains:\n");
143 return 0;
144 }
145
146 seq_printf(m, "irq_context: %s\n", irq_strs[chain->irq_context]);
147
148 for (i = 0; i < chain->depth; i++) {
149 class = lock_chain_get_class(chain, i);
150 if (!class->key)
151 continue;
152
153 seq_printf(m, "[%p] ", class->key);
154 print_name(m, class);
155 seq_puts(m, "\n");
156 }
157 seq_puts(m, "\n");
158
159 return 0;
160 }
161

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx Intel Corporation

Attachment: .config.gz
Description: application/gzip