Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 140989
b: refs/heads/master
c: a635cf0
h: refs/heads/master
i:
  140987: 4b7f760
v: v3
  • Loading branch information
Carsten Emde authored and Ingo Molnar committed Mar 18, 2009
1 parent 62150f3 commit c3d3462
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 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: 50d88758a3f9787cbdbdbc030560b815721eab4b
refs/heads/master: a635cf0497342978d417cae19d4a4823932977ff
16 changes: 11 additions & 5 deletions trunk/kernel/trace/trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -738,8 +738,7 @@ void trace_stop_cmdline_recording(void);

static void trace_save_cmdline(struct task_struct *tsk)
{
unsigned map;
unsigned idx;
unsigned pid, idx;

if (!tsk->pid || unlikely(tsk->pid > PID_MAX_DEFAULT))
return;
Expand All @@ -757,10 +756,17 @@ static void trace_save_cmdline(struct task_struct *tsk)
if (idx == NO_CMDLINE_MAP) {
idx = (cmdline_idx + 1) % SAVED_CMDLINES;

map = map_cmdline_to_pid[idx];
if (map != NO_CMDLINE_MAP)
map_pid_to_cmdline[map] = NO_CMDLINE_MAP;
/*
* Check whether the cmdline buffer at idx has a pid
* mapped. We are going to overwrite that entry so we
* need to clear the map_pid_to_cmdline. Otherwise we
* would read the new comm for the old pid.
*/
pid = map_cmdline_to_pid[idx];
if (pid != NO_CMDLINE_MAP)
map_pid_to_cmdline[pid] = NO_CMDLINE_MAP;

map_cmdline_to_pid[idx] = tsk->pid;
map_pid_to_cmdline[tsk->pid] = idx;

cmdline_idx = idx;
Expand Down

0 comments on commit c3d3462

Please sign in to comment.