31 lines · 544 B · Text
RawDownload
#!/bin/rc# kmem [kernel] - print summary of allocate blocks in running kernelrfork eif(! ~ $#* 0 1){	echo 'usage: kmem [kernel]' >[1=2]	exit usage} if(~ $#* 1)	binary=$1 echo 'kinit(); blocksummary()' | acid -k -lkernel -lpool -lleak $pid $binary | awk '	$1 == "block" {		addr=$6		size=$3		alloc=$4		total[alloc] += size		count[alloc]++	}	$1 == "summary" { 		alloc=$2		cnt=$3		size=$4		total[alloc] += size		count[alloc] += cnt	}	END{		for(i in count)			printf("%6d %11d %s\n", count[i], total[i], i);	}' | sort -nr

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t