0

I try to use 'perf trace' command to trace tsx abort in a special thread. But I get errors with arguments. All command I think may be right and tried is below.

perf trace --pid 24265 --event tx-abort

perf trace --pid 24265 --event {tx-abort}

perf trace --pid 24265 --event {'tx-abort'}

perf trace --pid {24265} --event tx-abort

perf trace --pid {24265} --event {tx-abort}

perf trace --pid {24265} --event {'tx-abort'}

perf trace --pid {'24265'} --event tx-abort

perf trace --pid {'24265'} --event {tx-abort}

perf trace --pid {'24265'} --event {'tx-abort'}

All error hins is 'Problems parsing the target to trace,check your options'.

Is there any way to let perf trace run as expected?

tomerpacific
  • 4,704
  • 13
  • 34
  • 52

1 Answers1

0

The issue is not the argument syntax, your first line should be just fine. First, check if tx-abort is listed by perf list, to see if it's generally supported on your system. Then the error may happen because the specified pid does not exist.

The TSX events are PMU events. As opposed to syscalls or tracepoints, not the individual event is instrumented in software, but there is a hardware counter within the Performance Monitoring Unit, that counts these events and triggers an interrupt after a certain amount of events. Taking a sample on each event is not typically feasible for PMU events. I suspect that is why it doesn't work for perf trace, which is originally intended for syscalls, even though the documentation a bit vague as to what type of events are supported.

Note I can reproduce that it doesn't work, but i get an "Invalid argument". That PMU events are unsupported for perf trace is a a bit of speculation by me.

There is a broad documentation by Intel on analyzing TSX with perf, which gives examples and explanation on how to use the the tx events with perf record.

Zulan
  • 21,896
  • 6
  • 49
  • 109
  • Thank you very much. I'm sure that tx-abort is listed in `perf list` and pid exist. However, I still can't run perf trace as I used to try. I agree with your speculation that PMU events may not be supported by perf trace. –  Dec 13 '17 at 01:40