summaryrefslogtreecommitdiff
path: root/scripts/who.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/who.sh')
-rwxr-xr-xscripts/who.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/scripts/who.sh b/scripts/who.sh
new file mode 100755
index 00000000..b2216398
--- /dev/null
+++ b/scripts/who.sh
@@ -0,0 +1,13 @@
+#!/bin/bash
+#
+# usage: sudo who.sh
+#
+# Requires root permissions to both query who has the device open,
+# and to read the mappings of likely root-owned processes
+#
+
+for i in `lsof -t /dev/dri/card0`; do
+ who=`readlink /proc/$i/exe`
+ count=`grep /dev/dri/card0 /proc/$i/maps | wc -l | cut -f1 -d\ `
+ echo "$who [$i]: $count"
+done