File: who.sh

package info (click to toggle)
intel-gpu-tools 2.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 63,360 kB
  • sloc: xml: 781,458; ansic: 360,567; python: 8,336; yacc: 2,781; perl: 1,196; sh: 1,177; lex: 487; asm: 227; lisp: 35; makefile: 30
file content (13 lines) | stat: -rwxr-xr-x 327 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/bin/sh
#
# 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