Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1266633 > unrolled thread

Re: [PATCH] kernel/trace/trace.c: Switch the related code with CONFIG_TRACER_MAX_TRACE

Started bySteven Rostedt <rostedt@goodmis.org>
First post2015-11-10 17:50 +0100
Last post2015-11-11 00:00 +0100
Articles 2 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH] kernel/trace/trace.c: Switch the related code with   CONFIG_TRACER_MAX_TRACE Steven Rostedt <rostedt@goodmis.org> - 2015-11-10 17:50 +0100
    Re: [PATCH] kernel/trace/trace.c: Switch the related code with  CONFIG_TRACER_MAX_TRACE Steven Rostedt <rostedt@goodmis.org> - 2015-11-11 00:00 +0100

#1266633 — Re: [PATCH] kernel/trace/trace.c: Switch the related code with CONFIG_TRACER_MAX_TRACE

FromSteven Rostedt <rostedt@goodmis.org>
Date2015-11-10 17:50 +0100
SubjectRe: [PATCH] kernel/trace/trace.c: Switch the related code with CONFIG_TRACER_MAX_TRACE
Message-ID<qtkhj-7vy-1@gated-at.bofh.it>
On Tue, 10 Nov 2015 05:21:16 +0800
Chen Gang <xili_gchen_5257@hotmail.com> wrote:

> >From 0af9ca7a33b977d92498d990cb6f2a326dbad4f8 Mon Sep 17 00:00:00 2001  
> From: Chen Gang <gang.chen.5i5j@gmail.com>
> Date: Tue, 10 Nov 2015 05:15:15 +0800
> Subject: [PATCH] kernel/trace/trace.c: Switch the related code with
>  CONFIG_TRACER_MAX_TRACE
> MIME-Version: 1.0
> Content-Type: text/plain; charset=UTF-8
> Content-Transfer-Encoding: 8bit
> 
> tracing_max_lat_fops is used only when TRACER_MAX_TRACE enabled, so also
> swith the related code. The related warning with defconfig under x86_64:
> 
>     CC      kernel/trace/trace.o
>   kernel/trace/trace.c:5466:37: warning: ‘tracing_max_lat_fops’ defined but not used [-Wunused-const-variable]
>    static const struct file_operations tracing_max_lat_fops = {

I'm curious to what compiler are you using? Because, for me gcc simply
compiles it out without any warning or anything because it's labeled as
a constant.

I'm not against the patch, but I simply don't get this warning. If I
remove the "const" then I do.

-- Steve

> 
> Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com>
> ---
>  kernel/trace/trace.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
> index b115826..87fb980 100644
> --- a/kernel/trace/trace.c
> +++ b/kernel/trace/trace.c
> @@ -4548,6 +4548,8 @@ out:
>  	return ret;
>  }
>  
> +#ifdef CONFIG_TRACER_MAX_TRACE
> +
>  static ssize_t
>  tracing_max_lat_read(struct file *filp, char __user *ubuf,
>  		     size_t cnt, loff_t *ppos)
> @@ -4562,6 +4564,8 @@ tracing_max_lat_write(struct file *filp, const char __user *ubuf,
>  	return tracing_nsecs_write(filp->private_data, ubuf, cnt, ppos);
>  }
>  
> +#endif
> +
>  static int tracing_open_pipe(struct inode *inode, struct file *filp)
>  {
>  	struct trace_array *tr = inode->i_private;
> @@ -5463,12 +5467,14 @@ static const struct file_operations tracing_thresh_fops = {
>  	.llseek		= generic_file_llseek,
>  };
>  
> +#ifdef CONFIG_TRACER_MAX_TRACE
>  static const struct file_operations tracing_max_lat_fops = {
>  	.open		= tracing_open_generic,
>  	.read		= tracing_max_lat_read,
>  	.write		= tracing_max_lat_write,
>  	.llseek		= generic_file_llseek,
>  };
> +#endif
>  
>  static const struct file_operations set_tracer_fops = {
>  	.open		= tracing_open_generic,
> -- 
> 1.9.3
> 
>  		 	   		  
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1266839 — Re: [PATCH] kernel/trace/trace.c: Switch the related code with CONFIG_TRACER_MAX_TRACE

FromSteven Rostedt <rostedt@goodmis.org>
Date2015-11-11 00:00 +0100
SubjectRe: [PATCH] kernel/trace/trace.c: Switch the related code with CONFIG_TRACER_MAX_TRACE
Message-ID<qtq3p-2NW-25@gated-at.bofh.it>
In reply to#1266633
On Wed, 11 Nov 2015 06:31:25 +0800
Chen Gang <xili_gchen_5257@hotmail.com> wrote:

> > I'm curious to what compiler are you using? Because, for me gcc simply
> > compiles it out without any warning or anything because it's labeled as
> > a constant.
> >   
> 
> I use the upstream gcc 6.0.0, which is simply built by myself:
> 

So this is new with gcc 6.0 (which I don't have). I'm still using 4.9
as that's the last one supported by:

 https://www.kernel.org/pub/tools/crosstool/files/bin/x86_64/

-- Steve

> 
> It will always report warning for both "static const struct file_operations
> tracing_max_lat_fops ..." and  "static struct file_operations
> tracing_max_lat_fops ..."
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web