Commit f971cc9a authored by Steven Rostedt (Red Hat)'s avatar Steven Rostedt (Red Hat) Committed by Steven Rostedt

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.orgReported-by: default avatarRandy Dunlap <rdunlap@infradead.org>
Tested-by: default avatarRandy Dunlap <rdunlap@infradead.org>
Acked-by: default avatarRandy Dunlap <rdunlap@infradead.org>
Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
parent 7b2c8625
...@@ -4945,7 +4945,7 @@ tracing_thresh_write(struct file *filp, const char __user *ubuf, ...@@ -4945,7 +4945,7 @@ tracing_thresh_write(struct file *filp, const char __user *ubuf,
return ret; return ret;
} }
#ifdef CONFIG_TRACER_MAX_TRACE #if defined(CONFIG_TRACER_MAX_TRACE) || defined(CONFIG_HWLAT_TRACER)
static ssize_t static ssize_t
tracing_max_lat_read(struct file *filp, char __user *ubuf, tracing_max_lat_read(struct file *filp, char __user *ubuf,
...@@ -5867,7 +5867,7 @@ static const struct file_operations tracing_thresh_fops = { ...@@ -5867,7 +5867,7 @@ static const struct file_operations tracing_thresh_fops = {
.llseek = generic_file_llseek, .llseek = generic_file_llseek,
}; };
#ifdef CONFIG_TRACER_MAX_TRACE #if defined(CONFIG_TRACER_MAX_TRACE) || defined(CONFIG_HWLAT_TRACER)
static const struct file_operations tracing_max_lat_fops = { static const struct file_operations tracing_max_lat_fops = {
.open = tracing_open_generic, .open = tracing_open_generic,
.read = tracing_max_lat_read, .read = tracing_max_lat_read,
...@@ -7195,7 +7195,7 @@ init_tracer_tracefs(struct trace_array *tr, struct dentry *d_tracer) ...@@ -7195,7 +7195,7 @@ init_tracer_tracefs(struct trace_array *tr, struct dentry *d_tracer)
create_trace_options_dir(tr); create_trace_options_dir(tr);
#ifdef CONFIG_TRACER_MAX_TRACE #if defined(CONFIG_TRACER_MAX_TRACE) || defined(CONFIG_HWLAT_TRACER)
trace_create_file("tracing_max_latency", 0644, d_tracer, trace_create_file("tracing_max_latency", 0644, d_tracer,
&tr->max_latency, &tracing_max_lat_fops); &tr->max_latency, &tracing_max_lat_fops);
#endif #endif
......
...@@ -214,6 +214,8 @@ struct trace_array { ...@@ -214,6 +214,8 @@ struct trace_array {
*/ */
struct trace_buffer max_buffer; struct trace_buffer max_buffer;
bool allocated_snapshot; bool allocated_snapshot;
#endif
#if defined(CONFIG_TRACER_MAX_TRACE) || defined(CONFIG_HWLAT_TRACER)
unsigned long max_latency; unsigned long max_latency;
#endif #endif
struct trace_pid_list __rcu *filtered_pids; struct trace_pid_list __rcu *filtered_pids;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment