summaryrefslogtreecommitdiff
path: root/drivers/oprofile/buffer_sync.c
diff options
context:
space:
mode:
authorJohn Levon <levon@movementarian.org>2003-06-11 06:27:55 -0700
committerLinus Torvalds <torvalds@home.transmeta.com>2003-06-11 06:27:55 -0700
commit76ff9e3fd9154eeeaf4a59f1a67601b660cd4ade (patch)
treeb4a2faed508daba2d180fd499090acf0ed4cfd30 /drivers/oprofile/buffer_sync.c
parent97ef4805f9aa05671473d98fba8d1152b1cc7183 (diff)
[PATCH] OProfile: Export task->tgid in the buffer
Export the task->tgid to userspace as well. This is needed for forthcoming thread profiling stuff and should have been done in the original patch ... oh well. This requires an upgrade to oprofile 0.5.3. You can get it from the website, or, for the impatient, here : http://movementarian.org/oprofile-0.5.3.tar.gz
Diffstat (limited to 'drivers/oprofile/buffer_sync.c')
-rw-r--r--drivers/oprofile/buffer_sync.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/oprofile/buffer_sync.c b/drivers/oprofile/buffer_sync.c
index 59d6fc778039..6e1917451605 100644
--- a/drivers/oprofile/buffer_sync.c
+++ b/drivers/oprofile/buffer_sync.c
@@ -274,12 +274,17 @@ static void add_kernel_ctx_switch(unsigned int in_kernel)
add_event_entry(KERNEL_EXIT_SWITCH_CODE);
}
-static void add_user_ctx_switch(pid_t pid, unsigned long cookie)
+static void
+add_user_ctx_switch(struct task_struct const * task, unsigned long cookie)
{
add_event_entry(ESCAPE_CODE);
add_event_entry(CTX_SWITCH_CODE);
- add_event_entry(pid);
+ add_event_entry(task->pid);
add_event_entry(cookie);
+ /* Another code for daemon back-compat */
+ add_event_entry(ESCAPE_CODE);
+ add_event_entry(CTX_TGID_CODE);
+ add_event_entry(task->tgid);
}
@@ -446,7 +451,7 @@ static void sync_buffer(struct oprofile_cpu_buffer * cpu_buf)
mm = take_tasks_mm(new);
cookie = get_exec_dcookie(mm);
- add_user_ctx_switch(new->pid, cookie);
+ add_user_ctx_switch(new, cookie);
}
} else {
add_sample(mm, s, in_kernel);