Hi Stephane, Will, Back in January there was a thread about Perfmon not working on Fedora Core 7 kernels due to the switch from ptrace to utrace. http://www.hpl.hp.com/hosted/linux/mail-archives/perfmon/2007-January/001183.html
I've just found out that the project I'm working on will be using the Fedora Core 7 kernel as a base, so I was wondering if there had been any conclusions about how Perfmon would handle this change. To review, when using a non-self-monitored per-process context, Perfmon uses the ptrace_check_attach() call to verify that the monitoring process has ptraced the monitored process and that the monitored process is not actively using one of the CPUs. However, with the utrace changes in FC7, the ptrace_check_attach() routine has been removed. So here are a few questions: 1) Does utrace provide anything similar to ptrace_check_attach(). For now I'm assuming it doesn't, since nothing was mentioned in the earlier postings. Are there any other kernel APIs the Perfmon could use that would accomplish the same or similar behavior? We're basically trying to ensure that the monitored process does not get scheduled during the running of the effected Perfmon system-calls, and that the controlling process has permission to access the controlled process. Is there anything that I'm missing? 2) If we know for certain that a user-space tool always ptrace's the monitored process before making any of the effected Perfmon system-calls, then the ptrace_check_attach() call in the kernel should always be successful. In this case, could the call to ptrace_check_attach() be removed without altering the overall behavior? Obviously this isn't the real solution, but it might be a temporary workaround. 3) What's the worst-case scenario if the Perfmon system-calls were run without ptracing the monitored process? Could it corrupt kernel data? Crash the machine? Would it just result in erroneous data from the Perfmon system-calls? 4) Will utrace eventually replace ptrace in the mainline kernel? I found some discussions about utrace on lkml, and it seems like its getting some positive feedback. But it doesn't look like it's been submitted in full for inclusion, so I'm not sure what kind of time-line we're talking about. If it does get merged, obviously we'll need to find a real solution for Perfmon at some point. I'll probably need to ask some of these questions on lkml as well, but I figured you guys might have a bit of insight on the issue already. Thanks, -- Kevin Corry [EMAIL PROTECTED] http://www.ibm.com/linux/ _______________________________________________ perfmon mailing list [email protected] http://www.hpl.hp.com/hosted/linux/mail-archives/perfmon/
