David, On Sat, Oct 4, 2008 at 8:05 AM, David Gibson <[EMAIL PROTECTED]> wrote: >> >> If we wanted to go even further, we could combine start/stop, attach/detach >> into a single syscall: > > Well, you could. But the attach/detach take a parameter which > start/stop don't, making it a less obvious merge to make. > Unless you make the 3rd argument optional and hide this in a user library. This is how this is handled for pfm_create_session() for instance. The library would define this as follows:
int pfm_control_session(int fd, int flags, ...); Based upon flags, it would use va_arg() to get to the 3rd argument and pass it to the syscall which implements the version below. A dummy value would be passed with the flags is not equal to PFM_CTFL_ATTACH. >> int pfm_control_session(int fd, int flags, int target); >> With flags: >> PFM_CTFL_START : start monitoring >> PFM_CTFL_STOP : stop monitoring >> PFM_CTFL_RESTART: resume after overflow notification >> >> PFM_CTFL_ATTACH: attach to thread or cpu designated by 'target' >> PFM_CTFL_DETACH: detach session >> ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ perfmon2-devel mailing list perfmon2-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/perfmon2-devel