Forgot to cc: this to utrace-devel... Srikar Dronamraju wrote: > Hi Chris, > > I was going through froggy code and had couple of comments > > In the Froggy interface code i.e froggy/froggy/froggy.c > reap_listener() under "case RESP_EXIT" code, we seem to be printing > orig_code twice. I guess the second one should be code. > i.e > fprintf (stdout, "[%4ld] exited, orig code %ld, code %ld\n", > resp.resp_exit.pid, > resp.resp_exit.orig_code, > - resp.resp_exit.orig_code); > + resp.resp_exit.code); > break; >
The printf()s in froggy.c:resp_listener() are all temporary diagnostics and will ultimately be removed. I don't know which version of froggy you have, but if you'll look at the latest under the RESP_SYSCALL_ENTRY case you'll see: if (froggy->syscall_fcn) (*froggy->syscall_fcn)(resp.resp_syscall.nr, (pid_t)resp.resp_syscall.pid, ®s); which invokes a registered callback to the client. Take a look at demos/stracef/stracef.c, which includes a line froggy_set_syscall_handler (froggy, syscall_fcn); that sets the callback used above to static void syscall_fcn (long nr, pid_t pid, struct pt_regs * regs) { char * sc = syscalls_index[nr]->key; fprintf (stdout, "[%5d] syscall %4d (%s)\n", (int)pid, nr, sc); } Since thats in the client code, it can do anything you want it to do. > case RESP_SYSCALL_ENTRY: > > > In froogy/module/control.c > do_process_attach_task() and do_process_attach share lot of code and we > could probably use common function for the shared code. > do_process_attach_task() has been removed. Originally, I had it set up such that client-thread report_clone wasa used to automatically attach child processes that were ultimately to be execve()ed as code to be debugged, but I've replaced that with something more explicitly like ptrace(PTRACE_TRACEME,...) and the older code has been #ifdef-ed out. (I'll remove it entirely when I'm sure I don't need it anymore...) > Similarly do_shutdown() shares code with do_process_detach and we could > probably make do_shutdown() call do_process_detach. > It sounds like you don't have the latest snapshot--I did a /lot/ of cleanup in the shutdown/detach code last week and they > Do we plan to use report_jctl in the near future. utrace_ops has > report_jctl set to NULL however we have defined report_jctl() function > which never gets used. Similarly for unsafe_exec and tracer_task. > > Can you explain why you would want to attach with > UTRACE_ATTACH_EXCLUSIVE always? So even if I want to trace the same > program twice from froggy then I shouldn't be able to do it? > > > -- > Thanks and Regards > Srikar > -- Chris Moller I know that you believe you understand what you think I said, but I'm not sure you realize that what you heard is not what I meant. -- Robert McCloskey
signature.asc
Description: OpenPGP digital signature