lkml.org 
[lkml]   [2008]   [Oct]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: perfmon3 interface overview
On Sat, Oct 04, 2008 at 09:20:00AM +0200, stephane eranian wrote:
> David,
>
> On Sat, Oct 4, 2008 at 8:05 AM, David Gibson
> <david@gibson.dropbear.id.au> 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.

Yeah, that's what I'm saying. You could do it, but it feels like
you're forcing it, at least to me. As you say it starts to look a bit
like ioctl() again.

--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson


\
 
 \ /
  Last update: 2008-10-05 07:57    [W:0.380 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site