All of lore.kernel.org
 help / color / mirror / Atom feed
* [trace:ftrace/core 35/39] kernel/trace/trace_boot.c:418:17: warning: this 'if' clause does not guard...
@ 2021-08-31 12:57 ` kernel test robot
  0 siblings, 0 replies; 6+ messages in thread
From: kernel test robot @ 2021-08-31 12:57 UTC (permalink / raw)
  To: Masami Hiramatsu; +Cc: kbuild-all, linux-kernel, Steven Rostedt (VMware)

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git ftrace/core
head:   3dc65994e3c1c999be3d991cdc96705e167cb3b1
commit: 5d4648a0415efc239ffb377bce1d389723eda25d [35/39] tracing/boot: Show correct histogram error command
config: s390-allyesconfig (attached as .config)
compiler: s390-linux-gcc (GCC) 11.2.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://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git/commit/?id=5d4648a0415efc239ffb377bce1d389723eda25d
        git remote add trace https://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git
        git fetch --no-tags trace ftrace/core
        git checkout 5d4648a0415efc239ffb377bce1d389723eda25d
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=s390 

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 >>):

   kernel/trace/trace_boot.c: In function 'trace_boot_init_histograms':
>> kernel/trace/trace_boot.c:418:17: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
     418 |                 if (trace_boot_compose_hist_cmd(hnode, buf, size) == 0)
         |                 ^~
   kernel/trace/trace_boot.c:420:25: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
     420 |                         if (trigger_process_regex(file, buf) < 0)
         |                         ^~


vim +/if +418 kernel/trace/trace_boot.c

30cb856e3067e5 Masami Hiramatsu 2021-08-06  395  
30cb856e3067e5 Masami Hiramatsu 2021-08-06  396  static void __init
30cb856e3067e5 Masami Hiramatsu 2021-08-06  397  trace_boot_init_histograms(struct trace_event_file *file,
30cb856e3067e5 Masami Hiramatsu 2021-08-06  398  			   struct xbc_node *hnode, char *buf, size_t size)
30cb856e3067e5 Masami Hiramatsu 2021-08-06  399  {
30cb856e3067e5 Masami Hiramatsu 2021-08-06  400  	struct xbc_node *node;
30cb856e3067e5 Masami Hiramatsu 2021-08-06  401  	const char *p;
5d4648a0415efc Masami Hiramatsu 2021-08-06  402  	char *tmp;
30cb856e3067e5 Masami Hiramatsu 2021-08-06  403  
30cb856e3067e5 Masami Hiramatsu 2021-08-06  404  	xbc_node_for_each_subkey(hnode, node) {
30cb856e3067e5 Masami Hiramatsu 2021-08-06  405  		p = xbc_node_get_data(node);
30cb856e3067e5 Masami Hiramatsu 2021-08-06  406  		if (!isdigit(p[0]))
30cb856e3067e5 Masami Hiramatsu 2021-08-06  407  			continue;
30cb856e3067e5 Masami Hiramatsu 2021-08-06  408  		/* All digit started node should be instances. */
30cb856e3067e5 Masami Hiramatsu 2021-08-06  409  		if (trace_boot_compose_hist_cmd(node, buf, size) == 0) {
5d4648a0415efc Masami Hiramatsu 2021-08-06  410  			tmp = kstrdup(buf, GFP_KERNEL);
30cb856e3067e5 Masami Hiramatsu 2021-08-06  411  			if (trigger_process_regex(file, buf) < 0)
5d4648a0415efc Masami Hiramatsu 2021-08-06  412  				pr_err("Failed to apply hist trigger: %s\n", tmp);
5d4648a0415efc Masami Hiramatsu 2021-08-06  413  			kfree(tmp);
30cb856e3067e5 Masami Hiramatsu 2021-08-06  414  		}
30cb856e3067e5 Masami Hiramatsu 2021-08-06  415  	}
30cb856e3067e5 Masami Hiramatsu 2021-08-06  416  
30cb856e3067e5 Masami Hiramatsu 2021-08-06  417  	if (xbc_node_find_child(hnode, "keys")) {
30cb856e3067e5 Masami Hiramatsu 2021-08-06 @418  		if (trace_boot_compose_hist_cmd(hnode, buf, size) == 0)
5d4648a0415efc Masami Hiramatsu 2021-08-06  419  			tmp = kstrdup(buf, GFP_KERNEL);
30cb856e3067e5 Masami Hiramatsu 2021-08-06  420  			if (trigger_process_regex(file, buf) < 0)
5d4648a0415efc Masami Hiramatsu 2021-08-06  421  				pr_err("Failed to apply hist trigger: %s\n", tmp);
5d4648a0415efc Masami Hiramatsu 2021-08-06  422  			kfree(tmp);
30cb856e3067e5 Masami Hiramatsu 2021-08-06  423  	}
30cb856e3067e5 Masami Hiramatsu 2021-08-06  424  

:::::: The code at line 418 was first introduced by commit
:::::: 30cb856e3067e5d6ae7b2144e1659145ab7686fd tracing/boot: Support multiple histograms for each event

:::::: TO: Masami Hiramatsu <mhiramat@kernel.org>
:::::: CC: Steven Rostedt (VMware) <rostedt@goodmis.org>

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

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [trace:ftrace/core 35/39] kernel/trace/trace_boot.c:418:17: warning: this 'if' clause does not guard...
@ 2021-08-31 12:57 ` kernel test robot
  0 siblings, 0 replies; 6+ messages in thread
From: kernel test robot @ 2021-08-31 12:57 UTC (permalink / raw)
  To: kbuild-all

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git ftrace/core
head:   3dc65994e3c1c999be3d991cdc96705e167cb3b1
commit: 5d4648a0415efc239ffb377bce1d389723eda25d [35/39] tracing/boot: Show correct histogram error command
config: s390-allyesconfig (attached as .config)
compiler: s390-linux-gcc (GCC) 11.2.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://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git/commit/?id=5d4648a0415efc239ffb377bce1d389723eda25d
        git remote add trace https://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git
        git fetch --no-tags trace ftrace/core
        git checkout 5d4648a0415efc239ffb377bce1d389723eda25d
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=s390 

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 >>):

   kernel/trace/trace_boot.c: In function 'trace_boot_init_histograms':
>> kernel/trace/trace_boot.c:418:17: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
     418 |                 if (trace_boot_compose_hist_cmd(hnode, buf, size) == 0)
         |                 ^~
   kernel/trace/trace_boot.c:420:25: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
     420 |                         if (trigger_process_regex(file, buf) < 0)
         |                         ^~


vim +/if +418 kernel/trace/trace_boot.c

30cb856e3067e5 Masami Hiramatsu 2021-08-06  395  
30cb856e3067e5 Masami Hiramatsu 2021-08-06  396  static void __init
30cb856e3067e5 Masami Hiramatsu 2021-08-06  397  trace_boot_init_histograms(struct trace_event_file *file,
30cb856e3067e5 Masami Hiramatsu 2021-08-06  398  			   struct xbc_node *hnode, char *buf, size_t size)
30cb856e3067e5 Masami Hiramatsu 2021-08-06  399  {
30cb856e3067e5 Masami Hiramatsu 2021-08-06  400  	struct xbc_node *node;
30cb856e3067e5 Masami Hiramatsu 2021-08-06  401  	const char *p;
5d4648a0415efc Masami Hiramatsu 2021-08-06  402  	char *tmp;
30cb856e3067e5 Masami Hiramatsu 2021-08-06  403  
30cb856e3067e5 Masami Hiramatsu 2021-08-06  404  	xbc_node_for_each_subkey(hnode, node) {
30cb856e3067e5 Masami Hiramatsu 2021-08-06  405  		p = xbc_node_get_data(node);
30cb856e3067e5 Masami Hiramatsu 2021-08-06  406  		if (!isdigit(p[0]))
30cb856e3067e5 Masami Hiramatsu 2021-08-06  407  			continue;
30cb856e3067e5 Masami Hiramatsu 2021-08-06  408  		/* All digit started node should be instances. */
30cb856e3067e5 Masami Hiramatsu 2021-08-06  409  		if (trace_boot_compose_hist_cmd(node, buf, size) == 0) {
5d4648a0415efc Masami Hiramatsu 2021-08-06  410  			tmp = kstrdup(buf, GFP_KERNEL);
30cb856e3067e5 Masami Hiramatsu 2021-08-06  411  			if (trigger_process_regex(file, buf) < 0)
5d4648a0415efc Masami Hiramatsu 2021-08-06  412  				pr_err("Failed to apply hist trigger: %s\n", tmp);
5d4648a0415efc Masami Hiramatsu 2021-08-06  413  			kfree(tmp);
30cb856e3067e5 Masami Hiramatsu 2021-08-06  414  		}
30cb856e3067e5 Masami Hiramatsu 2021-08-06  415  	}
30cb856e3067e5 Masami Hiramatsu 2021-08-06  416  
30cb856e3067e5 Masami Hiramatsu 2021-08-06  417  	if (xbc_node_find_child(hnode, "keys")) {
30cb856e3067e5 Masami Hiramatsu 2021-08-06 @418  		if (trace_boot_compose_hist_cmd(hnode, buf, size) == 0)
5d4648a0415efc Masami Hiramatsu 2021-08-06  419  			tmp = kstrdup(buf, GFP_KERNEL);
30cb856e3067e5 Masami Hiramatsu 2021-08-06  420  			if (trigger_process_regex(file, buf) < 0)
5d4648a0415efc Masami Hiramatsu 2021-08-06  421  				pr_err("Failed to apply hist trigger: %s\n", tmp);
5d4648a0415efc Masami Hiramatsu 2021-08-06  422  			kfree(tmp);
30cb856e3067e5 Masami Hiramatsu 2021-08-06  423  	}
30cb856e3067e5 Masami Hiramatsu 2021-08-06  424  

:::::: The code@line 418 was first introduced by commit
:::::: 30cb856e3067e5d6ae7b2144e1659145ab7686fd tracing/boot: Support multiple histograms for each event

:::::: TO: Masami Hiramatsu <mhiramat@kernel.org>
:::::: CC: Steven Rostedt (VMware) <rostedt@goodmis.org>

---
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: 66826 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [trace:ftrace/core 35/39] kernel/trace/trace_boot.c:418:17: warning: this 'if' clause does not guard...
  2021-08-31 12:57 ` kernel test robot
@ 2021-08-31 13:15   ` Masami Hiramatsu
  -1 siblings, 0 replies; 6+ messages in thread
From: Masami Hiramatsu @ 2021-08-31 13:15 UTC (permalink / raw)
  To: kernel test robot; +Cc: kbuild-all, linux-kernel, Steven Rostedt (VMware)

Oops, thanks for the great test bot!
Let me send a fix asap.

Thank you,

On Tue, 31 Aug 2021 20:57:56 +0800
kernel test robot <lkp@intel.com> wrote:

> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git ftrace/core
> head:   3dc65994e3c1c999be3d991cdc96705e167cb3b1
> commit: 5d4648a0415efc239ffb377bce1d389723eda25d [35/39] tracing/boot: Show correct histogram error command
> config: s390-allyesconfig (attached as .config)
> compiler: s390-linux-gcc (GCC) 11.2.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://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git/commit/?id=5d4648a0415efc239ffb377bce1d389723eda25d
>         git remote add trace https://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git
>         git fetch --no-tags trace ftrace/core
>         git checkout 5d4648a0415efc239ffb377bce1d389723eda25d
>         # save the attached .config to linux build tree
>         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=s390 
> 
> 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 >>):
> 
>    kernel/trace/trace_boot.c: In function 'trace_boot_init_histograms':
> >> kernel/trace/trace_boot.c:418:17: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
>      418 |                 if (trace_boot_compose_hist_cmd(hnode, buf, size) == 0)
>          |                 ^~
>    kernel/trace/trace_boot.c:420:25: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
>      420 |                         if (trigger_process_regex(file, buf) < 0)
>          |                         ^~
> 
> 
> vim +/if +418 kernel/trace/trace_boot.c
> 
> 30cb856e3067e5 Masami Hiramatsu 2021-08-06  395  
> 30cb856e3067e5 Masami Hiramatsu 2021-08-06  396  static void __init
> 30cb856e3067e5 Masami Hiramatsu 2021-08-06  397  trace_boot_init_histograms(struct trace_event_file *file,
> 30cb856e3067e5 Masami Hiramatsu 2021-08-06  398  			   struct xbc_node *hnode, char *buf, size_t size)
> 30cb856e3067e5 Masami Hiramatsu 2021-08-06  399  {
> 30cb856e3067e5 Masami Hiramatsu 2021-08-06  400  	struct xbc_node *node;
> 30cb856e3067e5 Masami Hiramatsu 2021-08-06  401  	const char *p;
> 5d4648a0415efc Masami Hiramatsu 2021-08-06  402  	char *tmp;
> 30cb856e3067e5 Masami Hiramatsu 2021-08-06  403  
> 30cb856e3067e5 Masami Hiramatsu 2021-08-06  404  	xbc_node_for_each_subkey(hnode, node) {
> 30cb856e3067e5 Masami Hiramatsu 2021-08-06  405  		p = xbc_node_get_data(node);
> 30cb856e3067e5 Masami Hiramatsu 2021-08-06  406  		if (!isdigit(p[0]))
> 30cb856e3067e5 Masami Hiramatsu 2021-08-06  407  			continue;
> 30cb856e3067e5 Masami Hiramatsu 2021-08-06  408  		/* All digit started node should be instances. */
> 30cb856e3067e5 Masami Hiramatsu 2021-08-06  409  		if (trace_boot_compose_hist_cmd(node, buf, size) == 0) {
> 5d4648a0415efc Masami Hiramatsu 2021-08-06  410  			tmp = kstrdup(buf, GFP_KERNEL);
> 30cb856e3067e5 Masami Hiramatsu 2021-08-06  411  			if (trigger_process_regex(file, buf) < 0)
> 5d4648a0415efc Masami Hiramatsu 2021-08-06  412  				pr_err("Failed to apply hist trigger: %s\n", tmp);
> 5d4648a0415efc Masami Hiramatsu 2021-08-06  413  			kfree(tmp);
> 30cb856e3067e5 Masami Hiramatsu 2021-08-06  414  		}
> 30cb856e3067e5 Masami Hiramatsu 2021-08-06  415  	}
> 30cb856e3067e5 Masami Hiramatsu 2021-08-06  416  
> 30cb856e3067e5 Masami Hiramatsu 2021-08-06  417  	if (xbc_node_find_child(hnode, "keys")) {
> 30cb856e3067e5 Masami Hiramatsu 2021-08-06 @418  		if (trace_boot_compose_hist_cmd(hnode, buf, size) == 0)
> 5d4648a0415efc Masami Hiramatsu 2021-08-06  419  			tmp = kstrdup(buf, GFP_KERNEL);
> 30cb856e3067e5 Masami Hiramatsu 2021-08-06  420  			if (trigger_process_regex(file, buf) < 0)
> 5d4648a0415efc Masami Hiramatsu 2021-08-06  421  				pr_err("Failed to apply hist trigger: %s\n", tmp);
> 5d4648a0415efc Masami Hiramatsu 2021-08-06  422  			kfree(tmp);
> 30cb856e3067e5 Masami Hiramatsu 2021-08-06  423  	}
> 30cb856e3067e5 Masami Hiramatsu 2021-08-06  424  
> 
> :::::: The code at line 418 was first introduced by commit
> :::::: 30cb856e3067e5d6ae7b2144e1659145ab7686fd tracing/boot: Support multiple histograms for each event
> 
> :::::: TO: Masami Hiramatsu <mhiramat@kernel.org>
> :::::: CC: Steven Rostedt (VMware) <rostedt@goodmis.org>
> 
> ---
> 0-DAY CI Kernel Test Service, Intel Corporation
> https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org


-- 
Masami Hiramatsu <mhiramat@kernel.org>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [trace:ftrace/core 35/39] kernel/trace/trace_boot.c:418:17: warning: this 'if' clause does not guard...
@ 2021-08-31 13:15   ` Masami Hiramatsu
  0 siblings, 0 replies; 6+ messages in thread
From: Masami Hiramatsu @ 2021-08-31 13:15 UTC (permalink / raw)
  To: kbuild-all

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

Oops, thanks for the great test bot!
Let me send a fix asap.

Thank you,

On Tue, 31 Aug 2021 20:57:56 +0800
kernel test robot <lkp@intel.com> wrote:

> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git ftrace/core
> head:   3dc65994e3c1c999be3d991cdc96705e167cb3b1
> commit: 5d4648a0415efc239ffb377bce1d389723eda25d [35/39] tracing/boot: Show correct histogram error command
> config: s390-allyesconfig (attached as .config)
> compiler: s390-linux-gcc (GCC) 11.2.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://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git/commit/?id=5d4648a0415efc239ffb377bce1d389723eda25d
>         git remote add trace https://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git
>         git fetch --no-tags trace ftrace/core
>         git checkout 5d4648a0415efc239ffb377bce1d389723eda25d
>         # save the attached .config to linux build tree
>         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=s390 
> 
> 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 >>):
> 
>    kernel/trace/trace_boot.c: In function 'trace_boot_init_histograms':
> >> kernel/trace/trace_boot.c:418:17: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
>      418 |                 if (trace_boot_compose_hist_cmd(hnode, buf, size) == 0)
>          |                 ^~
>    kernel/trace/trace_boot.c:420:25: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
>      420 |                         if (trigger_process_regex(file, buf) < 0)
>          |                         ^~
> 
> 
> vim +/if +418 kernel/trace/trace_boot.c
> 
> 30cb856e3067e5 Masami Hiramatsu 2021-08-06  395  
> 30cb856e3067e5 Masami Hiramatsu 2021-08-06  396  static void __init
> 30cb856e3067e5 Masami Hiramatsu 2021-08-06  397  trace_boot_init_histograms(struct trace_event_file *file,
> 30cb856e3067e5 Masami Hiramatsu 2021-08-06  398  			   struct xbc_node *hnode, char *buf, size_t size)
> 30cb856e3067e5 Masami Hiramatsu 2021-08-06  399  {
> 30cb856e3067e5 Masami Hiramatsu 2021-08-06  400  	struct xbc_node *node;
> 30cb856e3067e5 Masami Hiramatsu 2021-08-06  401  	const char *p;
> 5d4648a0415efc Masami Hiramatsu 2021-08-06  402  	char *tmp;
> 30cb856e3067e5 Masami Hiramatsu 2021-08-06  403  
> 30cb856e3067e5 Masami Hiramatsu 2021-08-06  404  	xbc_node_for_each_subkey(hnode, node) {
> 30cb856e3067e5 Masami Hiramatsu 2021-08-06  405  		p = xbc_node_get_data(node);
> 30cb856e3067e5 Masami Hiramatsu 2021-08-06  406  		if (!isdigit(p[0]))
> 30cb856e3067e5 Masami Hiramatsu 2021-08-06  407  			continue;
> 30cb856e3067e5 Masami Hiramatsu 2021-08-06  408  		/* All digit started node should be instances. */
> 30cb856e3067e5 Masami Hiramatsu 2021-08-06  409  		if (trace_boot_compose_hist_cmd(node, buf, size) == 0) {
> 5d4648a0415efc Masami Hiramatsu 2021-08-06  410  			tmp = kstrdup(buf, GFP_KERNEL);
> 30cb856e3067e5 Masami Hiramatsu 2021-08-06  411  			if (trigger_process_regex(file, buf) < 0)
> 5d4648a0415efc Masami Hiramatsu 2021-08-06  412  				pr_err("Failed to apply hist trigger: %s\n", tmp);
> 5d4648a0415efc Masami Hiramatsu 2021-08-06  413  			kfree(tmp);
> 30cb856e3067e5 Masami Hiramatsu 2021-08-06  414  		}
> 30cb856e3067e5 Masami Hiramatsu 2021-08-06  415  	}
> 30cb856e3067e5 Masami Hiramatsu 2021-08-06  416  
> 30cb856e3067e5 Masami Hiramatsu 2021-08-06  417  	if (xbc_node_find_child(hnode, "keys")) {
> 30cb856e3067e5 Masami Hiramatsu 2021-08-06 @418  		if (trace_boot_compose_hist_cmd(hnode, buf, size) == 0)
> 5d4648a0415efc Masami Hiramatsu 2021-08-06  419  			tmp = kstrdup(buf, GFP_KERNEL);
> 30cb856e3067e5 Masami Hiramatsu 2021-08-06  420  			if (trigger_process_regex(file, buf) < 0)
> 5d4648a0415efc Masami Hiramatsu 2021-08-06  421  				pr_err("Failed to apply hist trigger: %s\n", tmp);
> 5d4648a0415efc Masami Hiramatsu 2021-08-06  422  			kfree(tmp);
> 30cb856e3067e5 Masami Hiramatsu 2021-08-06  423  	}
> 30cb856e3067e5 Masami Hiramatsu 2021-08-06  424  
> 
> :::::: The code at line 418 was first introduced by commit
> :::::: 30cb856e3067e5d6ae7b2144e1659145ab7686fd tracing/boot: Support multiple histograms for each event
> 
> :::::: TO: Masami Hiramatsu <mhiramat@kernel.org>
> :::::: CC: Steven Rostedt (VMware) <rostedt@goodmis.org>
> 
> ---
> 0-DAY CI Kernel Test Service, Intel Corporation
> https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org


-- 
Masami Hiramatsu <mhiramat@kernel.org>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [trace:ftrace/core 35/39] kernel/trace/trace_boot.c:418:17: warning: this 'if' clause does not guard...
  2021-08-31 13:15   ` Masami Hiramatsu
@ 2021-08-31 13:28     ` Masami Hiramatsu
  -1 siblings, 0 replies; 6+ messages in thread
From: Masami Hiramatsu @ 2021-08-31 13:28 UTC (permalink / raw)
  To: Masami Hiramatsu
  Cc: kernel test robot, kbuild-all, linux-kernel, Steven Rostedt (VMware)

On Tue, 31 Aug 2021 22:15:00 +0900
Masami Hiramatsu <mhiramat@kernel.org> wrote:

> Oops, thanks for the great test bot!
> Let me send a fix asap.

Hmm, this has been fixed in ftrace/for-next, it has the latest my patch.

Thank you,

> 
> Thank you,
> 
> On Tue, 31 Aug 2021 20:57:56 +0800
> kernel test robot <lkp@intel.com> wrote:
> 
> > tree:   https://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git ftrace/core
> > head:   3dc65994e3c1c999be3d991cdc96705e167cb3b1
> > commit: 5d4648a0415efc239ffb377bce1d389723eda25d [35/39] tracing/boot: Show correct histogram error command
> > config: s390-allyesconfig (attached as .config)
> > compiler: s390-linux-gcc (GCC) 11.2.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://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git/commit/?id=5d4648a0415efc239ffb377bce1d389723eda25d
> >         git remote add trace https://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git
> >         git fetch --no-tags trace ftrace/core
> >         git checkout 5d4648a0415efc239ffb377bce1d389723eda25d
> >         # save the attached .config to linux build tree
> >         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=s390 
> > 
> > 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 >>):
> > 
> >    kernel/trace/trace_boot.c: In function 'trace_boot_init_histograms':
> > >> kernel/trace/trace_boot.c:418:17: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
> >      418 |                 if (trace_boot_compose_hist_cmd(hnode, buf, size) == 0)
> >          |                 ^~
> >    kernel/trace/trace_boot.c:420:25: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
> >      420 |                         if (trigger_process_regex(file, buf) < 0)
> >          |                         ^~
> > 
> > 
> > vim +/if +418 kernel/trace/trace_boot.c
> > 
> > 30cb856e3067e5 Masami Hiramatsu 2021-08-06  395  
> > 30cb856e3067e5 Masami Hiramatsu 2021-08-06  396  static void __init
> > 30cb856e3067e5 Masami Hiramatsu 2021-08-06  397  trace_boot_init_histograms(struct trace_event_file *file,
> > 30cb856e3067e5 Masami Hiramatsu 2021-08-06  398  			   struct xbc_node *hnode, char *buf, size_t size)
> > 30cb856e3067e5 Masami Hiramatsu 2021-08-06  399  {
> > 30cb856e3067e5 Masami Hiramatsu 2021-08-06  400  	struct xbc_node *node;
> > 30cb856e3067e5 Masami Hiramatsu 2021-08-06  401  	const char *p;
> > 5d4648a0415efc Masami Hiramatsu 2021-08-06  402  	char *tmp;
> > 30cb856e3067e5 Masami Hiramatsu 2021-08-06  403  
> > 30cb856e3067e5 Masami Hiramatsu 2021-08-06  404  	xbc_node_for_each_subkey(hnode, node) {
> > 30cb856e3067e5 Masami Hiramatsu 2021-08-06  405  		p = xbc_node_get_data(node);
> > 30cb856e3067e5 Masami Hiramatsu 2021-08-06  406  		if (!isdigit(p[0]))
> > 30cb856e3067e5 Masami Hiramatsu 2021-08-06  407  			continue;
> > 30cb856e3067e5 Masami Hiramatsu 2021-08-06  408  		/* All digit started node should be instances. */
> > 30cb856e3067e5 Masami Hiramatsu 2021-08-06  409  		if (trace_boot_compose_hist_cmd(node, buf, size) == 0) {
> > 5d4648a0415efc Masami Hiramatsu 2021-08-06  410  			tmp = kstrdup(buf, GFP_KERNEL);
> > 30cb856e3067e5 Masami Hiramatsu 2021-08-06  411  			if (trigger_process_regex(file, buf) < 0)
> > 5d4648a0415efc Masami Hiramatsu 2021-08-06  412  				pr_err("Failed to apply hist trigger: %s\n", tmp);
> > 5d4648a0415efc Masami Hiramatsu 2021-08-06  413  			kfree(tmp);
> > 30cb856e3067e5 Masami Hiramatsu 2021-08-06  414  		}
> > 30cb856e3067e5 Masami Hiramatsu 2021-08-06  415  	}
> > 30cb856e3067e5 Masami Hiramatsu 2021-08-06  416  
> > 30cb856e3067e5 Masami Hiramatsu 2021-08-06  417  	if (xbc_node_find_child(hnode, "keys")) {
> > 30cb856e3067e5 Masami Hiramatsu 2021-08-06 @418  		if (trace_boot_compose_hist_cmd(hnode, buf, size) == 0)
> > 5d4648a0415efc Masami Hiramatsu 2021-08-06  419  			tmp = kstrdup(buf, GFP_KERNEL);
> > 30cb856e3067e5 Masami Hiramatsu 2021-08-06  420  			if (trigger_process_regex(file, buf) < 0)
> > 5d4648a0415efc Masami Hiramatsu 2021-08-06  421  				pr_err("Failed to apply hist trigger: %s\n", tmp);
> > 5d4648a0415efc Masami Hiramatsu 2021-08-06  422  			kfree(tmp);
> > 30cb856e3067e5 Masami Hiramatsu 2021-08-06  423  	}
> > 30cb856e3067e5 Masami Hiramatsu 2021-08-06  424  
> > 
> > :::::: The code at line 418 was first introduced by commit
> > :::::: 30cb856e3067e5d6ae7b2144e1659145ab7686fd tracing/boot: Support multiple histograms for each event
> > 
> > :::::: TO: Masami Hiramatsu <mhiramat@kernel.org>
> > :::::: CC: Steven Rostedt (VMware) <rostedt@goodmis.org>
> > 
> > ---
> > 0-DAY CI Kernel Test Service, Intel Corporation
> > https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
> 
> 
> -- 
> Masami Hiramatsu <mhiramat@kernel.org>


-- 
Masami Hiramatsu <mhiramat@kernel.org>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [trace:ftrace/core 35/39] kernel/trace/trace_boot.c:418:17: warning: this 'if' clause does not guard...
@ 2021-08-31 13:28     ` Masami Hiramatsu
  0 siblings, 0 replies; 6+ messages in thread
From: Masami Hiramatsu @ 2021-08-31 13:28 UTC (permalink / raw)
  To: kbuild-all

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

On Tue, 31 Aug 2021 22:15:00 +0900
Masami Hiramatsu <mhiramat@kernel.org> wrote:

> Oops, thanks for the great test bot!
> Let me send a fix asap.

Hmm, this has been fixed in ftrace/for-next, it has the latest my patch.

Thank you,

> 
> Thank you,
> 
> On Tue, 31 Aug 2021 20:57:56 +0800
> kernel test robot <lkp@intel.com> wrote:
> 
> > tree:   https://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git ftrace/core
> > head:   3dc65994e3c1c999be3d991cdc96705e167cb3b1
> > commit: 5d4648a0415efc239ffb377bce1d389723eda25d [35/39] tracing/boot: Show correct histogram error command
> > config: s390-allyesconfig (attached as .config)
> > compiler: s390-linux-gcc (GCC) 11.2.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://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git/commit/?id=5d4648a0415efc239ffb377bce1d389723eda25d
> >         git remote add trace https://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git
> >         git fetch --no-tags trace ftrace/core
> >         git checkout 5d4648a0415efc239ffb377bce1d389723eda25d
> >         # save the attached .config to linux build tree
> >         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=s390 
> > 
> > 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 >>):
> > 
> >    kernel/trace/trace_boot.c: In function 'trace_boot_init_histograms':
> > >> kernel/trace/trace_boot.c:418:17: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
> >      418 |                 if (trace_boot_compose_hist_cmd(hnode, buf, size) == 0)
> >          |                 ^~
> >    kernel/trace/trace_boot.c:420:25: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
> >      420 |                         if (trigger_process_regex(file, buf) < 0)
> >          |                         ^~
> > 
> > 
> > vim +/if +418 kernel/trace/trace_boot.c
> > 
> > 30cb856e3067e5 Masami Hiramatsu 2021-08-06  395  
> > 30cb856e3067e5 Masami Hiramatsu 2021-08-06  396  static void __init
> > 30cb856e3067e5 Masami Hiramatsu 2021-08-06  397  trace_boot_init_histograms(struct trace_event_file *file,
> > 30cb856e3067e5 Masami Hiramatsu 2021-08-06  398  			   struct xbc_node *hnode, char *buf, size_t size)
> > 30cb856e3067e5 Masami Hiramatsu 2021-08-06  399  {
> > 30cb856e3067e5 Masami Hiramatsu 2021-08-06  400  	struct xbc_node *node;
> > 30cb856e3067e5 Masami Hiramatsu 2021-08-06  401  	const char *p;
> > 5d4648a0415efc Masami Hiramatsu 2021-08-06  402  	char *tmp;
> > 30cb856e3067e5 Masami Hiramatsu 2021-08-06  403  
> > 30cb856e3067e5 Masami Hiramatsu 2021-08-06  404  	xbc_node_for_each_subkey(hnode, node) {
> > 30cb856e3067e5 Masami Hiramatsu 2021-08-06  405  		p = xbc_node_get_data(node);
> > 30cb856e3067e5 Masami Hiramatsu 2021-08-06  406  		if (!isdigit(p[0]))
> > 30cb856e3067e5 Masami Hiramatsu 2021-08-06  407  			continue;
> > 30cb856e3067e5 Masami Hiramatsu 2021-08-06  408  		/* All digit started node should be instances. */
> > 30cb856e3067e5 Masami Hiramatsu 2021-08-06  409  		if (trace_boot_compose_hist_cmd(node, buf, size) == 0) {
> > 5d4648a0415efc Masami Hiramatsu 2021-08-06  410  			tmp = kstrdup(buf, GFP_KERNEL);
> > 30cb856e3067e5 Masami Hiramatsu 2021-08-06  411  			if (trigger_process_regex(file, buf) < 0)
> > 5d4648a0415efc Masami Hiramatsu 2021-08-06  412  				pr_err("Failed to apply hist trigger: %s\n", tmp);
> > 5d4648a0415efc Masami Hiramatsu 2021-08-06  413  			kfree(tmp);
> > 30cb856e3067e5 Masami Hiramatsu 2021-08-06  414  		}
> > 30cb856e3067e5 Masami Hiramatsu 2021-08-06  415  	}
> > 30cb856e3067e5 Masami Hiramatsu 2021-08-06  416  
> > 30cb856e3067e5 Masami Hiramatsu 2021-08-06  417  	if (xbc_node_find_child(hnode, "keys")) {
> > 30cb856e3067e5 Masami Hiramatsu 2021-08-06 @418  		if (trace_boot_compose_hist_cmd(hnode, buf, size) == 0)
> > 5d4648a0415efc Masami Hiramatsu 2021-08-06  419  			tmp = kstrdup(buf, GFP_KERNEL);
> > 30cb856e3067e5 Masami Hiramatsu 2021-08-06  420  			if (trigger_process_regex(file, buf) < 0)
> > 5d4648a0415efc Masami Hiramatsu 2021-08-06  421  				pr_err("Failed to apply hist trigger: %s\n", tmp);
> > 5d4648a0415efc Masami Hiramatsu 2021-08-06  422  			kfree(tmp);
> > 30cb856e3067e5 Masami Hiramatsu 2021-08-06  423  	}
> > 30cb856e3067e5 Masami Hiramatsu 2021-08-06  424  
> > 
> > :::::: The code at line 418 was first introduced by commit
> > :::::: 30cb856e3067e5d6ae7b2144e1659145ab7686fd tracing/boot: Support multiple histograms for each event
> > 
> > :::::: TO: Masami Hiramatsu <mhiramat@kernel.org>
> > :::::: CC: Steven Rostedt (VMware) <rostedt@goodmis.org>
> > 
> > ---
> > 0-DAY CI Kernel Test Service, Intel Corporation
> > https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
> 
> 
> -- 
> Masami Hiramatsu <mhiramat@kernel.org>


-- 
Masami Hiramatsu <mhiramat@kernel.org>

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-08-31 13:28 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-31 12:57 [trace:ftrace/core 35/39] kernel/trace/trace_boot.c:418:17: warning: this 'if' clause does not guard kernel test robot
2021-08-31 12:57 ` kernel test robot
2021-08-31 13:15 ` Masami Hiramatsu
2021-08-31 13:15   ` Masami Hiramatsu
2021-08-31 13:28   ` Masami Hiramatsu
2021-08-31 13:28     ` Masami Hiramatsu

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.