ARM-software / CSAL

Coresight Access Library
Other
107 stars 42 forks source link

CSAL vs Coresight driver in kernel #12

Closed bj-wanghz closed 1 year ago

bj-wanghz commented 1 year ago

In Linux kernel/drivers/hwtracing/coresight, there are drivers for some CS components, such as ETM, STM. We can use sysfs to access these compoents in user space. So what's the advantage of CSAL compared to kernel drivers when used on Linux platform except that CSAL supports some components which kernel doesn't (ELA for example)?

algrant-arm commented 1 year ago

That's basically the only advantage. If you can get the job done with kernel drivers, through sysfs or perf_event_open(), it's generally best to do that.

CSAL should generally not be used on a production Linux system if you plan to also use the kernel drivers, otherwise you may run into problems with clashing ATB trace ids, devices left in inconsistent states etc.

There are a few main reasons for using CSAL (via /dev/mem) under Linux: