[Intel-gfx] [RFC 08/12] drm/i915: Expose per-engine client busyness
Chris Wilson
chris at chris-wilson.co.uk
Tue Mar 10 18:32:04 UTC 2020
Quoting Tvrtko Ursulin (2020-03-09 18:31:25)
> +static ssize_t
> +show_client_busy(struct device *kdev, struct device_attribute *attr, char *buf)
> +{
> + struct i915_engine_busy_attribute *i915_attr =
> + container_of(attr, typeof(*i915_attr), attr);
> + unsigned int class = i915_attr->engine_class;
> + struct i915_drm_client *client = i915_attr->client;
> + u64 total = atomic64_read(&client->past_runtime[class]);
> + struct list_head *list = &client->ctx_list;
> + struct i915_gem_context *ctx;
> +
> + rcu_read_lock();
> + list_for_each_entry_rcu(ctx, list, client_link) {
> + total += atomic64_read(&ctx->past_runtime[class]);
> + total += pphwsp_busy_add(ctx, class);
> + }
> + rcu_read_unlock();
> +
> + total *= RUNTIME_INFO(i915_attr->i915)->cs_timestamp_period_ns;
Planning early retirement? In 600 years, they'll have forgotten how to
email ;)
-Chris
More information about the Intel-gfx
mailing list