Welcome to mirror list, hosted at ThFree Co, Russian Federation.

watchcompile.sh - github.com/openwrt/buildscripts.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 0e8652c74f4efb7b98fc76ce34a5fb9615cf2884 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/bash

#watch "ps hww -o args | sed -ne 's, BUILD_VARIANT.*,,; s,^make -C package/feeds/,,p' | sort"

sdkdir="$(readlink -f .cache/sdk/)/"

while true; do
	out="$(
		date
		grep -slE "^Uid:\s+$(id -u)\s" /proc/[0-9]*/status | while read pid; do
			pid="${pid#/proc/}"
			pid="${pid%/status}"

			cwd="$(readlink "/proc/$pid/cwd" 2>/dev/null)"
			case "$cwd" in $sdkdir*)
				cmd="$(cat "/proc/$pid/cmdline" 2>/dev/null | tr '\0' ' ' | head -n 1)"
				#case "$cmd" in "make -C "*)
					cwd="${cwd%%/build_dir/*}"
					echo "[${cwd:${#sdkdir}}] ${cmd:0:72}"
				#;; esac
			;; esac
		done | sort
	)"

	clear
	echo "$out"
	sleep 2
done