aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChen Gang <gang.chen.5i5j@gmail.com>2015-11-09 16:15:15 -0500
committerSteven Rostedt <rostedt@goodmis.org>2015-11-10 10:16:05 -0500
commite428abbbf616cd8fdd1162e4a624ad1d47b47544 (patch)
tree1c8bbd0d8b22a264dcc35827892a950894e504c8
parent03e88ae6b369da2a26a6e09ad165e57d210789cd (diff)
tracing: #ifdef out uses of max trace when CONFIG_TRACER_MAX_TRACE is not set
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 = { Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r--kernel/trace/trace.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index b11582618991..87fb9801bd9e 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -4548,6 +4548,8 @@ out:
4548 return ret; 4548 return ret;
4549} 4549}
4550 4550
4551#ifdef CONFIG_TRACER_MAX_TRACE
4552
4551static ssize_t 4553static ssize_t
4552tracing_max_lat_read(struct file *filp, char __user *ubuf, 4554tracing_max_lat_read(struct file *filp, char __user *ubuf,
4553 size_t cnt, loff_t *ppos) 4555 size_t cnt, loff_t *ppos)
@@ -4562,6 +4564,8 @@ tracing_max_lat_write(struct file *filp, const char __user *ubuf,
4562 return tracing_nsecs_write(filp->private_data, ubuf, cnt, ppos); 4564 return tracing_nsecs_write(filp->private_data, ubuf, cnt, ppos);
4563} 4565}
4564 4566
4567#endif
4568
4565static int tracing_open_pipe(struct inode *inode, struct file *filp) 4569static int tracing_open_pipe(struct inode *inode, struct file *filp)
4566{ 4570{
4567 struct trace_array *tr = inode->i_private; 4571 struct trace_array *tr = inode->i_private;
@@ -5463,12 +5467,14 @@ static const struct file_operations tracing_thresh_fops = {
5463 .llseek = generic_file_llseek, 5467 .llseek = generic_file_llseek,
5464}; 5468};
5465 5469
5470#ifdef CONFIG_TRACER_MAX_TRACE
5466static const struct file_operations tracing_max_lat_fops = { 5471static const struct file_operations tracing_max_lat_fops = {
5467 .open = tracing_open_generic, 5472 .open = tracing_open_generic,
5468 .read = tracing_max_lat_read, 5473 .read = tracing_max_lat_read,
5469 .write = tracing_max_lat_write, 5474 .write = tracing_max_lat_write,
5470 .llseek = generic_file_llseek, 5475 .llseek = generic_file_llseek,
5471}; 5476};
5477#endif
5472 5478
5473static const struct file_operations set_tracer_fops = { 5479static const struct file_operations set_tracer_fops = {
5474 .open = tracing_open_generic, 5480 .open = tracing_open_generic,