@@ -1448,13 +1448,6 @@ int tracecmd_append_cpu_data(struct tracecmd_output *handle,
{
int ret;
- /*
- * Save the command lines;
- */
- ret = tracecmd_write_cmdlines(handle);
- if (ret)
- return ret;
-
ret = tracecmd_write_cpus(handle, cpus);
if (ret)
return ret;
@@ -1556,6 +1549,9 @@ tracecmd_create_file_glob(const char *output_file,
if (!handle)
return NULL;
+ if (tracecmd_write_cmdlines(handle))
+ return NULL;
+
if (tracecmd_append_cpu_data(handle, cpus, cpu_data_files) < 0) {
tracecmd_output_close(handle);
return NULL;
@@ -4236,6 +4236,9 @@ static void record_data(struct common_record_context *ctx)
add_guest_info(handle, instance);
}
+ if (tracecmd_write_cmdlines(handle))
+ die("Writing cmdlines");
+
tracecmd_append_cpu_data(handle, local_cpu_count, temp_files);
for (i = 0; i < max_cpu_count; i++)
@@ -384,6 +384,10 @@ static double parse_file(struct tracecmd_input *handle,
for (cpu = 0; cpu < cpus; cpu ++)
cpu_list[cpu] = cpu_data[cpu].file;
+ /* TODO: Fix me, this is suppose to come from handle */
+ if (tracecmd_write_cmdlines(ohandle))
+ die("Writing cmdlines");
+
tracecmd_append_cpu_data(ohandle, cpus, cpu_list);
current = end;