mirror of
https://git.proxmox.com/git/mirror_ubuntu-kernels.git
synced 2025-12-08 07:15:55 +00:00
drm/i915: Print how many objects are shared in per-process stats
The point of this measure is to gauge why a process has a lot of gem objects in uses and why. Especially for compositors it's interesting to know whether it's a leak of private objects or just a lot of use from buffers shared with clients. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Ben Widawsky <ben@bwidawsk.net> [danvet: Add a bit of commit message flesh to address Ben's comment.] Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
This commit is contained in:
parent
6313c20490
commit
c67a17e972
@ -301,7 +301,9 @@ static int i915_gem_stolen_list_info(struct seq_file *m, void *data)
|
|||||||
struct file_stats {
|
struct file_stats {
|
||||||
struct drm_i915_file_private *file_priv;
|
struct drm_i915_file_private *file_priv;
|
||||||
int count;
|
int count;
|
||||||
size_t total, global, active, inactive, unbound;
|
size_t total, unbound;
|
||||||
|
size_t global, shared;
|
||||||
|
size_t active, inactive;
|
||||||
};
|
};
|
||||||
|
|
||||||
static int per_file_stats(int id, void *ptr, void *data)
|
static int per_file_stats(int id, void *ptr, void *data)
|
||||||
@ -313,6 +315,9 @@ static int per_file_stats(int id, void *ptr, void *data)
|
|||||||
stats->count++;
|
stats->count++;
|
||||||
stats->total += obj->base.size;
|
stats->total += obj->base.size;
|
||||||
|
|
||||||
|
if (obj->base.name || obj->base.dma_buf)
|
||||||
|
stats->shared += obj->base.size;
|
||||||
|
|
||||||
if (USES_FULL_PPGTT(obj->base.dev)) {
|
if (USES_FULL_PPGTT(obj->base.dev)) {
|
||||||
list_for_each_entry(vma, &obj->vma_list, vma_link) {
|
list_for_each_entry(vma, &obj->vma_list, vma_link) {
|
||||||
struct i915_hw_ppgtt *ppgtt;
|
struct i915_hw_ppgtt *ppgtt;
|
||||||
@ -450,13 +455,14 @@ static int i915_gem_object_info(struct seq_file *m, void* data)
|
|||||||
*/
|
*/
|
||||||
rcu_read_lock();
|
rcu_read_lock();
|
||||||
task = pid_task(file->pid, PIDTYPE_PID);
|
task = pid_task(file->pid, PIDTYPE_PID);
|
||||||
seq_printf(m, "%s: %u objects, %zu bytes (%zu active, %zu inactive, %zu global, %zu unbound)\n",
|
seq_printf(m, "%s: %u objects, %zu bytes (%zu active, %zu inactive, %zu global, %zu shared, %zu unbound)\n",
|
||||||
task ? task->comm : "<unknown>",
|
task ? task->comm : "<unknown>",
|
||||||
stats.count,
|
stats.count,
|
||||||
stats.total,
|
stats.total,
|
||||||
stats.active,
|
stats.active,
|
||||||
stats.inactive,
|
stats.inactive,
|
||||||
stats.global,
|
stats.global,
|
||||||
|
stats.shared,
|
||||||
stats.unbound);
|
stats.unbound);
|
||||||
rcu_read_unlock();
|
rcu_read_unlock();
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user