Hello,
I spent some time investigation what we could do to provide
the list of available registers without requiring event set multiplexing.
To summarize the issue once again:
- tools need to know which registers are available. The PMU may be shared
with other
subsystems. For instance, on X86, the NMI watchdog steals one counter
and runs
concurrently to perfmon.
- today with v2.81, tools query the available registers using
pfm_getinfo_evtsets().
This call also returns information pertaining to specific event sets,
such as the
number of activation or total active duration. Yet the list of
available registers
is the same for all sets, i.e., it is managed at the context (session)
level. Thus,
it does not necessarily seem like the right call to use.
- the minimal kernel patch will not have support for event set and
multiplexing at
the beginning. It may take multiple kernel releases before it is there.
Thus there
will not be a call to retrieve the list of available registers. This is
an issue as tools
will fail if they try to access registers used elsewhere. But worse they
will not have
ways to find out what is available, except using the fail & retry
approach.
The v2.81 -> v3.0 is a good opportunity to revisit some data structures and
API. As
you have seen v3.0 is quite different from v2.81. In my previous post, I did
not make
any change to the pfarg_setinfo_t nor pfarg_setdesc_t structures. However,
to avoid
name conflicts, I have renamed the event sets syscalls.
I think it does make sense if the list of available registers is provided as
soon as the
session is created, i.e., by pfm_create_session(). Because this is the basic
information
needed to construct the measurement. It is possible to add a parameter to
this syscall
to return the list of registers. That new parameter would be mandatory to
make
things simpler:
*int pfm_create_session(int flags, pfarg_session_info_t *sif,
[char *smpl_name, void *smpl_arg, size_t arg_size]);*
With:
typedef struct {
u64 sif_avail_pmcs[PFM_PMC_BV];
u64 sif_avail_pmds[PFM_PMD_BV];
u64 sif_reserved[4];
} pfarg_session_info_t;
The structure could later be extended to return other information about the
session. That is why I did
not call it pfarg_pmrinfo_t.
Of course, the corresponding bitmask are removed from pfarg_setinfo_t to
avoid duplication.
The new structure is renamed, pfarg_set_info_t, to avoid conflicts with
v2.81 definition and allow emulation. It is
important that we find a way to support existing v2.81 applications despite
this change. That
means that the emulation of pfm_getinfo_evtsets() now needs to create a fake
context to
retrieve the bitmasks and copy them back info the old pfarg_setinfo_t
structure.
If you have better names for those info structures, please let me know.
-------------------------------------------------------------------------
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