ftrace Package

ftrace Module

Function tracer profiler for autotest.

author:David Sharp (dhsharp@google.com)
class autotest.client.profilers.ftrace.ftrace.ftrace(job)[source]

Bases: autotest.client.profiler.profiler

ftrace profiler for autotest. It builds ftrace from souce and runs trace-cmd with configurable parameters.

@see: git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/trace-cmd.git

initialize(tracepoints, buffer_size_kb=1408, **kwargs)[source]

Initialize ftrace profiler.

Parameters:
  • tracepoints – List containing a mix of tracpoint names and (tracepoint name, filter) tuples. Tracepoint names are as accepted by trace-cmd -e, eg “syscalls”, or “syscalls:sys_enter_read”. Filters are as accepted by trace-cmd -f, eg “((sig >= 10 && sig < 15) || sig == 17)”
  • buffer_size_kb – Set the size of the ring buffer (per cpu).
static join_command(cmd)[source]

Shell escape the command for BgJob. grmbl.

Parameters:cmd – Command list.
mountpoint = '/sys/kernel/debug'
setup(tarball='trace-cmd.tar.bz2', **kwargs)[source]

Build and install trace-cmd from source.

The tarball was obtained by checking the git repo at 09-14-2010, removing the Documentation and the .git folders, and compressing it.

Parameters:
  • tarball – Path to trace-cmd tarball.
  • **kwargs

    Dictionary with additional parameters.

start(test)[source]

Start ftrace profiler

Parameters:test – Autotest test in which the profiler will operate on.
stop(test)[source]

Stop ftrace profiler.

Parameters:test – Autotest test in which the profiler will operate on.
tracing_dir = '/sys/kernel/debug/tracing'
version = 1