lkml.org 
[lkml]   [2008]   [Nov]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: debugctl msr
Date
From
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.




\
 
 \ /
  Last update: 2008-11-22 10:55    [W:0.051 / U:0.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site