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.

You cannot get the best of both worlds: strong checking vs.
flexibility & extensibility without new syscalls

I think the pfm_control_sets() may be the one where I went quite far.

One thing suggested by David and which is part of this new version
is the duplication between pfarg_pmr_t and pfarg_pmd_attr. I think
passing only one of the two instead of two like me original proposal
makes it easier to manage in your app and also in the kernel. Yet
it maintains the same level of flexibility. You simply count, you can
use the minimalistic pfarg_pmr_t. You are sampling using kernel
support, then you pass pfarg_pmd_attr_t for PMDs. Doing this
unfortunately has the side effect of introducing a void *, which
inevitably weakens type checking.

> That said, if most of the LKML folks are fine with it, so am I.
>
Well, they are pretty quiet so far.

Thanks.

-------------------------------------------------------------------------
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

Reply via email to