Re: x86, ptrace: support for branch trace store(BTS)

From: Ingo Molnar
Date: Thu Dec 13 2007 - 08:08:51 EST



* Metzger, Markus T <markus.t.metzger@xxxxxxxxx> wrote:

> The ptrace API would allow the user to:
> - define (and query) the overflow mechanism
> (wrap-around or event)
> - define (and query) the size of the buffer within certain limits
> (we could either give an error or cut off)
> - define (and query) events to be monitored
> (last branch trace, scheduling timestamps)
> - get a single BTS record
> - query the number of BTS records
> (to find out how big your drain buffer needs to be; it may be bigger
> than you requested)
> - drain all BTS records (copy, then clear)
> - clear all BTS records
>
> Draining would require the user to allocate a buffer to hold the data,
> which might not be feasible when he is near his memory limit. He could
> fall back to looping over the single-entry get. It is questionable,
> how useful the drain ptrace command would actually be; we might want
> to replace it with a get range command.
>
> Are you OK with this?

this sounds a lot more flexible to me. Please, once it looks good to all
of us also extend LTP's ptrace bits with unit tests for these API
additions. (Cc: such LTP bits to subrata@xxxxxxxxxxxxxxxxxx)

Ingo
--
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/