.. | .. |
---|
48 | 48 | |
---|
49 | 49 | kbdev = list_entry(entry, struct kbase_device, entry); |
---|
50 | 50 | /* output the total memory usage and cap for this device */ |
---|
| 51 | + seq_printf(sfile, "<dev> <pages>\n"); |
---|
51 | 52 | seq_printf(sfile, "%-16s %10u\n", |
---|
52 | 53 | kbdev->devname, |
---|
53 | 54 | atomic_read(&(kbdev->memdev.used_pages))); |
---|
54 | 55 | mutex_lock(&kbdev->kctx_list_lock); |
---|
| 56 | + seq_printf(sfile, " <kctx> <comm> <pid> <pages>\n"); |
---|
55 | 57 | list_for_each_entry(kctx, &kbdev->kctx_list, kctx_list_link) { |
---|
| 58 | + struct pid *pid_struct; |
---|
| 59 | + struct task_struct *task; |
---|
| 60 | + |
---|
| 61 | + rcu_read_lock(); |
---|
| 62 | + pid_struct = find_get_pid(kctx->tgid); |
---|
| 63 | + task = pid_task(pid_struct, PIDTYPE_PID); |
---|
56 | 64 | /* output the memory usage and cap for each kctx |
---|
57 | 65 | * opened on this device |
---|
58 | 66 | */ |
---|
59 | | - seq_printf(sfile, " %s-0x%pK %10u\n", |
---|
| 67 | + seq_printf(sfile, " %s-0x%pK %-20s %-10d %10u\n", |
---|
60 | 68 | "kctx", |
---|
61 | 69 | kctx, |
---|
| 70 | + task ? task->comm : "[null comm]", |
---|
| 71 | + kctx->tgid, |
---|
62 | 72 | atomic_read(&(kctx->used_pages))); |
---|
| 73 | + put_pid(pid_struct); |
---|
| 74 | + rcu_read_unlock(); |
---|
63 | 75 | } |
---|
64 | 76 | mutex_unlock(&kbdev->kctx_list_lock); |
---|
65 | 77 | } |
---|