Re: [PATCH i-g-t v2] overlay: parse tracepoints from sysfs to figure out fields' location

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Quoting Lionel Landwerlin (2017-12-19 01:06:18)
> With changes going to drm-tip, the tracepoints field locations are
> going to change. This change introduces a tracepoint parser (using a
> peg parser) which lets us figure out field positions on the fly.
> 
> v2: Fix automake build (Lionel)
> 
> Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@xxxxxxxxx>
> ---
> @@ -292,9 +394,13 @@ static int wait_end(struct gpu_perf *gp, const void *event)
>         const struct sample_event *sample = event;
>         struct gpu_perf_time *wait, **prev;

u32 engine = READ_TP_FIELD_U32(sample, TP_GEM_REQUEST_WAIT_END, ring);
u32 context = READ_TP_FIELD_U32(sample, TP_GEM_REQUEST_WAIT_END, ctx);
u32 seqno = READ_TP_FIELD_U32(sample, TP_GEM_REQUEST_WAIT_END, seqno);

> -       for (prev = &gp->wait[sample->raw[ENGINE]]; (wait = *prev) != NULL; prev = &wait->next) {
> -               if (wait->context != sample->raw[CTX] ||
> -                   wait->seqno != sample->raw[CTX_SEQNO])
> +       for (prev = &gp->wait[READ_TP_FIELD_U32(sample, TP_GEM_REQUEST_WAIT_END, ring)];
> +            (wait = *prev) != NULL;
> +            prev = &wait->next) {
> +               if (wait->context != READ_TP_FIELD_U32(sample,
> +                                                             TP_GEM_REQUEST_WAIT_END, ctx) ||
> +                   wait->seqno != READ_TP_FIELD_U32(sample,
> +                                                           TP_GEM_REQUEST_WAIT_END, seqno))
>                         continue;

Looks very useful, thanks!
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux