All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: Re: [RFC PATCH V2 5/9] tracing/trace: Add a generic function to read/write u64 values from tracefs
Date: Sat, 24 Apr 2021 07:54:11 +0800	[thread overview]
Message-ID: <202104240716.mSLcvBsi-lkp@intel.com> (raw)
In-Reply-To: <f708a3c093ecb2f2513813f9d92548f03f6ec0d7.1619210818.git.bristot@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 11515 bytes --]

Hi Daniel,

[FYI, it's a private test report for your RFC patch.]
[auto build test WARNING on tip/perf/core]
[also build test WARNING on linux/master linus/master v5.12-rc8]
[cannot apply to trace/for-next next-20210423]
[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]

url:    https://github.com/0day-ci/linux/commits/Daniel-Bristot-de-Oliveira/hwlat-improvements-and-osnoise-timerlat-tracers/20210424-050958
base:   https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git ed8e50800bf4c2d904db9c75408a67085e6cca3d
config: powerpc64-randconfig-r014-20210423 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 06234f758e1945084582cf80450b396f75a9c06e)
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
        # install powerpc64 cross compiling tool for clang build
        # apt-get install binutils-powerpc64-linux-gnu
        # https://github.com/0day-ci/linux/commit/21b6c7475ccbd8c3dd5a0cb291166b7c54366243
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Daniel-Bristot-de-Oliveira/hwlat-improvements-and-osnoise-timerlat-tracers/20210424-050958
        git checkout 21b6c7475ccbd8c3dd5a0cb291166b7c54366243
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=powerpc64 

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

All warnings (new ones prefixed by >>):

                   __do_##name al;                                 \
                   ^~~~~~~~~~~~~~
   <scratch space>:58:1: note: expanded from here
   __do_insw
   ^
   arch/powerpc/include/asm/io.h:557:56: note: expanded from macro '__do_insw'
   #define __do_insw(p, b, n)      readsw((PCI_IO_ADDR)_IO_BASE+(p), (b), (n))
                                          ~~~~~~~~~~~~~~~~~~~~~^
   In file included from kernel/trace/trace.c:18:
   In file included from include/linux/writeback.h:14:
   In file included from include/linux/blk-cgroup.h:17:
   In file included from include/linux/cgroup.h:26:
   In file included from include/linux/kernel_stat.h:9:
   In file included from include/linux/interrupt.h:11:
   In file included from include/linux/hardirq.h:10:
   In file included from arch/powerpc/include/asm/hardirq.h:6:
   In file included from include/linux/irq.h:20:
   In file included from include/linux/io.h:13:
   In file included from arch/powerpc/include/asm/io.h:619:
   arch/powerpc/include/asm/io-defs.h:47:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
   DEF_PCI_AC_NORET(insl, (unsigned long p, void *b, unsigned long c),
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/powerpc/include/asm/io.h:616:3: note: expanded from macro 'DEF_PCI_AC_NORET'
                   __do_##name al;                                 \
                   ^~~~~~~~~~~~~~
   <scratch space>:60:1: note: expanded from here
   __do_insl
   ^
   arch/powerpc/include/asm/io.h:558:56: note: expanded from macro '__do_insl'
   #define __do_insl(p, b, n)      readsl((PCI_IO_ADDR)_IO_BASE+(p), (b), (n))
                                          ~~~~~~~~~~~~~~~~~~~~~^
   In file included from kernel/trace/trace.c:18:
   In file included from include/linux/writeback.h:14:
   In file included from include/linux/blk-cgroup.h:17:
   In file included from include/linux/cgroup.h:26:
   In file included from include/linux/kernel_stat.h:9:
   In file included from include/linux/interrupt.h:11:
   In file included from include/linux/hardirq.h:10:
   In file included from arch/powerpc/include/asm/hardirq.h:6:
   In file included from include/linux/irq.h:20:
   In file included from include/linux/io.h:13:
   In file included from arch/powerpc/include/asm/io.h:619:
   arch/powerpc/include/asm/io-defs.h:49:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
   DEF_PCI_AC_NORET(outsb, (unsigned long p, const void *b, unsigned long c),
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/powerpc/include/asm/io.h:616:3: note: expanded from macro 'DEF_PCI_AC_NORET'
                   __do_##name al;                                 \
                   ^~~~~~~~~~~~~~
   <scratch space>:62:1: note: expanded from here
   __do_outsb
   ^
   arch/powerpc/include/asm/io.h:559:58: note: expanded from macro '__do_outsb'
   #define __do_outsb(p, b, n)     writesb((PCI_IO_ADDR)_IO_BASE+(p),(b),(n))
                                           ~~~~~~~~~~~~~~~~~~~~~^
   In file included from kernel/trace/trace.c:18:
   In file included from include/linux/writeback.h:14:
   In file included from include/linux/blk-cgroup.h:17:
   In file included from include/linux/cgroup.h:26:
   In file included from include/linux/kernel_stat.h:9:
   In file included from include/linux/interrupt.h:11:
   In file included from include/linux/hardirq.h:10:
   In file included from arch/powerpc/include/asm/hardirq.h:6:
   In file included from include/linux/irq.h:20:
   In file included from include/linux/io.h:13:
   In file included from arch/powerpc/include/asm/io.h:619:
   arch/powerpc/include/asm/io-defs.h:51:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
   DEF_PCI_AC_NORET(outsw, (unsigned long p, const void *b, unsigned long c),
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/powerpc/include/asm/io.h:616:3: note: expanded from macro 'DEF_PCI_AC_NORET'
                   __do_##name al;                                 \
                   ^~~~~~~~~~~~~~
   <scratch space>:64:1: note: expanded from here
   __do_outsw
   ^
   arch/powerpc/include/asm/io.h:560:58: note: expanded from macro '__do_outsw'
   #define __do_outsw(p, b, n)     writesw((PCI_IO_ADDR)_IO_BASE+(p),(b),(n))
                                           ~~~~~~~~~~~~~~~~~~~~~^
   In file included from kernel/trace/trace.c:18:
   In file included from include/linux/writeback.h:14:
   In file included from include/linux/blk-cgroup.h:17:
   In file included from include/linux/cgroup.h:26:
   In file included from include/linux/kernel_stat.h:9:
   In file included from include/linux/interrupt.h:11:
   In file included from include/linux/hardirq.h:10:
   In file included from arch/powerpc/include/asm/hardirq.h:6:
   In file included from include/linux/irq.h:20:
   In file included from include/linux/io.h:13:
   In file included from arch/powerpc/include/asm/io.h:619:
   arch/powerpc/include/asm/io-defs.h:53:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
   DEF_PCI_AC_NORET(outsl, (unsigned long p, const void *b, unsigned long c),
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/powerpc/include/asm/io.h:616:3: note: expanded from macro 'DEF_PCI_AC_NORET'
                   __do_##name al;                                 \
                   ^~~~~~~~~~~~~~
   <scratch space>:66:1: note: expanded from here
   __do_outsl
   ^
   arch/powerpc/include/asm/io.h:561:58: note: expanded from macro '__do_outsl'
   #define __do_outsl(p, b, n)     writesl((PCI_IO_ADDR)_IO_BASE+(p),(b),(n))
                                           ~~~~~~~~~~~~~~~~~~~~~^
>> kernel/trace/trace.c:7301:1: warning: no previous prototype for function 'trace_ull_config_write' [-Wmissing-prototypes]
   trace_ull_config_write(struct file *filp, const char __user *ubuf, size_t cnt,
   ^
   kernel/trace/trace.c:7300:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   ssize_t
   ^
   static 
>> kernel/trace/trace.c:7348:1: warning: no previous prototype for function 'trace_ull_config_read' [-Wmissing-prototypes]
   trace_ull_config_read(struct file *filp, char __user *ubuf, size_t cnt,
   ^
   kernel/trace/trace.c:7347:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   ssize_t
   ^
   static 
   8 warnings generated.


vim +/trace_ull_config_write +7301 kernel/trace/trace.c

  7287	
  7288	/*
  7289	 * trace_ull_config_write - Generic write function to save u64 value
  7290	 * @filp: The active open file structure
  7291	 * @ubuf: The userspace provided buffer to read value into
  7292	 * @cnt: The maximum number of bytes to read
  7293	 * @ppos: The current "file" position
  7294	 *
  7295	 * This function provides a generic write implementation to save u64 values
  7296	 * from a file on tracefs. The filp->private_data must point to a
  7297	 * trace_ull_config structure that defines where to write the value, the
  7298	 * min and the max acceptable values, and a lock to protect the write.
  7299	 */
  7300	ssize_t
> 7301	trace_ull_config_write(struct file *filp, const char __user *ubuf, size_t cnt,
  7302			       loff_t *ppos)
  7303	{
  7304		struct trace_ull_config *config = filp->private_data;
  7305		u64 val;
  7306		int err;
  7307	
  7308		if (!config)
  7309			return -EFAULT;
  7310	
  7311		err = kstrtoull_from_user(ubuf, cnt, 10, &val);
  7312		if (err)
  7313			return err;
  7314	
  7315		if (config->lock)
  7316			mutex_lock(config->lock);
  7317	
  7318		if (config->min && val < *config->min)
  7319			err = -EINVAL;
  7320	
  7321		if (config->max && val > *config->max)
  7322			err = -EINVAL;
  7323	
  7324		if (!err)
  7325			*config->val = val;
  7326	
  7327		if (config->lock)
  7328			mutex_unlock(config->lock);
  7329	
  7330		if (err)
  7331			return err;
  7332	
  7333		return cnt;
  7334	}
  7335	
  7336	/*
  7337	 * trace_ull_config_read - Generic write function to read u64 value via tracefs
  7338	 * @filp: The active open file structure
  7339	 * @ubuf: The userspace provided buffer to read value into
  7340	 * @cnt: The maximum number of bytes to read
  7341	 * @ppos: The current "file" position
  7342	 *
  7343	 * This function provides a generic read implementation to read a u64 value
  7344	 * from a file on tracefs. The filp->private_data must point to a
  7345	 * trace_ull_config structure with valid data.
  7346	 */
  7347	ssize_t
> 7348	trace_ull_config_read(struct file *filp, char __user *ubuf, size_t cnt,
  7349			      loff_t *ppos)
  7350	{
  7351		struct trace_ull_config *config = filp->private_data;
  7352		char buf[ULL_STR_SIZE];
  7353		u64 val;
  7354	        int len;
  7355	
  7356	        if (!config)
  7357	                return -EFAULT;
  7358	
  7359		val = *config->val;
  7360	
  7361	        if (cnt > sizeof(buf))
  7362	                cnt = sizeof(buf);
  7363	
  7364	        len = snprintf(buf, sizeof(buf), "%llu\n", val);
  7365	
  7366	        return simple_read_from_buffer(ubuf, cnt, ppos, buf, len);
  7367	}
  7368	

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

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 29708 bytes --]

  parent reply	other threads:[~2021-04-23 23:54 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-23 21:05 [RFC PATCH V2 0/9] hwlat improvements and osnoise/timerlat tracers Daniel Bristot de Oliveira
2021-04-23 21:05 ` [RFC PATCH V2 1/9] tracing/hwlat: Fix Clark's email Daniel Bristot de Oliveira
2021-04-23 21:05 ` [RFC PATCH V2 2/9] tracing/hwlat: Implement the mode config option Daniel Bristot de Oliveira
2021-04-23 21:05 ` [RFC PATCH V2 3/9] tracing/hwlat: Switch disable_migrate to mode none Daniel Bristot de Oliveira
2021-04-23 21:05 ` [RFC PATCH V2 4/9] tracing/hwlat: Implement the per-cpu mode Daniel Bristot de Oliveira
2021-04-24  4:43   ` kernel test robot
2021-04-23 21:05 ` [RFC PATCH V2 5/9] tracing/trace: Add a generic function to read/write u64 values from tracefs Daniel Bristot de Oliveira
2021-04-23 23:05   ` kernel test robot
2021-04-23 23:41   ` kernel test robot
2021-04-23 23:41   ` [RFC PATCH] tracing/trace: trace_ull_config_write can be static kernel test robot
2021-04-23 23:54   ` kernel test robot [this message]
2021-04-23 21:05 ` [RFC PATCH V2 6/9] tracing/hwlat: Use the generic function to read/write width and window Daniel Bristot de Oliveira
2021-04-23 21:05 ` [RFC PATCH V2 7/9] tracing: Add __print_ns_to_secs() and __print_ns_without_secs() helpers Daniel Bristot de Oliveira
2021-04-23 21:05 ` [RFC PATCH V2 8/9] tracing: Add osnoise tracer Daniel Bristot de Oliveira
2021-04-24  3:48   ` kernel test robot
2021-04-23 21:05 ` [RFC PATCH V2 9/9] tracing: Add timerlat tracer Daniel Bristot de Oliveira
2021-05-14  8:55   ` Juri Lelli
2021-05-14  8:59     ` Daniel Bristot de Oliveira

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202104240716.mSLcvBsi-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild-all@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.