On 19/09/2025 02:20, Jie Gan wrote:
On 9/19/2025 6:18 AM, Carl Worth wrote:
Jie Gan jie.gan@oss.qualcomm.com writes:
I dont think we can change back to sink_data since we introduced coresight_path to wrap 'data' which is needed by the path.
I suggest you to add the struct perf_output_handle to the coresight_path, then retrieving it with data->perf_handle in tmc_etr_get_buffer.
...
We can assign the perf_output_handle to the coresight_path after we constructed the coresight_path in perf mode.
Thanks. That much makes sense to me, and I'll put together a patch along those lines.
But, further: with core coresight code assembling into the path all the data that is necessary, is there any reason to be using void* in these enable/disable functions?
In my opinion, yes, we can change void * to coresight_path * for helper's enable/disable functions since we have everything in path so the cast is not necessary now.
Could we also change these functions to accept a coresight_path* and actually get some compiler help at finding mistakes like the one we're fixing here?
Yes, please. I was going to suggest that. May be we could do that as a separate patch after fixing the problem here first (so that it can be back ported).
This was initially a perf_handle only used for the perf mode, and it didn't make sens to have a "perf" argument to "enable" which could be used for both sysfs and perf. Now that the path is a generic data structure, it makes sense to move everything to accept the path.
Suzuki
That's the only benefit in my mind so far.
Thanks, Jie
-Carl
Suzuki K Poulose suzuki.poulose@arm.com writes:
Yes, please. I was going to suggest that. May be we could do that as a separate patch after fixing the problem here first (so that it can be back ported).
Hi, Suzuki,
I saw this suggestion after I had put together my v2 version of the patch, where I split the path and handle into separate arguments and also got rid of void* in a single patch. With that approach I think it only makes sense to do them together.
But if we instead were to make everything work with a single path argument, then I agree it would have made sense to change the type in a separate patch.
This was initially a perf_handle only used for the perf mode, and it didn't make sens to have a "perf" argument to "enable" which could be used for both sysfs and perf. Now that the path is a generic data structure, it makes sense to move everything to accept the path.
I'm fairly new to the entire coresight subsystem, so I might be getting this wrong. It looks to me like the perf handle is really part of the event so wouldn't logically make sense as part of the path? Am I understanding that correctly?
-Carl