Hi,
On Thu, Nov 15, 2007 at 12:11:10PM +1100, Paul Mackerras wrote:
Agreed.
In the initial design there was only one perfmon syscall perfmonctl()
and it was a multiplexing call. People objected to it and thus I split it
up into multiple system calls. I like the strong typing but I agree that
it is harder to extend without creating new syscalls. In the current
state, all perfmon syscalls take a pointer to structs which have reserved
fields for future extensions. If you specify that reserved fields must be
zeroed, then it leaves you *some* flexibility for extending the structs.
Another alternative, similar to your ucontext, would be to pass the size
of the structure. If we assume we drop the vector arguments, we could do:
pfm_write_pmcs(fd, &pmc, sizeof(pmc));
instead of
pfm_write_pmcs(fd, &pmc);
Should the sizeof(pmc) need to change we could demultiplex inside the
kernel. Another, probably cleaner, possibility is to version structures
that are passed:
union pfarg_pmc {
int version;
struct {
int version;
int reg_num;
u64 reg_value;
}
}
But that seems overkill. I think versioning could be passed when the session
is created instead of at every call:
fd = pfm_create_session(version, &ctx, ....);
Agreed 100%. This is especially true because we support per-thread
monitoring.
--
-Stephane
-