Hi Al,
On Thu, Mar 31, 2016 at 1:08 AM, Al Grant Al.Grant@arm.com wrote:
Hi,
I'd like to get your thoughts on an appropriate low-level userspace API for STM. The API I'm after would assume the ability to map a range of channels into userspace as detailed in Documentation/trace/stm.txt:
"Some STM devices may allow direct mapping of the channel mmio region to userspace for zero-copy writing..."
What that doesn't describe is what you do with the region once you've got it.
It is like mmap() interface I have done for STM, I replied one your previous email on March 1st with addressing how to use the mmap() interface from user space, the subject of that email was "STM memory space", if you cannot find that email in you mailbox, please let me know, I can forward that to you.
Regards, Chunyan
Which suggests a userspace API that can abstract over the way channels are represented in the memory map, i.e. how bits of the address are used to influence the data packets. Given a channel number (or a relative channel number) and some data, it would generate a store to the right address, or an lvalue at the right address. So you could write something like this:
STM_TRACE_DATA(p, TIMESTAMP, uint32, 123);
or perhaps
*STM_TRACE_CHANNEL(p, TIMESTAMP, uint32) = 123;
and this would become inline code that would be a single store that would cause a D32 packet. The ARM and Intel implementations would differ in how they calculated the address and perhaps on whether some features were available. 64-bit writes would be unavailable on some ARM systems.
Userspace libraries that implemented higher-level messaging formats could then sit on top of this lower-level API.
I don't think I've seen this in any of the patches that have come round but is anyone working on anything like this?
Al
CoreSight mailing list CoreSight@lists.linaro.org https://lists.linaro.org/mailman/listinfo/coresight