From d249a02d441998c43aeb1755c85cffb062628500 Mon Sep 17 00:00:00 2001 Message-Id: In-Reply-To: References: From: Jim Somerville Date: Thu, 22 Dec 2016 17:54:11 -0500 Subject: [PATCH 14/32] Add missing ifdef around max latency variable Signed-off-by: Jim Somerville --- kernel/trace/trace_hwlat.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/kernel/trace/trace_hwlat.c b/kernel/trace/trace_hwlat.c index 4b30d8b..1bb578c 100644 --- a/kernel/trace/trace_hwlat.c +++ b/kernel/trace/trace_hwlat.c @@ -167,7 +167,9 @@ void trace_hwlat_callback(bool enter) */ static int get_sample(void) { +#ifdef CONFIG_TRACER_MAX_TRACE struct trace_array *tr = hwlat_trace; +#endif time_type start, t1, t2, last_t2; s64 diff, total, last_total = 0; u64 sample = 0; @@ -254,9 +256,11 @@ static int get_sample(void) s.nmi_count = nmi_count; trace_hwlat_sample(&s); +#ifdef CONFIG_TRACER_MAX_TRACE /* Keep a running maximum ever recorded hardware latency */ if (sample > tr->max_latency) tr->max_latency = sample; +#endif } out: @@ -582,7 +586,9 @@ static int hwlat_tracer_init(struct trace_array *tr) disable_migrate = false; hwlat_data.count = 0; +#ifdef CONFIG_TRACER_MAX_TRACE tr->max_latency = 0; +#endif save_tracing_thresh = tracing_thresh; /* tracing_thresh is in nsecs, we speak in usecs */ -- 1.8.3.1