Re: debugctl msr

From: Markus Metzger
Date: Sat Nov 22 2008 - 04:51:57 EST


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.


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/