Ftrace instances should be created physically in the tracefs, before trying to access its files. In record_trace() function, the call to make_instances() should be before the logic which reads the instance's tracing file. Signed-off-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@xxxxxxxxx> --- tracecmd/trace-record.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tracecmd/trace-record.c b/tracecmd/trace-record.c index d8c24ebf..1e4d38fa 100644 --- a/tracecmd/trace-record.c +++ b/tracecmd/trace-record.c @@ -6222,6 +6222,8 @@ static void record_trace(int argc, char **argv, if (!ctx->output) ctx->output = DEFAULT_INPUT_FILE; + make_instances(); + /* Save the state of tracing_on before starting */ for_all_instances(instance) { instance->output_file = strdup(ctx->output); @@ -6236,8 +6238,6 @@ static void record_trace(int argc, char **argv, instance->tracing_on_init_val = 1; } - make_instances(); - if (ctx->events) expand_event_list(); -- 2.25.4