perf_counter: question about the user page data_head field

From: Corey Ashford
Date: Mon May 04 2009 - 17:56:22 EST


Hi,

In working on the PAPI substrate using the "Performance Counters for Linux" implementation (code that's currently in linux-2.6-tip, commit: c786fa3dc42e8e898cf1a33f9f5a25b61c7043f5), I encountered an issue with the data_head field.

I am implementing the profiling part of the substrate, and am using the mmap'd data pages to capture IP samples. This is working quite well, and I've been able to profile on multiple events simultaneously.

However, one thing I ran into is when my code examines the data_head field from user space, it's always a multiple of the page size. So it's apparently updated only on mmap page overflow. I think I understand that this is done for efficiency reasons, but it's a limitation for the user space app in that they can miss up to 255 records (4096 byte pages / 16-byte records), because the following mmap page is non empty but not full.

Perhaps I'm missing something. Is there a way to force data_head to be updated from user space? If not, I'd like to request that a new mechanism for doing such, perhaps via an ioctl call.

Thanks for your consideration,

- Corey

Corey Ashford
Software Engineer
IBM Linux Technology Center, Linux Toolchain
Beaverton, OR
503-578-3507
cjashfor@xxxxxxxxxx

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