'Initialize ftrace profiler.
:param 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)"
:param buffer_size_kb: Set the size of the ring buffer (per cpu).'

def initialize(self, tracepoints, buffer_size_kb=1408, **kwargs):

    self.job.require_gcc()
    self.trace_cmd_args = ['-b', str(buffer_size_kb)]
    for tracepoint in tracepoints:
        if isinstance(tracepoint, tuple):
            (tracepoint, event_filter) = tracepoint
        else:
            event_filter = None
        self.trace_cmd_args += ['-e', tracepoint]
        if event_filter:
            self.trace_cmd_args += ['-f', event_filter]
    self.builddir = os.path.join(self.bindir, 'build')
    if (not os.path.isdir(self.builddir)):
        os.makedirs(self.builddir)
    self.trace_cmd = os.path.join(self.builddir, 'bin', 'trace-cmd')
