Re: release 0.2 of x86 performance-monitoring counters support patch

Andi Kleen (ak@muc.de)
10 Jun 1999 02:02:27 +0200


mikpe@csd.uu.se (Mikael Pettersson) writes:
>
> > If you still want rdpmc you can leave it as a trap to kernel and simulate
> > it with a read from total.
>
> No need to trap. (That'd be so awful that people should just do a syscall
> instead.) I allow the user to register a user-space buffer with the driver.
> At process resumption, I copy the counter state to this buffer. (Technique
> stolen from sparc64's sys_perfctr() implementation.) The user executes
> RDPMC and RDTSC, retrieves the "base" values from the buffer, and then
> computes the current "virtual" 64-bit values. This should permit people
> to bracket single procedure bodies or basic blocks with sampling code
> without too much overhead.

Only thing that I'm missing in your nice patch is a way to access the performance
counters of remote processes (so that I could hack gdb to do non intrusive
profiling a la itune). Extending the ioctls could work, although a ptrace
extension would be nicer.

> I'll probably do this with mmap instead, as soon as I've figured out how...

Most likely not worth it for the small amount of data.

-Andi

-- 
This is like TV. I don't like TV.

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