Merge branches 'tracing/ftrace', 'tracing/kprobes', 'tracing/tasks' and 'linus' into...
Ingo Molnar [Fri, 20 Mar 2009 09:14:53 +0000 (10:14 +0100)]
1  2  3  4 
Makefile
kernel/module.c
kernel/trace/trace.c

diff --cc Makefile
Simple merge
diff --cc kernel/module.c
Simple merge
@@@@@ -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 "<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);