diff options
author | Steven Rostedt (Red Hat) <rostedt@goodmis.org> | 2016-09-07 12:45:09 -0400 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2016-09-12 09:59:46 -0400 |
commit | f971cc9aabc287120bbe7f3f1abe70c13e61ee94 (patch) | |
tree | 9d1dc39fb8ddd1bf34fa06b960baa36b0b70a1f1 | |
parent | 7b2c86250122de316cbab8754050622ead04af39 (diff) |
tracing: Have max_latency be defined for HWLAT_TRACER as well
The hwlat tracer uses tr->max_latency, and if it's the only tracer enabled
that uses it, the build will fail. Add max_latency and its file when the
hwlat tracer is enabled.
Link: http://lkml.kernel.org/r/d6c3b7eb-ba95-1ffa-0453-464e1e24262a@infradead.org
Reported-by: Randy Dunlap <rdunlap@infradead.org>
Tested-by: Randy Dunlap <rdunlap@infradead.org>
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r-- | kernel/trace/trace.c | 6 | ||||
-rw-r--r-- | kernel/trace/trace.h | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 474cc814e16d..e0d0cfc1aa20 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c | |||
@@ -4945,7 +4945,7 @@ out: | |||
4945 | return ret; | 4945 | return ret; |
4946 | } | 4946 | } |
4947 | 4947 | ||
4948 | #ifdef CONFIG_TRACER_MAX_TRACE | 4948 | #if defined(CONFIG_TRACER_MAX_TRACE) || defined(CONFIG_HWLAT_TRACER) |
4949 | 4949 | ||
4950 | static ssize_t | 4950 | static ssize_t |
4951 | tracing_max_lat_read(struct file *filp, char __user *ubuf, | 4951 | tracing_max_lat_read(struct file *filp, char __user *ubuf, |
@@ -5867,7 +5867,7 @@ static const struct file_operations tracing_thresh_fops = { | |||
5867 | .llseek = generic_file_llseek, | 5867 | .llseek = generic_file_llseek, |
5868 | }; | 5868 | }; |
5869 | 5869 | ||
5870 | #ifdef CONFIG_TRACER_MAX_TRACE | 5870 | #if defined(CONFIG_TRACER_MAX_TRACE) || defined(CONFIG_HWLAT_TRACER) |
5871 | static const struct file_operations tracing_max_lat_fops = { | 5871 | static const struct file_operations tracing_max_lat_fops = { |
5872 | .open = tracing_open_generic, | 5872 | .open = tracing_open_generic, |
5873 | .read = tracing_max_lat_read, | 5873 | .read = tracing_max_lat_read, |
@@ -7195,7 +7195,7 @@ init_tracer_tracefs(struct trace_array *tr, struct dentry *d_tracer) | |||
7195 | 7195 | ||
7196 | create_trace_options_dir(tr); | 7196 | create_trace_options_dir(tr); |
7197 | 7197 | ||
7198 | #ifdef CONFIG_TRACER_MAX_TRACE | 7198 | #if defined(CONFIG_TRACER_MAX_TRACE) || defined(CONFIG_HWLAT_TRACER) |
7199 | trace_create_file("tracing_max_latency", 0644, d_tracer, | 7199 | trace_create_file("tracing_max_latency", 0644, d_tracer, |
7200 | &tr->max_latency, &tracing_max_lat_fops); | 7200 | &tr->max_latency, &tracing_max_lat_fops); |
7201 | #endif | 7201 | #endif |
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h index 1d866b0c1567..fd24b1f9ac43 100644 --- a/kernel/trace/trace.h +++ b/kernel/trace/trace.h | |||
@@ -214,6 +214,8 @@ struct trace_array { | |||
214 | */ | 214 | */ |
215 | struct trace_buffer max_buffer; | 215 | struct trace_buffer max_buffer; |
216 | bool allocated_snapshot; | 216 | bool allocated_snapshot; |
217 | #endif | ||
218 | #if defined(CONFIG_TRACER_MAX_TRACE) || defined(CONFIG_HWLAT_TRACER) | ||
217 | unsigned long max_latency; | 219 | unsigned long max_latency; |
218 | #endif | 220 | #endif |
219 | struct trace_pid_list __rcu *filtered_pids; | 221 | struct trace_pid_list __rcu *filtered_pids; |