Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 100628
b: refs/heads/master
c: a6dd24f
h: refs/heads/master
v: v3
  • Loading branch information
Ingo Molnar authored and Thomas Gleixner committed May 23, 2008
1 parent a1ed7a1 commit 24393d1
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 4 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: 56a08bdcff20f0022bd9160c1093e56f763499aa
refs/heads/master: a6dd24f8d00cbccb560b19a723e6fb9bdfb20799
4 changes: 4 additions & 0 deletions trunk/kernel/trace/trace.h
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,10 @@ extern int trace_selftest_startup_wakeup(struct tracer *trace,
extern int trace_selftest_startup_sched_switch(struct tracer *trace,
struct trace_array *tr);
#endif
#ifdef CONFIG_SYSPROF_TRACER
extern int trace_selftest_startup_sysprof(struct tracer *trace,
struct trace_array *tr);
#endif
#endif /* CONFIG_FTRACE_STARTUP_TEST */

extern void *head_page(struct trace_array_cpu *data);
Expand Down
28 changes: 28 additions & 0 deletions trunk/kernel/trace/trace_selftest.c
Original file line number Diff line number Diff line change
Expand Up @@ -537,3 +537,31 @@ trace_selftest_startup_sched_switch(struct tracer *trace, struct trace_array *tr
return ret;
}
#endif /* CONFIG_CONTEXT_SWITCH_TRACER */

#ifdef CONFIG_SYSPROF_TRACER
int
trace_selftest_startup_sysprof(struct tracer *trace, struct trace_array *tr)
{
unsigned long count;
int ret;

/* start the tracing */
tr->ctrl = 1;
trace->init(tr);
/* Sleep for a 1/10 of a second */
msleep(100);
/* stop the tracing. */
tr->ctrl = 0;
trace->ctrl_update(tr);
/* check the trace buffer */
ret = trace_test_buffer(tr, &count);
trace->reset(tr);

if (!ret && !count) {
printk(KERN_CONT ".. no entries found ..");
ret = -1;
}

return ret;
}
#endif /* CONFIG_SYSPROF_TRACER */
6 changes: 3 additions & 3 deletions trunk/kernel/trace/trace_sysprof.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ static void start_stack_timers(void)
for_each_online_cpu(cpu) {
set_cpus_allowed_ptr(current, &cpumask_of_cpu(cpu));
start_stack_timer(cpu);
printk("started timer on cpu%d\n", cpu);
printk(KERN_INFO "started sysprof timer on cpu%d\n", cpu);
}
set_cpus_allowed_ptr(current, &saved_mask);
}
Expand All @@ -136,7 +136,7 @@ static void stop_stack_timer(int cpu)
struct hrtimer *hrtimer = &per_cpu(stack_trace_hrtimer, cpu);

hrtimer_cancel(hrtimer);
printk("cancelled timer on cpu%d\n", cpu);
printk(KERN_INFO "cancelled sysprof timer on cpu%d\n", cpu);
}

static void stop_stack_timers(void)
Expand Down Expand Up @@ -200,7 +200,7 @@ static struct tracer stack_trace __read_mostly =
.reset = stack_trace_reset,
.ctrl_update = stack_trace_ctrl_update,
#ifdef CONFIG_FTRACE_SELFTEST
.selftest = trace_selftest_startup_stack,
.selftest = trace_selftest_startup_sysprof,
#endif
};

Expand Down

0 comments on commit 24393d1

Please sign in to comment.