[Intel-gfx] [igt-dev] [PATCH i-g-t v6] intel-gpu-top: Support for client stats

Chris Wilson chris at chris-wilson.co.uk
Fri Jan 22 12:21:48 UTC 2021


Quoting Tvrtko Ursulin (2021-01-22 11:55:24)
> +static void update_client(struct client *c, unsigned int pid, char *name)
> +{
> +       uint64_t val[c->clients->num_classes];
> +       unsigned int i;
> +
> +       if (c->pid != pid)
> +               c->pid = pid;
> +
> +       if (strcmp(c->name, name)) {
> +               char *p;
> +
> +               strncpy(c->name, name, sizeof(c->name) - 1);
> +               strncpy(c->print_name, name, sizeof(c->print_name) - 1);
> +
> +               p = c->print_name;
> +               while (*p) {
> +                       if (!isprint(*p))
> +                               *p = '*';
> +                       p++;
> +               };

Stray ';'

Probably worth adding a TODO for utf8 validation. But for now this stops
the terminal from being screwed with.

Nothing else jumped out at me so,
Reviewed-by: Chris Wilson <chris at chris-wilson.co.uk>
-Chris


More information about the Intel-gfx mailing list