tree:
https://github.com/thesofproject/linux pr/2377
head: d90b3a16806fdb0b254587aba60571ff00a2c0ba
commit: d90b3a16806fdb0b254587aba60571ff00a2c0ba [2/2] ASoC:SOF:trace: Add runtime
filtering mechanism
config: arm64-sof-customedconfig-sof-defconfig (attached as .config)
compiler: aarch64-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
git checkout d90b3a16806fdb0b254587aba60571ff00a2c0ba
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arm64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All error/warnings (new ones prefixed by >>):
In file included from include/linux/device.h:15,
from sound/soc/sof/sof-priv.h:14,
from sound/soc/sof/trace.c:13:
sound/soc/sof/trace.c: In function 'trace_filter_parse':
> sound/soc/sof/trace.c:271:12: error: 'line' undeclared
(first use in this function)
271 | entry, line);
| ^~~~
include/linux/dev_printk.h:104:32: note: in definition of macro 'dev_err'
104 | _dev_err(dev, dev_fmt(fmt), ##__VA_ARGS__)
| ^~~~~~~~~~~
sound/soc/sof/trace.c:271:12: note: each undeclared identifier is reported only once
for each function it appears in
271 | entry, line);
| ^~~~
include/linux/dev_printk.h:104:32: note: in definition of macro 'dev_err'
104 | _dev_err(dev, dev_fmt(fmt), ##__VA_ARGS__)
| ^~~~~~~~~~~
sound/soc/sof/trace.c: At top level:
> sound/soc/sof/trace.c:283:5: warning: no previous prototype for
'sof_ipc_trace_update_filter' [-Wmissing-prototypes]
283 | int
sof_ipc_trace_update_filter(struct snd_sof_dev *sdev, size_t num_elems,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
#
https://github.com/thesofproject/linux/commit/d90b3a16806fdb0b254587aba60...
git remote add linux-sof-driver
https://github.com/thesofproject/linux
git fetch --no-tags linux-sof-driver pr/2377
git checkout d90b3a16806fdb0b254587aba60571ff00a2c0ba
vim +/line +271 sound/soc/sof/trace.c
234
235 static int trace_filter_parse(struct snd_sof_dev *sdev, char* string,
236 size_t len, size_t *out_elem_cnt,
237 struct sof_ipc_trace_filter_elem **out)
238 {
239 struct sof_ipc_trace_filter_elem *elems;
240 char *entry = string;
241 char *entry_end;
242 size_t capacity;
243 size_t cnt = 0;
244 int entry_len;
245
246 if (!string)
247 return -EINVAL;
248
249 /*
250 * calc capacity, default entry length: len('0 1FFFA000 0 0;') == 15,
251 * each entry consist up to 4 elements.
252 */
253 capacity = len * 4 / 15 + 1;
254 elems = kzalloc(capacity * sizeof(*elems), GFP_KERNEL);
255 if (!elems)
256 return -ENOMEM;
257
258 while (entry < string + len) {
259 entry_end = strchrnul(entry, ';');
260 *entry_end = '\0';
261
262 if(strcmp(entry, "\n") == 0) {
263 entry = entry_end + 1;
264 continue;
265 }
266
267 entry_len = trace_filter_parse_entry(sdev, entry, &elems,
268 &capacity, &cnt);
269 if (entry_len <= 0) {
270 dev_err(sdev->dev, "error: trace_filter_parse_entry for '%s'
failed, '%d'\n",
271 entry, line);
272 kfree(elems);
273 return -EINVAL;
274 }
275 entry = entry_end + 1;
276 }
277
278 *out = elems;
279 *out_elem_cnt = cnt;
280 return 0;
281 }
282
283 int sof_ipc_trace_update_filter(struct snd_sof_dev *sdev, size_t
num_elems,
284 struct sof_ipc_trace_filter_elem *elems)
285 {
286 struct sof_ipc_trace_filter *msg;
287 struct sof_ipc_reply reply;
288 size_t size;
289 int ret;
290
291 size = struct_size(msg, elems, num_elems);
292 if (size > SOF_IPC_MSG_MAX_SIZE)
293 return -ENOMEM;
294
295 msg = kmalloc(size, GFP_KERNEL);
296 if (!msg)
297 return -ENOMEM;
298
299 msg->hdr.size = size;
300 msg->hdr.cmd = SOF_IPC_GLB_TRACE_MSG | SOF_IPC_TRACE_FILTER_UPDATE;
301 msg->elem_cnt = num_elems;
302 memcpy(&msg->elems[0], elems, num_elems * sizeof(*elems));
303
304 pm_runtime_get_sync(sdev->dev);
305 ret = sof_ipc_tx_message(sdev->ipc, msg->hdr.cmd, msg, msg->hdr.size,
306 &reply, sizeof(reply));
307 pm_runtime_put_sync(sdev->dev);
308
309 kfree(msg);
310 return ret ? ret : reply.error;
311 }
312
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org