You can use the perf tool to generate a report for a specific trace event:
perf record -e some:event -a
That generates a perf.data file that will contain any events that occured between when the command was issued and stopped. The resulting trace output can be viewed with
Is there any way to just have perf output the trace output to stdout directly? If not is there another tool that will do this?