Re: [igt-dev] [RFC i-g-t] intel-gpu-top: Rewrite the tool to be safe to use

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

 



>Среда, 28 марта 2018, 21:30 +03:00 от Tvrtko Ursulin <tursulin@xxxxxxxxxxx>:
>

>+static struct engines *discover_engines(void)
> {
>-uint32_t devid = pci_dev->device_id;
>-uint16_t gcfgc;
>+const char *sysfs_root = "/sys/devices/i915/events";

Just a question.
I think, I have Linux 4.15.11 (from Debian testing) now. And there are no such files.
Are there any estimates about when this feature is expected to be available?

>-static void ring_init(struct ring *ring)
>+static uint64_t pmu_read_multi(int fd, unsigned int num, uint64_t *val)
> {
>-ring->size = (((ring_read(ring, RING_LEN) & RING_NR_PAGES) >> 12) + 1) * 4096;
>+uint64_t buf[2 + num];
>+unsigned int i;
>+
>+assert(read(fd, buf, sizeof(buf)) == sizeof(buf));

Will have undesired effects with NDEBUG.

>-int full;
>+uint64_t data[2];
> 
>-if (!ring->size)
>-return;
>+assert(read(fd, data, sizeof(data)) == sizeof(data));

Same here.

>+/* Get terminal size. */
>+if (ioctl(0, TIOCGWINSZ, &ws) != -1) {
>+con_w = ws.ws_col;
>+con_h = ws.ws_row;
>+}

If you move this into the loop itself, the tool will adapt to changes in
terminal width and height dynamically.

>-- 
>2.14.1
>
>_______________________________________________
>igt-dev mailing list
>igt-dev@xxxxxxxxxxxxxxxxxxxxx
>https://lists.freedesktop.org/mailman/listinfo/igt-dev

---
Rinat
_______________________________________________
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