From: Ingo Molnar Date: Fri, 20 Mar 2009 09:14:53 +0000 (+0100) Subject: Merge branches 'tracing/ftrace', 'tracing/kprobes', 'tracing/tasks' and 'linus' into... X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=22de89b371a18086162eacd9f8c960299334ab01;p=linux-2.6-omap-h63xx.git Merge branches 'tracing/ftrace', 'tracing/kprobes', 'tracing/tasks' and 'linus' into tracing/core --- 22de89b371a18086162eacd9f8c960299334ab01 diff --cc kernel/trace/trace.c index a2d13e8c8fd,1ce6208fd72,305c562dae2,17bb88d86ac..c95b7292be7 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@@@@ -313,9 -306,8 -306,8 -287,6 +313,9 @@@@@ static const char *trace_options[] = "userstacktrace", "sym-userobj", "printk-msg-only", + "context-info", + "latency-format", +++ "global-clock", NULL }; @@@@@ -775,37 -767,37 -774,37 -824,33 +782,37 @@@@@ static void trace_save_cmdline(struct t 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 ""; + if (!pid) { + strcpy(comm, ""); + 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);