Hi Masami,

kernel test robot noticed the following build warnings:

[auto build test WARNING on trace/for-next]
[also build test WARNING on linus/master v6.19-rc6 next-20260119]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    
https://github.com/intel-lab-lkp/linux/commits/Masami-Hiramatsu-Google/tracing-Reset-last_boot_info-if-ring-buffer-is-reset/20260120-091429
base:   https://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace 
for-next
patch link:    
https://lore.kernel.org/r/176887137556.578403.17994205756247311821.stgit%40mhiramat.tok.corp.google.com
patch subject: [PATCH v4 2/4] tracing: Make the backup instance non-reusable
config: arc-defconfig 
(https://download.01.org/0day-ci/archive/20260120/[email protected]/config)
compiler: arc-linux-gcc (GCC) 15.2.0
reproduce (this is a W=1 build): 
(https://download.01.org/0day-ci/archive/20260120/[email protected]/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 <[email protected]>
| Closes: 
https://lore.kernel.org/oe-kbuild-all/[email protected]/

All warnings (new ones prefixed by >>):

   kernel/trace/trace.c: In function 'tracing_init_tracefs_percpu':
>> kernel/trace/trace.c:9398:17: warning: variable 'writable_mode' set but not 
>> used [-Wunused-but-set-variable]
    9398 |         umode_t writable_mode = TRACE_MODE_WRITE;
         |                 ^~~~~~~~~~~~~


vim +/writable_mode +9398 kernel/trace/trace.c

  9393  
  9394  static void
  9395  tracing_init_tracefs_percpu(struct trace_array *tr, long cpu)
  9396  {
  9397          struct dentry *d_percpu = tracing_dentry_percpu(tr, cpu);
> 9398          umode_t writable_mode = TRACE_MODE_WRITE;
  9399          struct dentry *d_cpu;
  9400          char cpu_dir[30]; /* 30 characters should be more than enough */
  9401  
  9402          if (!d_percpu)
  9403                  return;
  9404  
  9405          if (trace_array_is_readonly(tr))
  9406                  writable_mode = TRACE_MODE_READ;
  9407  
  9408          snprintf(cpu_dir, 30, "cpu%ld", cpu);
  9409          d_cpu = tracefs_create_dir(cpu_dir, d_percpu);
  9410          if (!d_cpu) {
  9411                  pr_warn("Could not create tracefs '%s' entry\n", 
cpu_dir);
  9412                  return;
  9413          }
  9414  
  9415          /* per cpu trace_pipe */
  9416          trace_create_cpu_file("trace_pipe", TRACE_MODE_READ, d_cpu,
  9417                                  tr, cpu, &tracing_pipe_fops);
  9418  
  9419          /* per cpu trace */
  9420          trace_create_cpu_file("trace", TRACE_MODE_WRITE, d_cpu,
  9421                                  tr, cpu, &tracing_fops);
  9422  
  9423          trace_create_cpu_file("trace_pipe_raw", TRACE_MODE_READ, d_cpu,
  9424                                  tr, cpu, &tracing_buffers_fops);
  9425  
  9426          trace_create_cpu_file("stats", TRACE_MODE_READ, d_cpu,
  9427                                  tr, cpu, &tracing_stats_fops);
  9428  
  9429          trace_create_cpu_file("buffer_size_kb", TRACE_MODE_READ, d_cpu,
  9430                                  tr, cpu, &tracing_entries_fops);
  9431  
  9432          if (tr->range_addr_start)
  9433                  trace_create_cpu_file("buffer_meta", TRACE_MODE_READ, 
d_cpu,
  9434                                        tr, cpu, 
&tracing_buffer_meta_fops);
  9435  #ifdef CONFIG_TRACER_SNAPSHOT
  9436          if (!tr->range_addr_start) {
  9437                  trace_create_cpu_file("snapshot", TRACE_MODE_WRITE, 
d_cpu,
  9438                                        tr, cpu, &snapshot_fops);
  9439  
  9440                  trace_create_cpu_file("snapshot_raw", TRACE_MODE_READ, 
d_cpu,
  9441                                        tr, cpu, &snapshot_raw_fops);
  9442          }
  9443  #endif
  9444  }
  9445  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

Reply via email to