Re: [PATCH v6 07/14] gtrace: Add function to copy into perf AUX buffer
From: Mayuresh Chitale
Date: Wed Nov 18 2026 - 06:52:46 EST
Hi Leo,
On Tue, Nov 10, 2026 at 9:59 AM Leo Yu-Chi Liang <leo.liang@xxxxxxxxxx> wrote:
>
> 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).
>
Ok. I will update in v7.
> Only the sink holds the path's trace data, so could this just call the
> sink's callback?ie
>
> 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