On Mon, Oct 06, 2008 at 01:15:39AM +0200, stephane eranian wrote:
> Corey,
>
> On Mon, Oct 6, 2008 at 12:31 AM, Corey J Ashford <[EMAIL PROTECTED]> wrote:
> > "stephane eranian" <[EMAIL PROTECTED]> wrote on 10/05/2008 02:23:15
> > PM:
> > [snip]
> >> If I summarize our discussion. It seems we can define the API as
> > follows:
> >>
> >> int pfm_create_session(int fd, uint64_t flags, pfarg_sinfo_t *sif,
> >> [ char *smpl_name, void *smpl_arg, size_t arg_size]);
> >> int pfm_read_pmrs(int fd, uint64_t flags, void *tab, size_t sz);
> >> int pfm_write_pmrs(int fd, uint64_t flags, void *tab, size_t sz);
> >> int pfm_attach_session(int fd, uint64_t flags, int target); /*
> >> attach, detach with target=-1 */
> >> int pfm_control_session(int fd, uint64_t flags); /* for start/stop
> > */
> >> int pfm_control_sets(int fd, uint64_t flags, void *sets, size_t sz);
> >>
> >> Does this look reasonable?
> >
> > Just as a general comment to this revision, I think this has gone too far
> > toward an ioctl call; I prefer stronger type checking at the API. This
> > has almost none. Also, it's more self-documenting if the type that you
> > need to pass is explicit in the prototype.
> >
> I understand your concerns, I have some worries about this also.
As do I. Do bear in mind that it lacks two of the worst aspects of
ioctl(), though:
- the type implies a particular structure layout for every use
of the call, unlike ioctl() where the interpretation of the ioctl
number varies with the device/handle you're using.
- The size of the passed structure is included in the call, so
at least that much can be understood without interpreting the type.
That's not true of ioctl() where even to copy the passed structure you
must correctly interpret the ioctl number for the particular device in
question.
--
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
-------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/perfmon2-devel