Skip to content

Commit

Permalink
trace: set max latency variable to zero on default
Browse files Browse the repository at this point in the history
Impact: trace max latencies on start of latency tracing

This patch sets the max latency to zero whenever one of the
irq variant tracers or the wakeup tracer is set to current tracer.

Most developers expect to see output when starting up a latency
tracer. But since the max_latency is already set to max, and
it takes a latency greater than max_latency to be recorded, there
is no trace. This is not the expected behavior and has even confused
myself.

Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Steven Rostedt authored and Ingo Molnar committed Jan 21, 2009
1 parent a442e5e commit 1092307
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/trace/trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

#define TRACE_BUFFER_FLAGS (RB_FL_OVERWRITE)

unsigned long __read_mostly tracing_max_latency = (cycle_t)ULONG_MAX;
unsigned long __read_mostly tracing_max_latency;
unsigned long __read_mostly tracing_thresh;

/*
Expand Down
1 change: 1 addition & 0 deletions kernel/trace/trace_irqsoff.c
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,7 @@ static void stop_irqsoff_tracer(struct trace_array *tr)

static void __irqsoff_tracer_init(struct trace_array *tr)
{
tracing_max_latency = 0;
irqsoff_trace = tr;
/* make sure that the tracer is visible */
smp_wmb();
Expand Down
1 change: 1 addition & 0 deletions kernel/trace/trace_sched_wakeup.c
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,7 @@ static void stop_wakeup_tracer(struct trace_array *tr)

static int wakeup_tracer_init(struct trace_array *tr)
{
tracing_max_latency = 0;
wakeup_trace = tr;
start_wakeup_tracer(tr);
return 0;
Expand Down

0 comments on commit 1092307

Please sign in to comment.