Re: [PATCH v2 1/4] Coresight: Add trace_id function to collect trace ID

From: Markus Elfring
Date: Mon Jul 08 2024 - 08:37:26 EST


> Add 'trace_id' function pointer in ops. It's responsible for collect the


It is? collecting?



> +++ b/drivers/hwtracing/coresight/coresight-etm-perf.c

> + sink_data = kzalloc(sizeof(*sink_data), GFP_KERNEL);
> + if (!sink_data)
> + goto fail_end_stop;

> + if (coresight_enable_path(path, CS_MODE_PERF, sink_data)) {
> + kfree(sink_data);
> goto fail_end_stop;
> + }


Would you like to to benefit any more from further applications of scope-based
resource management by using an attribute like “__free(kfree)”?
https://elixir.bootlin.com/linux/v6.10-rc7/source/include/linux/slab.h#L282

Regards,
Markus