All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: "Steven Rostedt (Google)" <rostedt@goodmis.org>
Cc: kbuild-all@lists.01.org, Ammar Faizi <ammarfaizi2@gnuweeb.org>,
	GNU/Weeb Mailing List <gwml@vger.gnuweeb.org>,
	linux-kernel@vger.kernel.org
Subject: [ammarfaizi2-block:rostedt/linux-trace/ftrace/core 30/30] include/linux/cpumask.h:95:42: warning: function 'trace_event_get_offsets_foo_bar' might be a candidate for 'gnu_printf' format attribute
Date: Sat, 16 Jul 2022 09:09:15 +0800	[thread overview]
Message-ID: <202207160905.GmOfByea-lkp@intel.com> (raw)

tree:   https://github.com/ammarfaizi2/linux-block rostedt/linux-trace/ftrace/core
head:   26b2da5fc0b41a9a6a5e30b858da28572a6f4cbc
commit: 26b2da5fc0b41a9a6a5e30b858da28572a6f4cbc [30/30] tracing: Add example and documentation for new __vstring() macro
config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20220716/202207160905.GmOfByea-lkp@intel.com/config)
compiler: gcc-11 (Debian 11.3.0-3) 11.3.0
reproduce (this is a W=1 build):
        # https://github.com/ammarfaizi2/linux-block/commit/26b2da5fc0b41a9a6a5e30b858da28572a6f4cbc
        git remote add ammarfaizi2-block https://github.com/ammarfaizi2/linux-block
        git fetch --no-tags ammarfaizi2-block rostedt/linux-trace/ftrace/core
        git checkout 26b2da5fc0b41a9a6a5e30b858da28572a6f4cbc
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash samples/trace_events/

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

All warnings (new ones prefixed by >>):

   In file included from include/trace/define_trace.h:102,
                    from samples/trace_events/trace-events-sample.h:608,
                    from samples/trace_events/trace-events-sample.c:12:
   samples/trace_events/./trace-events-sample.h: In function 'trace_event_get_offsets_foo_bar':
>> include/linux/cpumask.h:95:42: warning: function 'trace_event_get_offsets_foo_bar' might be a candidate for 'gnu_printf' format attribute [-Wsuggest-attribute=format]
      95 | #define cpu_possible_mask ((const struct cpumask *)&__cpu_possible_mask)
         |                                          ^~~~~~~
   include/trace/trace_events.h:263:9: note: in definition of macro 'DECLARE_EVENT_CLASS'
     263 |         tstruct;                                                        \
         |         ^~~~~~~
   include/trace/trace_events.h:43:30: note: in expansion of macro 'PARAMS'
      43 |                              PARAMS(tstruct),                  \
         |                              ^~~~~~
   samples/trace_events/./trace-events-sample.h:277:1: note: in expansion of macro 'TRACE_EVENT'
     277 | TRACE_EVENT(foo_bar,
         | ^~~~~~~~~~~
   samples/trace_events/./trace-events-sample.h:285:9: note: in expansion of macro 'TP_STRUCT__entry'
     285 |         TP_STRUCT__entry(
         |         ^~~~~~~~~~~~~~~~
   include/trace/stages/stage5_get_offsets.h:82:34: note: in expansion of macro '__dynamic_array'
      82 | #define __bitmask(item, nr_bits) __dynamic_array(unsigned long, item,   \
         |                                  ^~~~~~~~~~~~~~~
   include/trace/stages/stage5_get_offsets.h:70:11: note: in expansion of macro '__bitmask_size_in_bytes_raw'
      70 |         ((__bitmask_size_in_bytes_raw(nr_bits) +                \
         |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/trace/stages/stage5_get_offsets.h:83:42: note: in expansion of macro '__bitmask_size_in_longs'
      83 |                                          __bitmask_size_in_longs(nr_bits))
         |                                          ^~~~~~~~~~~~~~~~~~~~~~~
   samples/trace_events/./trace-events-sample.h:290:17: note: in expansion of macro '__bitmask'
     290 |                 __bitmask(      cpus,   num_possible_cpus()     )
         |                 ^~~~~~~~~
   include/linux/cpumask.h:915:48: note: in expansion of macro 'cpu_possible_mask'
     915 | #define num_possible_cpus()     cpumask_weight(cpu_possible_mask)
         |                                                ^~~~~~~~~~~~~~~~~
   samples/trace_events/./trace-events-sample.h:290:41: note: in expansion of macro 'num_possible_cpus'
     290 |                 __bitmask(      cpus,   num_possible_cpus()     )
         |                                         ^~~~~~~~~~~~~~~~~
   In file included from include/trace/define_trace.h:102,
                    from samples/trace_events/trace-events-sample.h:608,
                    from samples/trace_events/trace-events-sample.c:12:
   samples/trace_events/./trace-events-sample.h: In function 'trace_event_raw_event_foo_bar':
   include/trace/trace_events.h:386:16: warning: function 'trace_event_raw_event_foo_bar' might be a candidate for 'gnu_printf' format attribute [-Wsuggest-attribute=format]
     386 |         struct trace_event_raw_##call *entry;                           \
         |                ^~~~~~~~~~~~~~~~
   include/trace/trace_events.h:40:9: note: in expansion of macro 'DECLARE_EVENT_CLASS'
      40 |         DECLARE_EVENT_CLASS(name,                              \
         |         ^~~~~~~~~~~~~~~~~~~
   samples/trace_events/./trace-events-sample.h:277:1: note: in expansion of macro 'TRACE_EVENT'
     277 | TRACE_EVENT(foo_bar,
         | ^~~~~~~~~~~
   In file included from include/trace/define_trace.h:103,
                    from samples/trace_events/trace-events-sample.h:608,
                    from samples/trace_events/trace-events-sample.c:12:
   samples/trace_events/./trace-events-sample.h: In function 'perf_trace_foo_bar':
   include/trace/perf.h:64:16: warning: function 'perf_trace_foo_bar' might be a candidate for 'gnu_printf' format attribute [-Wsuggest-attribute=format]
      64 |         struct hlist_head *head;                                        \
         |                ^~~~~~~~~~
   include/trace/trace_events.h:40:9: note: in expansion of macro 'DECLARE_EVENT_CLASS'
      40 |         DECLARE_EVENT_CLASS(name,                              \
         |         ^~~~~~~~~~~~~~~~~~~
   samples/trace_events/./trace-events-sample.h:277:1: note: in expansion of macro 'TRACE_EVENT'
     277 | TRACE_EVENT(foo_bar,
         | ^~~~~~~~~~~


vim +95 include/linux/cpumask.h

^1da177e4c3f415 Linus Torvalds   2005-04-16   49  
^1da177e4c3f415 Linus Torvalds   2005-04-16   50  /*
^1da177e4c3f415 Linus Torvalds   2005-04-16   51   * The following particular system cpumasks and operations manage
b3199c025d1646e Rusty Russell    2008-12-30   52   * possible, present, active and online cpus.
^1da177e4c3f415 Linus Torvalds   2005-04-16   53   *
b3199c025d1646e Rusty Russell    2008-12-30   54   *     cpu_possible_mask- has bit 'cpu' set iff cpu is populatable
b3199c025d1646e Rusty Russell    2008-12-30   55   *     cpu_present_mask - has bit 'cpu' set iff cpu is populated
b3199c025d1646e Rusty Russell    2008-12-30   56   *     cpu_online_mask  - has bit 'cpu' set iff cpu available to scheduler
b3199c025d1646e Rusty Russell    2008-12-30   57   *     cpu_active_mask  - has bit 'cpu' set iff cpu available to migration
^1da177e4c3f415 Linus Torvalds   2005-04-16   58   *
b3199c025d1646e Rusty Russell    2008-12-30   59   *  If !CONFIG_HOTPLUG_CPU, present == possible, and active == online.
^1da177e4c3f415 Linus Torvalds   2005-04-16   60   *
b3199c025d1646e Rusty Russell    2008-12-30   61   *  The cpu_possible_mask is fixed at boot time, as the set of CPU id's
b3199c025d1646e Rusty Russell    2008-12-30   62   *  that it is possible might ever be plugged in at anytime during the
b3199c025d1646e Rusty Russell    2008-12-30   63   *  life of that system boot.  The cpu_present_mask is dynamic(*),
b3199c025d1646e Rusty Russell    2008-12-30   64   *  representing which CPUs are currently plugged in.  And
b3199c025d1646e Rusty Russell    2008-12-30   65   *  cpu_online_mask is the dynamic subset of cpu_present_mask,
b3199c025d1646e Rusty Russell    2008-12-30   66   *  indicating those CPUs available for scheduling.
b3199c025d1646e Rusty Russell    2008-12-30   67   *
b3199c025d1646e Rusty Russell    2008-12-30   68   *  If HOTPLUG is enabled, then cpu_possible_mask is forced to have
^1da177e4c3f415 Linus Torvalds   2005-04-16   69   *  all NR_CPUS bits set, otherwise it is just the set of CPUs that
^1da177e4c3f415 Linus Torvalds   2005-04-16   70   *  ACPI reports present at boot.
^1da177e4c3f415 Linus Torvalds   2005-04-16   71   *
b3199c025d1646e Rusty Russell    2008-12-30   72   *  If HOTPLUG is enabled, then cpu_present_mask varies dynamically,
^1da177e4c3f415 Linus Torvalds   2005-04-16   73   *  depending on what ACPI reports as currently plugged in, otherwise
b3199c025d1646e Rusty Russell    2008-12-30   74   *  cpu_present_mask is just a copy of cpu_possible_mask.
^1da177e4c3f415 Linus Torvalds   2005-04-16   75   *
b3199c025d1646e Rusty Russell    2008-12-30   76   *  (*) Well, cpu_present_mask is dynamic in the hotplug case.  If not
b3199c025d1646e Rusty Russell    2008-12-30   77   *      hotplug, it's a copy of cpu_possible_mask, hence fixed at boot.
^1da177e4c3f415 Linus Torvalds   2005-04-16   78   *
^1da177e4c3f415 Linus Torvalds   2005-04-16   79   * Subtleties:
^1da177e4c3f415 Linus Torvalds   2005-04-16   80   * 1) UP arch's (NR_CPUS == 1, CONFIG_SMP not defined) hardcode
^1da177e4c3f415 Linus Torvalds   2005-04-16   81   *    assumption that their single CPU is online.  The UP
b3199c025d1646e Rusty Russell    2008-12-30   82   *    cpu_{online,possible,present}_masks are placebos.  Changing them
^1da177e4c3f415 Linus Torvalds   2005-04-16   83   *    will have no useful affect on the following num_*_cpus()
^1da177e4c3f415 Linus Torvalds   2005-04-16   84   *    and cpu_*() macros in the UP case.  This ugliness is a UP
^1da177e4c3f415 Linus Torvalds   2005-04-16   85   *    optimization - don't waste any instructions or memory references
^1da177e4c3f415 Linus Torvalds   2005-04-16   86   *    asking if you're online or how many CPUs there are if there is
^1da177e4c3f415 Linus Torvalds   2005-04-16   87   *    only one CPU.
^1da177e4c3f415 Linus Torvalds   2005-04-16   88   */
^1da177e4c3f415 Linus Torvalds   2005-04-16   89  
4b804c85dc37db6 Rasmus Villemoes 2016-01-20   90  extern struct cpumask __cpu_possible_mask;
4b804c85dc37db6 Rasmus Villemoes 2016-01-20   91  extern struct cpumask __cpu_online_mask;
4b804c85dc37db6 Rasmus Villemoes 2016-01-20   92  extern struct cpumask __cpu_present_mask;
4b804c85dc37db6 Rasmus Villemoes 2016-01-20   93  extern struct cpumask __cpu_active_mask;
e40f74c535b8a0e Peter Zijlstra   2021-01-19   94  extern struct cpumask __cpu_dying_mask;
5aec01b834fd6f8 Rasmus Villemoes 2016-01-20  @95  #define cpu_possible_mask ((const struct cpumask *)&__cpu_possible_mask)
5aec01b834fd6f8 Rasmus Villemoes 2016-01-20   96  #define cpu_online_mask   ((const struct cpumask *)&__cpu_online_mask)
5aec01b834fd6f8 Rasmus Villemoes 2016-01-20   97  #define cpu_present_mask  ((const struct cpumask *)&__cpu_present_mask)
5aec01b834fd6f8 Rasmus Villemoes 2016-01-20   98  #define cpu_active_mask   ((const struct cpumask *)&__cpu_active_mask)
e40f74c535b8a0e Peter Zijlstra   2021-01-19   99  #define cpu_dying_mask    ((const struct cpumask *)&__cpu_dying_mask)
b3199c025d1646e Rusty Russell    2008-12-30  100  

:::::: The code at line 95 was first introduced by commit
:::::: 5aec01b834fd6f8ca49d1aeede665b950d0c148e kernel/cpu.c: eliminate cpu_*_mask

:::::: TO: Rasmus Villemoes <linux@rasmusvillemoes.dk>
:::::: CC: Linus Torvalds <torvalds@linux-foundation.org>

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

             reply	other threads:[~2022-07-16  1:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-16  1:09 kernel test robot [this message]
2022-07-16  3:04 ` [ammarfaizi2-block:rostedt/linux-trace/ftrace/core 30/30] include/linux/cpumask.h:95:42: warning: function 'trace_event_get_offsets_foo_bar' might be a candidate for 'gnu_printf' format attribute Steven Rostedt
2022-07-16  3:04   ` Steven Rostedt
2022-07-19  0:38   ` [kbuild-all] " Chen, Rong A

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=202207160905.GmOfByea-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=ammarfaizi2@gnuweeb.org \
    --cc=gwml@vger.gnuweeb.org \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rostedt@goodmis.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.