Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 116669
b: refs/heads/master
c: 5601020
h: refs/heads/master
i:
  116667: ba327c1
v: v3
  • Loading branch information
Frederic Weisbecker authored and Ingo Molnar committed Oct 14, 2008
1 parent 93d86b8 commit 5895684
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 10 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: cb5ab74204a6e2579d1119bf1348eb806526b12b
refs/heads/master: 5601020feb0c3010e9e3e0131e9697ac6a06777b
7 changes: 4 additions & 3 deletions trunk/include/linux/ftrace.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <linux/fs.h>
#include <linux/init.h>
#include <linux/types.h>
#include <linux/kallsyms.h>

extern int ftrace_enabled;
extern int
Expand Down Expand Up @@ -213,18 +214,18 @@ ftrace_init_module(unsigned long *start, unsigned long *end) { }

struct boot_trace {
pid_t caller;
initcall_t func;
char func[KSYM_NAME_LEN];
int result;
unsigned long long duration;
ktime_t calltime;
ktime_t rettime;
};

#ifdef CONFIG_BOOT_TRACER
extern void trace_boot(struct boot_trace *it);
extern void trace_boot(struct boot_trace *it, initcall_t fn);
extern void start_boot_trace(void);
#else
static inline void trace_boot(struct boot_trace *it) { }
static inline void trace_boot(struct boot_trace *it, initcall_t fn) { }
static inline void start_boot_trace(void) { }
#endif

Expand Down
3 changes: 1 addition & 2 deletions trunk/init/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,6 @@ int do_one_initcall(initcall_t fn)

if (initcall_debug) {
it.caller = task_pid_nr(current);
it.func = fn;
printk("calling %pF @ %i\n", fn, it.caller);
it.calltime = ktime_get();
}
Expand All @@ -725,7 +724,7 @@ int do_one_initcall(initcall_t fn)
it.duration = (unsigned long long) delta.tv64 >> 20;
printk("initcall %pF returned %d after %Ld msecs\n", fn,
it.result, it.duration);
trace_boot(&it);
trace_boot(&it, fn);
}

msgbuf[0] = 0;
Expand Down
14 changes: 10 additions & 4 deletions trunk/kernel/trace/trace_boot.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <linux/init.h>
#include <linux/debugfs.h>
#include <linux/ftrace.h>
#include <linux/kallsyms.h>

#include "trace.h"

Expand Down Expand Up @@ -56,17 +57,19 @@ static enum print_line_t initcall_print_line(struct trace_iterator *iter)
struct timespec rettime = ktime_to_timespec(it->rettime);

if (entry->type == TRACE_BOOT) {
ret = trace_seq_printf(s, "[%5ld.%06ld] calling %pF @ %i\n",
ret = trace_seq_printf(s, "[%5ld.%06ld] calling %s @ %i\n",
calltime.tv_sec,
calltime.tv_nsec,
it->func, it->caller);
if (!ret)
return TRACE_TYPE_PARTIAL_LINE;
ret = trace_seq_printf(s, "[%5ld.%06ld] initcall %pF "

ret = trace_seq_printf(s, "[%5ld.%06ld] initcall %s "
"returned %d after %lld msecs\n",
rettime.tv_sec,
rettime.tv_nsec,
it->func, it->result, it->duration);

if (!ret)
return TRACE_TYPE_PARTIAL_LINE;
return TRACE_TYPE_HANDLED;
Expand All @@ -83,8 +86,7 @@ struct tracer boot_tracer __read_mostly =
.print_line = initcall_print_line,
};


void trace_boot(struct boot_trace *it)
void trace_boot(struct boot_trace *it, initcall_t fn)
{
struct ring_buffer_event *event;
struct trace_boot *entry;
Expand All @@ -95,6 +97,10 @@ void trace_boot(struct boot_trace *it)
if (!trace_boot_enabled)
return;

/* Get its name now since this function could
* disappear because it is in the .init section.
*/
sprint_symbol(it->func, (unsigned long)fn);
preempt_disable();
data = tr->data[smp_processor_id()];

Expand Down

0 comments on commit 5895684

Please sign in to comment.