Re: [PATCH] kunit: Print test statistics on failure

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi David,

I love your patch! Perhaps something to improve:

[auto build test WARNING on 5f6b99d0287de2c2d0b5e7abcb0092d553ad804a]

url:    https://github.com/0day-ci/linux/commits/David-Gow/kunit-Print-test-statistics-on-failure/20201211-153009
base:    5f6b99d0287de2c2d0b5e7abcb0092d553ad804a
config: arc-randconfig-r006-20201210 (attached as .config)
compiler: arceb-elf-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
        # https://github.com/0day-ci/linux/commit/2bdf1b55a1b3673a1a02f71457fc52b497fc7223
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review David-Gow/kunit-Print-test-statistics-on-failure/20201211-153009
        git checkout 2bdf1b55a1b3673a1a02f71457fc52b497fc7223
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arc 

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

All warnings (new ones prefixed by >>):

   In file included from lib/kunit/test.c:9:
   lib/kunit/test.c: In function 'kunit_print_test_stats':
>> include/linux/kern_levels.h:5:18: warning: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'size_t' {aka 'unsigned int'} [-Wformat=]
       5 | #define KERN_SOH "\001"  /* ASCII Start Of Header */
         |                  ^~~~~~
   include/kunit/test.h:621:10: note: in definition of macro 'kunit_log'
     621 |   printk(lvl fmt, ##__VA_ARGS__);    \
         |          ^~~
   include/linux/kern_levels.h:14:19: note: in expansion of macro 'KERN_SOH'
      14 | #define KERN_INFO KERN_SOH "6" /* informational */
         |                   ^~~~~~~~
   lib/kunit/test.c:46:12: note: in expansion of macro 'KERN_INFO'
      46 |  kunit_log(KERN_INFO, test,
         |            ^~~~~~~~~
   lib/kunit/test.c:48:14: note: format string is defined here
      48 |     "# %s: %lu / %lu test parameters failed",
         |            ~~^
         |              |
         |              long unsigned int
         |            %u
   In file included from lib/kunit/test.c:9:
   include/linux/kern_levels.h:5:18: warning: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'size_t' {aka 'unsigned int'} [-Wformat=]
       5 | #define KERN_SOH "\001"  /* ASCII Start Of Header */
         |                  ^~~~~~
   include/kunit/test.h:621:10: note: in definition of macro 'kunit_log'
     621 |   printk(lvl fmt, ##__VA_ARGS__);    \
         |          ^~~
   include/linux/kern_levels.h:14:19: note: in expansion of macro 'KERN_SOH'
      14 | #define KERN_INFO KERN_SOH "6" /* informational */
         |                   ^~~~~~~~
   lib/kunit/test.c:46:12: note: in expansion of macro 'KERN_INFO'
      46 |  kunit_log(KERN_INFO, test,
         |            ^~~~~~~~~
   lib/kunit/test.c:48:20: note: format string is defined here
      48 |     "# %s: %lu / %lu test parameters failed",
         |                  ~~^
         |                    |
         |                    long unsigned int
         |                  %u
   lib/kunit/test.c: In function 'kunit_log_append':
   lib/kunit/test.c:72:2: warning: function 'kunit_log_append' might be a candidate for 'gnu_printf' format attribute [-Wsuggest-attribute=format]
      72 |  vsnprintf(line, sizeof(line), fmt, args);
         |  ^~~~~~~~~
   In file included from lib/kunit/test.c:9:
   lib/kunit/test.c: In function 'kunit_print_suite_stats':
>> include/linux/kern_levels.h:5:18: warning: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'size_t' {aka 'unsigned int'} [-Wformat=]
       5 | #define KERN_SOH "\001"  /* ASCII Start Of Header */
         |                  ^~~~~~
   include/kunit/test.h:621:10: note: in definition of macro 'kunit_log'
     621 |   printk(lvl fmt, ##__VA_ARGS__);    \
         |          ^~~
   include/linux/kern_levels.h:14:19: note: in expansion of macro 'KERN_SOH'
      14 | #define KERN_INFO KERN_SOH "6" /* informational */
         |                   ^~~~~~~~
   lib/kunit/test.c:394:12: note: in expansion of macro 'KERN_INFO'
     394 |  kunit_log(KERN_INFO, suite,
         |            ^~~~~~~~~
   lib/kunit/test.c:395:15: note: format string is defined here
     395 |     "# %s: (%lu / %lu) tests failed (%lu / %lu test parameters)",
         |             ~~^
         |               |
         |               long unsigned int
         |             %u
   In file included from lib/kunit/test.c:9:
   include/linux/kern_levels.h:5:18: warning: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'size_t' {aka 'unsigned int'} [-Wformat=]
       5 | #define KERN_SOH "\001"  /* ASCII Start Of Header */
         |                  ^~~~~~
   include/kunit/test.h:621:10: note: in definition of macro 'kunit_log'
     621 |   printk(lvl fmt, ##__VA_ARGS__);    \
         |          ^~~
   include/linux/kern_levels.h:14:19: note: in expansion of macro 'KERN_SOH'
      14 | #define KERN_INFO KERN_SOH "6" /* informational */
         |                   ^~~~~~~~
   lib/kunit/test.c:394:12: note: in expansion of macro 'KERN_INFO'
     394 |  kunit_log(KERN_INFO, suite,
         |            ^~~~~~~~~
   lib/kunit/test.c:395:21: note: format string is defined here
     395 |     "# %s: (%lu / %lu) tests failed (%lu / %lu test parameters)",
         |                   ~~^
         |                     |
         |                     long unsigned int
         |                   %u
   In file included from lib/kunit/test.c:9:
   include/linux/kern_levels.h:5:18: warning: format '%lu' expects argument of type 'long unsigned int', but argument 5 has type 'size_t' {aka 'unsigned int'} [-Wformat=]
       5 | #define KERN_SOH "\001"  /* ASCII Start Of Header */
         |                  ^~~~~~
   include/kunit/test.h:621:10: note: in definition of macro 'kunit_log'
     621 |   printk(lvl fmt, ##__VA_ARGS__);    \
         |          ^~~
   include/linux/kern_levels.h:14:19: note: in expansion of macro 'KERN_SOH'
      14 | #define KERN_INFO KERN_SOH "6" /* informational */
         |                   ^~~~~~~~
   lib/kunit/test.c:394:12: note: in expansion of macro 'KERN_INFO'
     394 |  kunit_log(KERN_INFO, suite,
         |            ^~~~~~~~~
   lib/kunit/test.c:395:40: note: format string is defined here
     395 |     "# %s: (%lu / %lu) tests failed (%lu / %lu test parameters)",
         |                                      ~~^
         |                                        |
         |                                        long unsigned int
         |                                      %u
   In file included from lib/kunit/test.c:9:
   include/linux/kern_levels.h:5:18: warning: format '%lu' expects argument of type 'long unsigned int', but argument 6 has type 'size_t' {aka 'unsigned int'} [-Wformat=]
       5 | #define KERN_SOH "\001"  /* ASCII Start Of Header */
         |                  ^~~~~~
   include/kunit/test.h:621:10: note: in definition of macro 'kunit_log'
     621 |   printk(lvl fmt, ##__VA_ARGS__);    \
         |          ^~~
   include/linux/kern_levels.h:14:19: note: in expansion of macro 'KERN_SOH'
      14 | #define KERN_INFO KERN_SOH "6" /* informational */
         |                   ^~~~~~~~
   lib/kunit/test.c:394:12: note: in expansion of macro 'KERN_INFO'
     394 |  kunit_log(KERN_INFO, suite,
         |            ^~~~~~~~~
   lib/kunit/test.c:395:46: note: format string is defined here
     395 |     "# %s: (%lu / %lu) tests failed (%lu / %lu test parameters)",
         |                                            ~~^
         |                                              |
         |                                              long unsigned int
         |                                            %u

vim +5 include/linux/kern_levels.h

314ba3520e513a Joe Perches 2012-07-30  4  
04d2c8c83d0e3a Joe Perches 2012-07-30 @5  #define KERN_SOH	"\001"		/* ASCII Start Of Header */
04d2c8c83d0e3a Joe Perches 2012-07-30  6  #define KERN_SOH_ASCII	'\001'
04d2c8c83d0e3a Joe Perches 2012-07-30  7  

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

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux