devlib icon indicating copy to clipboard operation
devlib copied to clipboard

ftrace: Support trace-cmd record mode

Open mrkajetanp opened this issue 1 year ago • 3 comments

The current implementation of the FtraceCollector only supports using ftrace in its start-stop mode which keeps the traces in memory and then writes to file at the end. Trace-cmd also supports a different mode - record which writes to file periodically meaning that it allows recording traces that would exceed the 'start' mode buffer size in exchange for added noise.

This commit adds support for selecting which mode trace-cmd should be run in. It adds a new collector parameter - 'trace_cmd_mode' which is used to distinguish between the two approaches.

While at it, it also cleans up the collector in some places, e.g. the teardown() method.

mrkajetanp avatar Aug 23 '23 16:08 mrkajetanp

I pushed an update to make the entire collector just use a tempdir inside the working directory from the start for both modes. If nothing else it'll make it more self contained.

mrkajetanp avatar Aug 24 '23 13:08 mrkajetanp

Updated to wait until the background command actually exits after sending SIGINT - otherwise there's a race condition with removing the temp directory in the teardown() method.

mrkajetanp avatar Aug 30 '23 14:08 mrkajetanp

Pending on: https://github.com/ARM-software/devlib/issues/645

douglas-raillard-arm avatar Mar 27 '24 14:03 douglas-raillard-arm