Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 121072
b: refs/heads/master
c: 75f5c47
h: refs/heads/master
v: v3
  • Loading branch information
Steven Rostedt authored and Ingo Molnar committed Nov 8, 2008
1 parent a3e5541 commit 8b7e409
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0183fb1c94b74862b073590fc52c56b7364b7bad
refs/heads/master: 75f5c47da386445ba0c5a8b7e3ca0c906e763369
2 changes: 1 addition & 1 deletion trunk/kernel/trace/trace.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ struct ftrace_entry {
unsigned long parent_ip;
};
extern struct tracer boot_tracer;
extern struct tracer sched_switch_trace; /* Used by the boot tracer */

/*
* Context switch trace entry - which task (and prio) we switched from/to:
Expand Down Expand Up @@ -325,6 +324,7 @@ void trace_function(struct trace_array *tr,

void tracing_start_cmdline_record(void);
void tracing_stop_cmdline_record(void);
void tracing_cmdline_assign_trace(struct trace_array *tr);
int register_tracer(struct tracer *type);
void unregister_tracer(struct tracer *type);

Expand Down
9 changes: 7 additions & 2 deletions trunk/kernel/trace/trace_boot.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,12 @@ void disable_boot_trace(void)

static void reset_boot_trace(struct trace_array *tr)
{
sched_switch_trace.reset(tr);
int cpu;

tr->time_start = ftrace_now(tr->cpu);

for_each_online_cpu(cpu)
tracing_reset(tr, cpu);
}

static void boot_trace_init(struct trace_array *tr)
Expand All @@ -50,7 +55,7 @@ static void boot_trace_init(struct trace_array *tr)
for_each_cpu_mask(cpu, cpu_possible_map)
tracing_reset(tr, cpu);

sched_switch_trace.init(tr);
tracing_cmdline_assign_trace(tr);
}

static void boot_trace_ctrl_update(struct trace_array *tr)
Expand Down
15 changes: 14 additions & 1 deletion trunk/kernel/trace/trace_sched_switch.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,19 @@ void tracing_stop_cmdline_record(void)
tracing_stop_sched_switch();
}

/**
* tracing_cmdline_assign_trace - assign a trace array for ctx switch
* @tr: trace array pointer to assign
*
* Some tracers might want to record the context switches in their
* trace. This function lets those tracers assign the trace array
* to use.
*/
void tracing_cmdline_assign_trace(struct trace_array *tr)
{
ctx_trace = tr;
}

static void start_sched_trace(struct trace_array *tr)
{
sched_switch_reset(tr);
Expand Down Expand Up @@ -197,7 +210,7 @@ static void sched_switch_trace_stop(struct trace_array *tr)
tracing_stop_sched_switch();
}

struct tracer sched_switch_trace __read_mostly =
static struct tracer sched_switch_trace __read_mostly =
{
.name = "sched_switch",
.init = sched_switch_trace_init,
Expand Down

0 comments on commit 8b7e409

Please sign in to comment.