Arnd,

On Wed, Jul 2, 2008 at 12:23 PM, Arnd Bergmann <[EMAIL PROTECTED]> wrote:
> On Tuesday 01 July 2008, stephane eranian wrote:
>>   It may be necessary to extend the system calls with new generic or
>> architecture specific parameters, and this
>>   without simply adding new system calls.
>>
>> ...
>>      Although both structures are currently identical, they will
>> differ as more functionalities are added so better
>>      to create two versions from the start.
>>
>>      Provisions for extensions are provided by the reserved field in
>> each structure.
>
> What is the strategy regarding interface changes here? Are you confident
> that any change can be done in a forward- and backward-compatible way?
> If not, how do you address possible interface version mismatches?
>
I see two possible strategies:

   1- the obvious one: add new syscalls

   2- all system calls taking structure parameters have reserved
fields. They can be used to support extensions.

      I see 3 problems with reserved fields:

          - They are supposed to be all zeroes. Let's say, a new
perfmon version uses one to support an extension.
            What if value 0 is valid for this extension, and we
execute an old application which does not know about it
            and passes 0 in the corresponding reserved field?

            This does not systematically translate into a problem.
Worst case, it may generate events which the old
            application does not know about.

         - what if we run out of reserved fields? Then we have not
other choice but to add a new syscall

         - large reserved fields increase the cost of syscalls because
they need to be copied-in

It would be simpler with a multiplexing syscall, you just add a new
command. Older command would still work and
keep their own data structures.

I am tempted to transform the interface to have a mix of the two
approaches. I could clearly see that load/unload
and start/stop could be implemented by a generic pfm_control(int fd,
int CMD, void *arg, size_t arg_sz) call. To go
further, we could also group the write syscalls : pfm_write_regs(int
fd, int type, void *arg, size_t arg_sz) with type
indicating either config or data registers.

What do you think?

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
perfmon2-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/perfmon2-devel

Reply via email to