"userstacktrace",
"sym-userobj",
"printk-msg-only",
+ "context-info",
+ "latency-format",
+++ "global-clock",
NULL
};
memcpy(&saved_cmdlines[idx], tsk->comm, TASK_COMM_LEN);
- spin_unlock(&trace_cmdline_lock);
+ __raw_spin_unlock(&trace_cmdline_lock);
}
-char *trace_find_cmdline(int pid)
+void trace_find_cmdline(int pid, char comm[])
{
- char *cmdline = "<...>";
unsigned map;
- if (!pid)
- return "<idle>";
+ if (!pid) {
+ strcpy(comm, "<idle>");
+ return;
+ }
- if (pid > PID_MAX_DEFAULT)
- goto out;
+ if (pid > PID_MAX_DEFAULT) {
+ strcpy(comm, "<...>");
+ return;
+ }
+ __raw_spin_lock(&trace_cmdline_lock);
map = map_pid_to_cmdline[pid];
-- - if (map >= SAVED_CMDLINES)
-- - goto out;
-- -
-- strcpy(comm, saved_cmdlines[map]);
- cmdline = saved_cmdlines[map];
++ + if (map != NO_CMDLINE_MAP)
++ + strcpy(comm, saved_cmdlines[map]);
++ + else
++ + strcpy(comm, "<...>");
-- - out:
- return cmdline;
+ __raw_spin_unlock(&trace_cmdline_lock);
}
void tracing_record_cmdline(struct task_struct *tsk)
{
-- if (atomic_read(&trace_record_cmdline_disabled) || !tracing_is_on())
- if (atomic_read(&trace_record_cmdline_disabled))
++ + if (atomic_read(&trace_record_cmdline_disabled) || !tracer_enabled ||
++ + !tracing_is_on())
return;
trace_save_cmdline(tsk);