>Четверг, 29 марта 2018, 21:46 +03:00 от Tvrtko Ursulin <tursu...@ursulin.net>:
>

>+#define engine_ptr(engines, n) \
>+((struct engine *)((unsigned char *)(&engines->engine) + (n) * sizeof(struct 
>engine)))

I think (&engines->engine + (n)) is easier to read.

>+if (fd < 0 && !cnt->optional)
>+return -1;

I've tried to run it on Skylake on Linux 4.16, and intel_gpu_top is working, as 
long as
I remove these lines. Otherwise it fails while trying "vcs1". Error message 
says about
Linux 4.16, which is a bit confusing.

There are code that sets and tests "present" field of struct pmu_counter. So,
I guess, it's fine to remove the code, and thus make all counters optional?

>+
>+if (!cnt->present) {
>+strncpy(buf, "---", bufsz);
> return;
>+}

If you decide to make all counters optional, this will be used for "busy" 
numbers
too. But "busy" is 6 characters wide, unlike "sema" and "wait", which are 3 
each.


>-- 
>2.14.1
>

---
Rinat
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reply via email to