[Intel-gfx] [RFC i-g-t 2/2] tools/intel_engine_stats: Just a demo

Tvrtko Ursulin tvrtko.ursulin at linux.intel.com
Wed Aug 2 13:10:35 UTC 2017


On 02/08/2017 14:02, Chris Wilson wrote:
> Quoting Tvrtko Ursulin (2017-08-02 13:33:12)
>> diff --git a/tools/intel_engine_stats.c b/tools/intel_engine_stats.c
>> new file mode 100644
>> index 000000000000..24dbb1eb6a57
>> --- /dev/null
>> +++ b/tools/intel_engine_stats.c
>> @@ -0,0 +1,40 @@
>> +#include <stdio.h>
>> +#include <sys/types.h>
>> +#include <sys/stat.h>
>> +#include <fcntl.h>
>> +#include <unistd.h>
>> +
>> +#include "drmtest.h"
>> +#include "igt_debugfs.h"
>> +
>> +int main(void)
>> +{
>> +       int drm_fd, fd;
>> +
>> +       drm_fd = drm_open_driver(DRIVER_INTEL);
>> +
>> +       fd = igt_debugfs_open(drm_fd, "i915_engine_stats", O_RDONLY);
>> +       igt_assert(fd >= 0);
> 
> I'm just going to advise caution over using debugfs from tools/. If it
> is useful enough to wrap up, presumably we want to support it
> indefinitely.  This is just

That's true yes. This is more just a reference to how it should be used 
because ...

> 	watch cat /sys/kernel/debug/dri/0/i915_engine_stats

... it is not like the above since you would lose previous context if 
you did that. Because utilisation tracking is only working while the 
file is open, so the intended usage is to keep rewinding and looking at 
the delta.

> but a small demo to extract just this from perf would be useful.

Good idea - marking as TODO.

Regards,

Tvrtko




More information about the Intel-gfx mailing list