Messages in this thread | | | Subject | Re: debugctl msr | Date | Sat, 22 Nov 2008 10:51:31 +0100 | From | Markus Metzger <> |
| |
On Fri, 2008-11-21 at 23:47 +0100, stephane eranian wrote:
> With the current code base, ds.c can accept a pre-allocated buffer. > However, it does > some adjustments for alignment and size (multiple of PEBS record > size). That means > that the start and end of the buffer could be different from the area > passed to ds_request_pebs(). > > To parse the buffer, a monitoring tools needs a start position and the > number of samples. The start > position can be expressed as an offset from the beginning of the > perfmon buffer. The ds.c interface > currently only returns indexes for current position, threshold, and > end. Those indexes are good enough > to derived the number of samples. But I would need one call to return > the byte offset from the original > buffer, or the actual address (which perfmon could then convert back > to an offset from its buffer).
ds_access() returns the pointer into the raw buffer at a given index. For index 0, this is the beginning of the buffer.
I plan to replace the various access functions with a single one that returns a const pointer to the configuration.
Something like:
struct ds_config { size_t number_of_records; size_t size_of_a_single_record; void *base; void *max; void *index; void *threshold; };
const struct ds_config *ds_config_pebs(struct pebs_tracer *tracer);
For BTS, I would add functions to work on this struct and translate raw entries into an architecture-independent format. I'm not sure whether this would make sense for PEBS, as well.
Would you be OK with such a change?
thanks and regards, markus.
| |