mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2025-06-09 17:06:14 +00:00
A realtime display of GPU activity. Note, this is just at the point of minimum usability... Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
20 lines
310 B
C
20 lines
310 B
C
#include <unistd.h>
|
|
#include <fcntl.h>
|
|
|
|
#include "gem-objects.h"
|
|
|
|
int gem_objects_update(char *buf, int buflen)
|
|
{
|
|
int fd, len = -1;
|
|
|
|
fd = open("/sys/kernel/debug/dri/0/i915_gem_objects", 0);
|
|
if (fd >= 0) {
|
|
len = read(fd, buf, buflen-1);
|
|
if (len >= 0)
|
|
buf[len] = '\0';
|
|
close(fd);
|
|
}
|
|
|
|
return len;
|
|
}
|