From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Rinat Ibragimov <ibragimovrinat@mail.ru>,
Tvrtko Ursulin <tursulin@ursulin.net>
Cc: igt-dev@lists.freedesktop.org, Intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [igt-dev] [RFC i-g-t] intel-gpu-top: Rewrite the tool to be safe to use
Date: Thu, 29 Mar 2018 11:49:01 +0100 [thread overview]
Message-ID: <e94a36b8-5d8d-cd10-9638-b2520cf9b264@linux.intel.com> (raw)
In-Reply-To: <1522267876.37140964@f337.i.mail.ru>
On 28/03/2018 21:11, Rinat Ibragimov wrote:
>
>> Среда, 28 марта 2018, 21:30 +03:00 от Tvrtko Ursulin <tursulin@ursulin.net>:
>>
>
>> +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?
4.17 I think. I could make it work with 4.16 as well, if there would be
demand, just need to ignore counters enumerated in sysfs but not
actually present in hardware.
>> -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.
Thanks, got a bit disconnected from userspace development patterns over
the years.
>
>> +/* 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.
Makes sense, done in v2.
Regards,
Tvrtko
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2018-03-29 10:49 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-28 18:29 [Intel-gfx] [RFC i-g-t] intel-gpu-top: Rewrite the tool to be safe to use Tvrtko Ursulin
2018-03-28 18:35 ` [igt-dev] " Chris Wilson
2018-03-28 18:56 ` Lionel Landwerlin
2018-03-29 0:40 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2018-03-29 8:20 ` [Intel-gfx] [RFC i-g-t] " Petri Latvala
2018-03-29 9:46 ` [igt-dev] ✓ Fi.CI.IGT: success for " Patchwork
2018-03-29 10:33 ` [igt-dev] [PATCH i-g-t v2] " Tvrtko Ursulin
2018-03-29 14:30 ` [Intel-gfx] " Eero Tamminen
2018-03-29 18:46 ` [igt-dev] [PATCH i-g-t v3] " Tvrtko Ursulin
[not found] ` <1522437301.774767662@f417.i.mail.ru>
2018-04-03 9:14 ` [Intel-gfx] [PATCH i-g-t v4] " Tvrtko Ursulin
2018-04-03 9:38 ` [igt-dev] [PATCH i-g-t v3] " Tvrtko Ursulin
2018-03-29 19:10 ` [igt-dev] ✓ Fi.CI.BAT: success for intel-gpu-top: Rewrite the tool to be safe to use (rev3) Patchwork
2018-03-29 23:29 ` [igt-dev] ✗ Fi.CI.IGT: warning " Patchwork
2018-04-03 9:36 ` [Intel-gfx] [igt-dev] [PATCH i-g-t v2] intel-gpu-top: Rewrite the tool to be safe to use Tvrtko Ursulin
2018-04-03 14:06 ` Eero Tamminen
2018-04-03 17:18 ` Tvrtko Ursulin
2018-04-04 12:15 ` [Intel-gfx] " Eero Tamminen
2018-04-04 12:42 ` Tvrtko Ursulin
2018-04-04 14:23 ` Eero Tamminen
2018-04-04 15:24 ` Tvrtko Ursulin
2018-03-29 16:27 ` Chris Wilson
[not found] ` <1522267876.37140964@f337.i.mail.ru>
2018-03-29 10:49 ` Tvrtko Ursulin [this message]
2018-03-29 15:59 ` [igt-dev] ✓ Fi.CI.BAT: success for intel-gpu-top: Rewrite the tool to be safe to use (rev2) Patchwork
2018-03-29 20:23 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2018-04-04 9:48 ` [igt-dev] [PATCH i-g-t v5] intel-gpu-top: Rewrite the tool to be safe to use Tvrtko Ursulin
2018-04-04 15:26 ` [igt-dev] [PATCH i-g-t v6] " Tvrtko Ursulin
2018-04-09 12:26 ` Tvrtko Ursulin
2018-05-29 9:58 ` Matthew Auld
2018-04-04 13:27 ` [igt-dev] ✓ Fi.CI.BAT: success for intel-gpu-top: Rewrite the tool to be safe to use (rev4) Patchwork
2018-04-04 15:53 ` [igt-dev] ✗ Fi.CI.BAT: failure for intel-gpu-top: Rewrite the tool to be safe to use (rev5) Patchwork
2018-04-04 16:56 ` [igt-dev] ✗ Fi.CI.IGT: warning for intel-gpu-top: Rewrite the tool to be safe to use (rev4) Patchwork
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e94a36b8-5d8d-cd10-9638-b2520cf9b264@linux.intel.com \
--to=tvrtko.ursulin@linux.intel.com \
--cc=Intel-gfx@lists.freedesktop.org \
--cc=ibragimovrinat@mail.ru \
--cc=igt-dev@lists.freedesktop.org \
--cc=tursulin@ursulin.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox