Re: [RFC 8/8] drm/i915: Expose per-engine client busyness

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

 



Quoting Tvrtko Ursulin (2019-12-19 18:00:19)
> +       for (i = 0;
> +            client->busy_root && i < ARRAY_SIZE(uabi_class_names);
> +            i++) {
> +               struct i915_engine_busy_attribute *i915_attr =
> +                       &client->attr.busy[i];
> +
> +               i915_attr->client = client;
> +               i915_attr->engine_class = i;
> +
> +               attr = &i915_attr->attr;
> +
> +               sysfs_attr_init(&attr->attr);
> +
> +               attr->attr.name = uabi_class_names[i];
> +               attr->attr.mode = 0444;
> +               attr->show = show_client_busy;
> +
> +               ret = sysfs_create_file(client->busy_root,
> +                                       (struct attribute *)attr);

Do we need to hold a reference from the open file to the
i915_drm_client?

	fd = open("/sys/i915/clients/0/0", O_RDONLY);

	v[0] = read_u64(fd);
	sleep(2); rewind(fd);
	v[1] = read_u64(fd);

	close(fd);

I was thinking whether or not poll("/sys/i915/clients") would return
events for new clients and so whether or not we could do something like

if (poll("/sys/i915/clients", timeout) > 0) {
	for_each_new_client:
		client = open("/sys/i915/client/$id");
}

for_each_client:
	printf("%s: {rcs:%llu, ...}", client->name, read_u64(client->rcs));

Might be a bit heavy on the fds :)
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx



[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux