From: Philippe E. <ph...@us...> - 2003-10-11 14:40:45
|
Update of /cvsroot/oprofile/oprofile/module/ia64 In directory sc8-pr-cvs1:/tmp/cvs-serv9996/module/ia64 Modified Files: op_syscalls.c Log Message: enable --separate=thread,cpu on 2.4 kernel. IA64 updated too but not tested (even if thread separation is broken on ia64 it should break nothing if you don't use --separate=thread). The way per-cpu profiling is done is ugly and use too many memory (TODO item added). It's not advised currently to use both cpu and thread separation. This patch also do many cleanup in dae/*, actually, with these new features, dae/* is less ugly. Index: op_syscalls.c =================================================================== RCS file: /cvsroot/oprofile/oprofile/module/ia64/op_syscalls.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -p -d -r1.2 -r1.3 --- op_syscalls.c 16 Dec 2002 01:24:06 -0000 1.2 +++ op_syscalls.c 11 Oct 2003 14:40:40 -0000 1.3 @@ -94,6 +94,7 @@ static void oprof_output_map(ulong addr, return; note.pid = current->pid; + note.tgid = op_get_tgid(); note.addr = addr; note.len = len; note.offset = offset; @@ -232,13 +233,15 @@ out: } -inline static void oprof_report_fork(u32 old, u32 new) +inline static void oprof_report_fork(u32 old_pid, u32 new_pid, u32 old_tgid, u32 new_tgid) { struct op_note note; note.type = OP_FORK; - note.pid = old; - note.addr = new; + note.pid = old_pid; + note.tgid = old_tgid; + note.addr = new_pid; + note.len = new_tgid; oprof_put_note(¬e); } @@ -246,24 +249,34 @@ inline static void oprof_report_fork(u32 asmlinkage void post_sys_clone(long ret, long arg0, long arg1) { u32 pid = current->pid; + u32 tgid = op_get_tgid(); /* FIXME: This should be done in the ASM stub. */ MOD_INC_USE_COUNT; if (ret) - oprof_report_fork(pid,ret); + /* FIXME: my libc show clone() is not implemented in ia64 + * but used only by fork() with a SIGCHILD first parameter + * so we assume it's a fork */ + oprof_report_fork(pid, ret, pid, tgid); MOD_DEC_USE_COUNT; } asmlinkage void post_sys_clone2(long ret, long arg0, long arg1, long arg2) { u32 pid = current->pid; + u32 tgid = op_get_tgid(); + long clone_flags = arg0; /* FIXME: This should be done in the ASM stub. */ MOD_INC_USE_COUNT; - if (ret) - oprof_report_fork(pid,ret); + if (ret) { + if (clone_flags & CLONE_THREAD) + oprof_report_fork(pid, ret, tgid, tgid); + else + oprof_report_fork(pid, ret, tgid, ret); + } MOD_DEC_USE_COUNT; } @@ -293,9 +306,10 @@ asmlinkage void pre_sys_exit(int error_c note.offset = current->start_time; note.type = OP_EXIT; note.pid = current->pid; + note.tgid = op_get_tgid(); oprof_put_note(¬e); - /* this looks UP-dangerous, as the exit sleeps and we don't + /* this looks UP-dangerous, as the exit sleeps and we don't * have a use count, but in fact its ok as sys_exit is noreturn, * so we can never come back to this non-existent exec page */ |