lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202305241530.Pn2xj2vs-lkp@intel.com>
Date:   Wed, 24 May 2023 16:04:34 +0800
From:   kernel test robot <lkp@...el.com>
To:     Daniel Bristot de Oliveira <bristot@...nel.org>,
        linux-kernel@...r.kernel.org, linux-trace-kernel@...r.kernel.org,
        Steven Rostedt <rostedt@...dmis.org>
Cc:     llvm@...ts.linux.dev, oe-kbuild-all@...ts.linux.dev,
        Juri Lelli <juri.lelli@...hat.com>,
        William White <chwhite@...hat.com>,
        Daniel Bristot de Oliveira <bristot@...nel.org>,
        Masami Hiramatsu <mhiramat@...nel.org>,
        Jonathan Corbet <corbet@....net>
Subject: Re: [PATCH V2 3/3] tracing/timerlat: Add user-space interface

Hi Daniel,

kernel test robot noticed the following build warnings:

[auto build test WARNING on linus/master]
[also build test WARNING on v6.4-rc3 next-20230524]
[cannot apply to rostedt-trace/for-next rostedt-trace/for-next-urgent]
[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/Daniel-Bristot-de-Oliveira/tracing-osnoise-Switch-from-PF_NO_SETAFFINITY-to-migrate_disable/20230524-012512
base:   linus/master
patch link:    https://lore.kernel.org/r/a7b2c215c763e95a56fa1258743332b570c81c9d.1684860626.git.bristot%40kernel.org
patch subject: [PATCH V2 3/3] tracing/timerlat: Add user-space interface
config: x86_64-randconfig-x064-20230522
compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project f28c006a5895fc0e329fe15fead81e37457cb1d1)
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://github.com/intel-lab-lkp/linux/commit/89216b54eaf490480bc1929f5780f95a688a91bb
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Daniel-Bristot-de-Oliveira/tracing-osnoise-Switch-from-PF_NO_SETAFFINITY-to-migrate_disable/20230524-012512
        git checkout 89216b54eaf490480bc1929f5780f95a688a91bb
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 olddefconfig
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash kernel/trace/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@...el.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202305241530.Pn2xj2vs-lkp@intel.com/

All warnings (new ones prefixed by >>):

   kernel/trace/trace_osnoise.c:2364:9: error: implicit declaration of function 'this_cpu_tmr_var' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
           tlat = this_cpu_tmr_var();
                  ^
   kernel/trace/trace_osnoise.c:2364:9: note: did you mean 'this_cpu_osn_var'?
   kernel/trace/trace_osnoise.c:226:41: note: 'this_cpu_osn_var' declared here
   static inline struct osnoise_variables *this_cpu_osn_var(void)
                                           ^
>> kernel/trace/trace_osnoise.c:2364:7: warning: incompatible integer to pointer conversion assigning to 'struct timerlat_variables *' from 'int' [-Wint-conversion]
           tlat = this_cpu_tmr_var();
                ^ ~~~~~~~~~~~~~~~~~~
   kernel/trace/trace_osnoise.c:2365:6: error: incomplete definition of type 'struct timerlat_variables'
           tlat->count = 0;
           ~~~~^
   kernel/trace/trace_osnoise.c:2309:9: note: forward declaration of 'struct timerlat_variables'
           struct timerlat_variables *tlat;
                  ^
   kernel/trace/trace_osnoise.c:2387:25: error: variable has incomplete type 'struct timerlat_sample'
           struct timerlat_sample s;
                                  ^
   kernel/trace/trace_osnoise.c:2387:9: note: forward declaration of 'struct timerlat_sample'
           struct timerlat_sample s;
                  ^
   kernel/trace/trace_osnoise.c:2393:9: error: implicit declaration of function 'this_cpu_tmr_var' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
           tlat = this_cpu_tmr_var();
                  ^
   kernel/trace/trace_osnoise.c:2393:7: warning: incompatible integer to pointer conversion assigning to 'struct timerlat_variables *' from 'int' [-Wint-conversion]
           tlat = this_cpu_tmr_var();
                ^ ~~~~~~~~~~~~~~~~~~
   kernel/trace/trace_osnoise.c:2401:11: error: incomplete definition of type 'struct timerlat_variables'
                   if (tlat->uthread_migrate) {
                       ~~~~^
   kernel/trace/trace_osnoise.c:2386:9: note: forward declaration of 'struct timerlat_variables'
           struct timerlat_variables *tlat;
                  ^
   kernel/trace/trace_osnoise.c:2406:16: error: use of undeclared identifier 'per_cpu_timerlat_var'
                   per_cpu_ptr(&per_cpu_timerlat_var, cpu)->uthread_migrate = 1;
                                ^
   kernel/trace/trace_osnoise.c:2406:16: error: use of undeclared identifier 'per_cpu_timerlat_var'
   kernel/trace/trace_osnoise.c:2406:16: error: use of undeclared identifier 'per_cpu_timerlat_var'
   kernel/trace/trace_osnoise.c:2406:44: error: member reference type 'void' is not a pointer
                   per_cpu_ptr(&per_cpu_timerlat_var, cpu)->uthread_migrate = 1;
                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ^
   kernel/trace/trace_osnoise.c:2424:46: error: incomplete definition of type 'struct timerlat_variables'
                   now = ktime_to_ns(hrtimer_cb_get_time(&tlat->timer));
                                                          ~~~~^
   kernel/trace/trace_osnoise.c:2386:9: note: forward declaration of 'struct timerlat_variables'
           struct timerlat_variables *tlat;
                  ^
   kernel/trace/trace_osnoise.c:2425:20: error: incomplete definition of type 'struct timerlat_variables'
                   diff = now - tlat->abs_period;
                                ~~~~^
   kernel/trace/trace_osnoise.c:2386:9: note: forward declaration of 'struct timerlat_variables'
           struct timerlat_variables *tlat;
                  ^
   kernel/trace/trace_osnoise.c:2433:18: error: incomplete definition of type 'struct timerlat_variables'
                   s.seqnum = tlat->count;
                              ~~~~^
   kernel/trace/trace_osnoise.c:2386:9: note: forward declaration of 'struct timerlat_variables'
           struct timerlat_variables *tlat;
                  ^
   kernel/trace/trace_osnoise.c:2437:3: error: implicit declaration of function 'trace_timerlat_sample' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
                   trace_timerlat_sample(&s);
                   ^
   kernel/trace/trace_osnoise.c:2441:7: error: incomplete definition of type 'struct timerlat_variables'
                   tlat->tracing_thread = false;
                   ~~~~^
   kernel/trace/trace_osnoise.c:2386:9: note: forward declaration of 'struct timerlat_variables'
           struct timerlat_variables *tlat;
                  ^
   kernel/trace/trace_osnoise.c:2446:7: error: incomplete definition of type 'struct timerlat_variables'
                   tlat->tracing_thread = false;
                   ~~~~^
   kernel/trace/trace_osnoise.c:2386:9: note: forward declaration of 'struct timerlat_variables'
           struct timerlat_variables *tlat;
                  ^
   kernel/trace/trace_osnoise.c:2447:7: error: incomplete definition of type 'struct timerlat_variables'
                   tlat->kthread = current;
                   ~~~~^
   kernel/trace/trace_osnoise.c:2386:9: note: forward declaration of 'struct timerlat_variables'
           struct timerlat_variables *tlat;
                  ^
   kernel/trace/trace_osnoise.c:2449:21: error: incomplete definition of type 'struct timerlat_variables'
                   hrtimer_init(&tlat->timer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS_PINNED_HARD);
                                 ~~~~^
   kernel/trace/trace_osnoise.c:2386:9: note: forward declaration of 'struct timerlat_variables'
           struct timerlat_variables *tlat;
                  ^
   kernel/trace/trace_osnoise.c:2450:7: error: incomplete definition of type 'struct timerlat_variables'
                   tlat->timer.function = timerlat_irq;
                   ~~~~^
   kernel/trace/trace_osnoise.c:2386:9: note: forward declaration of 'struct timerlat_variables'
           struct timerlat_variables *tlat;
                  ^
   kernel/trace/trace_osnoise.c:2450:26: error: use of undeclared identifier 'timerlat_irq'; did you mean 'timerlat_main'?
                   tlat->timer.function = timerlat_irq;
                                          ^~~~~~~~~~~~
                                          timerlat_main
   kernel/trace/trace_osnoise.c:1856:12: note: 'timerlat_main' declared here
   static int timerlat_main(void *data)
              ^
   fatal error: too many errors emitted, stopping now [-ferror-limit=]
   2 warnings and 20 errors generated.


vim +2364 kernel/trace/trace_osnoise.c

  2305	
  2306	static int timerlat_fd_open(struct inode *inode, struct file *file)
  2307	{
  2308		struct osnoise_variables *osn_var;
  2309		struct timerlat_variables *tlat;
  2310		long cpu = (long) inode->i_cdev;
  2311	
  2312		mutex_lock(&interface_lock);
  2313	
  2314		/*
  2315		 * This file is accessible only if timerlat is enabled, and
  2316		 * NO_OSNOISE_WORKLOAD is set.
  2317		 */
  2318		if (!timerlat_enabled() || test_bit(OSN_WORKLOAD, &osnoise_options)) {
  2319			mutex_unlock(&interface_lock);
  2320			return -EINVAL;
  2321		}
  2322	
  2323		migrate_disable();
  2324	
  2325		osn_var = this_cpu_osn_var();
  2326	
  2327		/*
  2328		 * The osn_var->pid holds the single access to this file.
  2329		 */
  2330		if (osn_var->pid) {
  2331			mutex_unlock(&interface_lock);
  2332			migrate_enable();
  2333			return -EBUSY;
  2334		}
  2335	
  2336		/*
  2337		 * timerlat tracer is a per-cpu tracer. Check if the user-space too
  2338		 * is pinned to a single CPU. The tracer laters monitor if the task
  2339		 * migrates and then disables tracer if it does. However, it is
  2340		 * worth doing this basic acceptance test to avoid obviusly wrong
  2341		 * setup.
  2342		 */
  2343		if (current->nr_cpus_allowed > 1 ||  cpu != smp_processor_id()) {
  2344			mutex_unlock(&interface_lock);
  2345			migrate_enable();
  2346			return -EPERM;
  2347		}
  2348	
  2349		/*
  2350		 * From now on, it is good to go.
  2351		 */
  2352		file->private_data = inode->i_cdev;
  2353	
  2354		get_task_struct(current);
  2355	
  2356		osn_var->kthread = current;
  2357		osn_var->pid = current->pid;
  2358	
  2359		/*
  2360		 * Setup is done.
  2361		 */
  2362		mutex_unlock(&interface_lock);
  2363	
> 2364		tlat = this_cpu_tmr_var();
  2365		tlat->count = 0;
  2366	
  2367		migrate_enable();
  2368		return 0;
  2369	};
  2370	

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

View attachment "config" of type "text/plain" (157012 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ