'Start ftrace profiler
:param test: Autotest test in which the profiler will operate on.'

def start(self, test):

    utils.system(('%s    reset' % self.trace_cmd))
    output_dir = os.path.join(test.profdir, 'ftrace')
    if (not os.path.isdir(output_dir)):
        os.makedirs(output_dir)
    self.output = os.path.join(output_dir, 'trace.dat')
    cmd = [self.trace_cmd, 'record', '-o', self.output]
    cmd += self.trace_cmd_args
    self.record_job = utils.BgJob(self.join_command(cmd), stderr_tee=utils.TEE_TO_LOGS)
    tracing_on = os.path.join(self.tracing_dir, 'tracing_on')
    while ((self.record_job.sp.poll() is None) and (utils.read_file(tracing_on).strip() != '1')):
        time.sleep(0.1)
    if (self.record_job.sp.poll() is not None):
        utils.join_bg_jobs([self.record_job])
        raise error.CmdError(self.record_job.command, self.record_job.sp.returncode, 'trace-cmd    exited    early.')
