Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 121210
b: refs/heads/master
c: 660c7f9
h: refs/heads/master
v: v3
  • Loading branch information
Steven Rostedt authored and Ingo Molnar committed Nov 26, 2008
1 parent 500a5f4 commit 180268e
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 7 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: e53a6319cca69111c1643dc9f18f4465d7f1cbf0
refs/heads/master: 660c7f9be96321fc80026d76411bd15e6f418a72
2 changes: 1 addition & 1 deletion trunk/kernel/trace/trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -804,7 +804,7 @@ static void trace_save_cmdline(struct task_struct *tsk)
spin_unlock(&trace_cmdline_lock);
}

static char *trace_find_cmdline(int pid)
char *trace_find_cmdline(int pid)
{
char *cmdline = "<...>";
unsigned map;
Expand Down
1 change: 1 addition & 0 deletions trunk/kernel/trace/trace.h
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,7 @@ struct tracer_switch_ops {
struct tracer_switch_ops *next;
};

char *trace_find_cmdline(int pid);
#endif /* CONFIG_CONTEXT_SWITCH_TRACER */

#ifdef CONFIG_DYNAMIC_FTRACE
Expand Down
21 changes: 16 additions & 5 deletions trunk/kernel/trace/trace_functions_graph.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,29 +32,40 @@ static pid_t last_pid = -1;

static int graph_trace_init(struct trace_array *tr)
{
int cpu;
int cpu, ret;

for_each_online_cpu(cpu)
tracing_reset(tr, cpu);

return register_ftrace_graph(&trace_graph_return,
ret = register_ftrace_graph(&trace_graph_return,
&trace_graph_entry);
if (ret)
return ret;
tracing_start_cmdline_record();

return 0;
}

static void graph_trace_reset(struct trace_array *tr)
{
unregister_ftrace_graph();
tracing_stop_cmdline_record();
unregister_ftrace_graph();
}

/* If the pid changed since the last trace, output this event */
static int verif_pid(struct trace_seq *s, pid_t pid)
{
char *comm;

if (last_pid != -1 && last_pid == pid)
return 1;

last_pid = pid;
return trace_seq_printf(s, "\n------------8<---------- thread %d"
comm = trace_find_cmdline(pid);

return trace_seq_printf(s, "\n------------8<---------- thread %s-%d"
" ------------8<----------\n\n",
pid);
comm, pid);
}

static enum print_line_t
Expand Down

0 comments on commit 180268e

Please sign in to comment.