[rostedt-trace:for-next 2/3] kernel/trace/trace_events.c:2681:25: warning: variable 'no_pid_list' set but not used

From: kernel test robot
Date: Sat Nov 27 2021 - 16:01:15 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git for-next
head: a55f224ff5f238013de8762c4287117e47b86e22
commit: 6cb206508b621a9a0a2c35b60540e399225c8243 [2/3] tracing: Check pid filtering when creating events
config: hexagon-randconfig-r045-20211128 (https://download.01.org/0day-ci/archive/20211128/202111280401.qC0z99JB-lkp@xxxxxxxxx/config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 5162b558d8c0b542e752b037e72a69d5fd51eb1e)
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
# https://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git/commit/?id=6cb206508b621a9a0a2c35b60540e399225c8243
git remote add rostedt-trace https://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git
git fetch --no-tags rostedt-trace for-next
git checkout 6cb206508b621a9a0a2c35b60540e399225c8243
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=hexagon SHELL=/bin/bash

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

All warnings (new ones prefixed by >>):

>> kernel/trace/trace_events.c:2681:25: warning: variable 'no_pid_list' set but not used [-Wunused-but-set-variable]
struct trace_pid_list *no_pid_list;
^
1 warning generated.


vim +/no_pid_list +2681 kernel/trace/trace_events.c

2676
2677 static struct trace_event_file *
2678 trace_create_new_event(struct trace_event_call *call,
2679 struct trace_array *tr)
2680 {
> 2681 struct trace_pid_list *no_pid_list;
2682 struct trace_pid_list *pid_list;
2683 struct trace_event_file *file;
2684 unsigned int first;
2685
2686 file = kmem_cache_alloc(file_cachep, GFP_TRACE);
2687 if (!file)
2688 return NULL;
2689
2690 pid_list = rcu_dereference_protected(tr->filtered_pids,
2691 lockdep_is_held(&event_mutex));
2692 no_pid_list = rcu_dereference_protected(tr->filtered_no_pids,
2693 lockdep_is_held(&event_mutex));
2694
2695 if (!trace_pid_list_first(pid_list, &first) ||
2696 !trace_pid_list_first(pid_list, &first))
2697 file->flags |= EVENT_FILE_FL_PID_FILTER;
2698
2699 file->event_call = call;
2700 file->tr = tr;
2701 atomic_set(&file->sm_ref, 0);
2702 atomic_set(&file->tm_ref, 0);
2703 INIT_LIST_HEAD(&file->triggers);
2704 list_add(&file->list, &tr->events);
2705
2706 return file;
2707 }
2708

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx