[PATCH v6 07/14] gtrace: Add function to copy into perf AUX buffer
Leo Yu-Chi Liang
leo.liang at sifive.com
Mon Nov 9 20:29:19 PST 2026
Hi Mayuresh,
On 10/1/2026 1:22 PM, Mayuresh Chitale wrote:
> + list_for_each_entry(node, &path->comp_list, head) {
> + comp = node->comp;
> + gtdrv = to_gtrace_driver(comp->dev.driver);
> + if (!gtdrv || !gtdrv->copyto_auxbuf)
> + continue;
> +
> + *bytes_copied = gtdrv->copyto_auxbuf(comp, buf, format);
> + ret = 0;
> + break;
> + }
This calls copyto_auxbuf() of the first component in the path that
implements it, which assumes only sinks implement it. On Eswin/EIC7700
pre-ratified trace hardware the encoder and funnel each have an embedded
system memory sink. Whether a component is the sink depends on the
topology: an encoder connected to a funnel is not the sink, but an
encoder with no output connection is. In the first case the data would
be copied from the encoder rather than from the funnel, and under the
funnel's lock (the same lock mismatch sashiko pointed out).
Only the sink holds the path's trace data, so could this just call the
sink's callback?
struct gtrace_component *comp = gtrace_path_sink(path);
...
gtdrv = to_gtrace_driver(comp->dev.driver);
if (gtdrv && gtdrv->copyto_auxbuf) {
*bytes_copied = gtdrv->copyto_auxbuf(comp, buf, format);
ret = 0;
}
Thanks,
Leo
More information about the linux-riscv
mailing list