Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 162949
b: refs/heads/master
c: f81c972
h: refs/heads/master
i:
  162947: 83b27a1
v: v3
  • Loading branch information
Steven Rostedt authored and Steven Rostedt committed Sep 11, 2009
1 parent 739b255 commit 8f99ec3
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 31 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: 637e7e864103a7a68c1ce43ada27dfc25c0d113f
refs/heads/master: f81c972d27c36729e65d4a815e3d7b782a540bad
26 changes: 2 additions & 24 deletions trunk/kernel/trace/trace_functions_graph.c
Original file line number Diff line number Diff line change
Expand Up @@ -367,32 +367,10 @@ print_graph_proc(struct trace_seq *s, pid_t pid)
static enum print_line_t
print_graph_lat_fmt(struct trace_seq *s, struct trace_entry *entry)
{
int hardirq, softirq;
int ret;

hardirq = entry->flags & TRACE_FLAG_HARDIRQ;
softirq = entry->flags & TRACE_FLAG_SOFTIRQ;

if (!trace_seq_printf(s, " %c%c%c",
(entry->flags & TRACE_FLAG_IRQS_OFF) ? 'd' :
(entry->flags & TRACE_FLAG_IRQS_NOSUPPORT) ?
'X' : '.',
(entry->flags & TRACE_FLAG_NEED_RESCHED) ?
'N' : '.',
(hardirq && softirq) ? 'H' :
hardirq ? 'h' : softirq ? 's' : '.'))
return 0;

if (entry->lock_depth < 0)
ret = trace_seq_putc(s, '.');
else
ret = trace_seq_printf(s, "%d", entry->lock_depth);
if (!ret)
if (!trace_seq_putc(s, ' '))
return 0;

if (entry->preempt_count)
return trace_seq_printf(s, "%x", entry->preempt_count);
return trace_seq_puts(s, ".");
return trace_print_lat_fmt(s, entry);
}

/* If the pid changed since the last trace, output this event */
Expand Down
30 changes: 24 additions & 6 deletions trunk/kernel/trace/trace_output.c
Original file line number Diff line number Diff line change
Expand Up @@ -460,19 +460,23 @@ seq_print_ip_sym(struct trace_seq *s, unsigned long ip, unsigned long sym_flags)
return ret;
}

static int
lat_print_generic(struct trace_seq *s, struct trace_entry *entry, int cpu)
/**
* trace_print_lat_fmt - print the irq, preempt and lockdep fields
* @s: trace seq struct to write to
* @entry: The trace entry field from the ring buffer
*
* Prints the generic fields of irqs off, in hard or softirq, preempt
* count and lock depth.
*/
int trace_print_lat_fmt(struct trace_seq *s, struct trace_entry *entry)
{
int hardirq, softirq;
char comm[TASK_COMM_LEN];
int ret;

trace_find_cmdline(entry->pid, comm);
hardirq = entry->flags & TRACE_FLAG_HARDIRQ;
softirq = entry->flags & TRACE_FLAG_SOFTIRQ;

if (!trace_seq_printf(s, "%8.8s-%-5d %3d%c%c%c",
comm, entry->pid, cpu,
if (!trace_seq_printf(s, "%c%c%c",
(entry->flags & TRACE_FLAG_IRQS_OFF) ? 'd' :
(entry->flags & TRACE_FLAG_IRQS_NOSUPPORT) ?
'X' : '.',
Expand All @@ -494,6 +498,20 @@ lat_print_generic(struct trace_seq *s, struct trace_entry *entry, int cpu)
return trace_seq_putc(s, '.');
}

static int
lat_print_generic(struct trace_seq *s, struct trace_entry *entry, int cpu)
{
char comm[TASK_COMM_LEN];

trace_find_cmdline(entry->pid, comm);

if (!trace_seq_printf(s, "%8.8s-%-5d %3d",
comm, entry->pid, cpu))
return 0;

return trace_print_lat_fmt(s, entry);
}

static unsigned long preempt_mark_thresh = 100;

static int
Expand Down
2 changes: 2 additions & 0 deletions trunk/kernel/trace/trace_output.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ extern struct trace_event *ftrace_find_event(int type);

extern enum print_line_t trace_nop_print(struct trace_iterator *iter,
int flags);
extern int
trace_print_lat_fmt(struct trace_seq *s, struct trace_entry *entry);

/* used by module unregistering */
extern int __unregister_ftrace_event(struct trace_event *event);
Expand Down

0 comments on commit 8f99ec3

Please sign in to comment.