git://git.jankratochvil.net
/
nethome.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Obsoleted by: Linux kernel /proc/PID/fdinfo/
[nethome.git]
/
bin
/
ptracegrep
1
#! /bin/sh
2
# $Id$
3
4
PID=$(sed -n 's/^ptrace *([^,]*, *\([0-9]*\),.*$/\1/p' "$1"|sort|uniq -c|sort -nr|head -n1|awk '{print $2}')
5
echo >&2 "PID=$PID"
6
grep $PID $1 \
7
| grep -v '^\(\(open\|read\) *(\|ptrace *( *PTRACE_\(PEEK\|POKE\)\)' \
8
| sed -e 's/\<'$PID'\>/PID/g' -e 's/0x[0-9a-f]\{5,\}/HEX/g'