Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 140773
b: refs/heads/master
c: d1f9cbd
h: refs/heads/master
i:
  140771: ac4ff24
v: v3
  • Loading branch information
Frederic Weisbecker authored and Ingo Molnar committed Feb 19, 2009
1 parent ed7df20 commit 52b3211
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 22 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: 4cd0332db7e8f57cc082bab11d82c064a9721737
refs/heads/master: d1f9cbd78841f1a797c77e9117e4882f932c2ef6
50 changes: 29 additions & 21 deletions trunk/kernel/trace/trace_functions_graph.c
Original file line number Diff line number Diff line change
Expand Up @@ -351,16 +351,35 @@ print_graph_overhead(unsigned long long duration, struct trace_seq *s)
return trace_seq_printf(s, " ");
}

static int print_graph_abs_time(u64 t, struct trace_seq *s)
{
unsigned long usecs_rem;

usecs_rem = do_div(t, NSEC_PER_SEC);
usecs_rem /= 1000;

return trace_seq_printf(s, "%5lu.%06lu | ",
(unsigned long)t, usecs_rem);
}

static enum print_line_t
print_graph_irq(struct trace_seq *s, unsigned long addr,
print_graph_irq(struct trace_iterator *iter, unsigned long addr,
enum trace_type type, int cpu, pid_t pid)
{
int ret;
struct trace_seq *s = &iter->seq;

if (addr < (unsigned long)__irqentry_text_start ||
addr >= (unsigned long)__irqentry_text_end)
return TRACE_TYPE_UNHANDLED;

/* Absolute time */
if (tracer_flags.val & TRACE_GRAPH_PRINT_ABS_TIME) {
ret = print_graph_abs_time(iter->ts, s);
if (!ret)
return TRACE_TYPE_PARTIAL_LINE;
}

/* Cpu */
if (tracer_flags.val & TRACE_GRAPH_PRINT_CPU) {
ret = print_graph_cpu(s, cpu);
Expand Down Expand Up @@ -446,17 +465,6 @@ print_graph_duration(unsigned long long duration, struct trace_seq *s)

}

static int print_graph_abs_time(u64 t, struct trace_seq *s)
{
unsigned long usecs_rem;

usecs_rem = do_div(t, 1000000000);
usecs_rem /= 1000;

return trace_seq_printf(s, "%5lu.%06lu | ",
(unsigned long)t, usecs_rem);
}

/* Case of a leaf function on its call entry */
static enum print_line_t
print_graph_entry_leaf(struct trace_iterator *iter,
Expand Down Expand Up @@ -561,7 +569,7 @@ print_graph_entry(struct ftrace_graph_ent_entry *field, struct trace_seq *s,
return TRACE_TYPE_PARTIAL_LINE;

/* Interrupt */
ret = print_graph_irq(s, call->func, TRACE_GRAPH_ENT, cpu, ent->pid);
ret = print_graph_irq(iter, call->func, TRACE_GRAPH_ENT, cpu, ent->pid);
if (ret == TRACE_TYPE_PARTIAL_LINE)
return TRACE_TYPE_PARTIAL_LINE;

Expand All @@ -581,7 +589,7 @@ print_graph_entry(struct ftrace_graph_ent_entry *field, struct trace_seq *s,

/* Proc */
if (tracer_flags.val & TRACE_GRAPH_PRINT_PROC) {
ret = print_graph_proc(s, ent->pid);
ret = print_graph_proc(s, pid);
if (ret == TRACE_TYPE_PARTIAL_LINE)
return TRACE_TYPE_PARTIAL_LINE;

Expand All @@ -605,11 +613,11 @@ print_graph_return(struct ftrace_graph_ret *trace, struct trace_seq *s,
int i;
int ret;
int cpu = iter->cpu;
pid_t *last_pid = iter->private;
pid_t *last_pid = iter->private, pid = ent->pid;
unsigned long long duration = trace->rettime - trace->calltime;

/* Pid */
if (verif_pid(s, ent->pid, cpu, last_pid) == TRACE_TYPE_PARTIAL_LINE)
if (verif_pid(s, pid, cpu, last_pid) == TRACE_TYPE_PARTIAL_LINE)
return TRACE_TYPE_PARTIAL_LINE;

/* Absolute time */
Expand Down Expand Up @@ -668,7 +676,7 @@ print_graph_return(struct ftrace_graph_ret *trace, struct trace_seq *s,
return TRACE_TYPE_PARTIAL_LINE;
}

ret = print_graph_irq(s, trace->func, TRACE_GRAPH_RET, cpu, ent->pid);
ret = print_graph_irq(iter, trace->func, TRACE_GRAPH_RET, cpu, pid);
if (ret == TRACE_TYPE_PARTIAL_LINE)
return TRACE_TYPE_PARTIAL_LINE;

Expand All @@ -684,17 +692,17 @@ print_graph_comment(struct print_entry *trace, struct trace_seq *s,
int cpu = iter->cpu;
pid_t *last_pid = iter->private;

/* Pid */
if (verif_pid(s, ent->pid, cpu, last_pid) == TRACE_TYPE_PARTIAL_LINE)
return TRACE_TYPE_PARTIAL_LINE;

/* Absolute time */
if (tracer_flags.val & TRACE_GRAPH_PRINT_ABS_TIME) {
ret = print_graph_abs_time(iter->ts, s);
if (!ret)
return TRACE_TYPE_PARTIAL_LINE;
}

/* Pid */
if (verif_pid(s, ent->pid, cpu, last_pid) == TRACE_TYPE_PARTIAL_LINE)
return TRACE_TYPE_PARTIAL_LINE;

/* Cpu */
if (tracer_flags.val & TRACE_GRAPH_PRINT_CPU) {
ret = print_graph_cpu(s, cpu);
Expand Down

0 comments on commit 52b3211

Please sign in to comment.