From: "Steven Rostedt (Google)" <rostedt@xxxxxxxxxxx> The stop_mapping_vcpus() takes an instance as a parameter just to get to the cpu_count. There's no reason to not just pass the cpu_count instead. This will also simplify the code when adding an agent proxy that will use this code as well. Signed-off-by: Steven Rostedt (Google) <rostedt@xxxxxxxxxxx> --- tracecmd/trace-record.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tracecmd/trace-record.c b/tracecmd/trace-record.c index 8b6b27595c96..f05ad09c9723 100644 --- a/tracecmd/trace-record.c +++ b/tracecmd/trace-record.c @@ -3920,8 +3920,7 @@ static int map_vcpus(struct tep_event *event, struct tep_record *record, return i == tmap->max_cpus; } -static void stop_mapping_vcpus(struct buffer_instance *instance, - struct trace_guest *guest) +static void stop_mapping_vcpus(int cpu_count, struct trace_guest *guest) { struct trace_mapping tmap = { }; struct tep_handle *tep; @@ -3932,7 +3931,7 @@ static void stop_mapping_vcpus(struct buffer_instance *instance, return; tmap.pids = guest->task_pids; - tmap.max_cpus = instance->cpu_count; + tmap.max_cpus = cpu_count; tmap.map = malloc(sizeof(*tmap.map) * tmap.max_cpus); if (!tmap.map) @@ -4010,7 +4009,7 @@ static int host_tsync(struct common_record_context *ctx, instance->cpu_count, proto, ctx->clock); if (!is_network(instance)) - stop_mapping_vcpus(instance, guest); + stop_mapping_vcpus(instance->cpu_count, guest); if (!instance->tsync) return -1; -- 2.35.1