Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ftrace: Support trace-cmd record mode #643

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

mrkajetanp
Copy link
Contributor

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
Copy link
Contributor Author

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
Copy link
Contributor Author

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.

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.

Signed-off-by: Kajetan Puchalski <[email protected]>
The trace-cmd record mode allows setting the interval to determine how
often it will write to the trace file. The default is 1000 (us, ie. 1ms).

Add a collector parameter to allow setting that interval. This will only
have an effect when trace_cmd_mode is 'record' as the option does not
exist for 'start' mode.

Signed-off-by: Kajetan Puchalski <[email protected]>
@douglas-raillard-arm
Copy link
Contributor

Pending on: #645

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants