Verified Commit 0589341b authored by Jim Newsome's avatar Jim Newsome
Browse files

log mem

parent 61b46124
Pipeline #12959 passed with stages
in 210 minutes and 45 seconds
......@@ -251,6 +251,7 @@ run-sim:
- 'for trial in `seq 3`; do sed -i ''s/UseEntryGuards:.*/UseEntryGuards: 1/'' jobs/tornet/$trial/conf/tor.client.torrc; done'
# Start monitoring in background
- (mkdir -p $CI_PROJECT_DIR/sysinfo/logged-mem && cd $CI_PROJECT_DIR/sysinfo/logged-mem && $CI_PROJECT_DIR/log-mem.sh 60) &
- $CI_PROJECT_DIR/monitor.sh $CI_PROJECT_DIR/sysinfo $CI_PROJECT_DIR/jobs/tornet &
- "for trial in `seq 3`; do tail -F $CI_PROJECT_DIR/jobs/tornet/$trial/shadow.log | grep -E 'WARN|ERR' | grep -v 'we only support AF_INET' | grep -v -E 'Ignoring `sigaction` for signal (31|11)' | sed 's/^/shadow.log: /' & done"
- "for trial in `seq 3`; do tail -F $CI_PROJECT_DIR/jobs/tornet/$trial/tor-err.txt | sed 's/^/tor-err: /' & done"
......
#!/bin/bash
# Every $1 seconds, logs RSS and PSS of ~every process to a file named after
# the current unix time.
set -euo pipefail
sleep_time=$1
rollup_cache=`mktemp`
mkdir -p raw
while true; do
date=`date +%s`
echo processing at $date
......@@ -13,15 +15,13 @@ while true; do
pid=`basename $procdir`
# Test whether we can access. File permissions, and hence `test -r`, lie.
if ! head -c 1 $procdir/smaps_rollup &> /dev/null ; then continue; fi
# Get contents of rollup once; I think this takes a fair bit of processing in-kernel
cat $procdir/smaps_rollup > $rollup_cache
if ! cat $procdir/smaps_rollup > $rollup_cache 2> /dev/null ; then continue; fi
pss=`grep -E '^Pss:' $rollup_cache | awk '{print $2}'`
rss=`grep -E '^Rss:' $rollup_cache | awk '{print $2}'`
cmd=`head -n1 -z $procdir/cmdline | tr -d '\000' | awk '{print $1}'`
echo $rss $pss $cmd >> raw/$date
echo $rss $pss $cmd >> $date
done
sleep $sleep_time
done
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment