source: doc/theses/thierry_delisle_PhD/code/readyQ_proto/process.sh @ d035cf7

ADTarm-ehast-experimentalenumforall-pointer-decayjacob/cs343-translationnew-ast-unique-exprpthread-emulationqualifiedEnum
Last change on this file since d035cf7 was f9f3775, checked in by Thierry Delisle <tdelisle@…>, 4 years ago

Moved phd code for the readQ prototype to it's own folder

  • Property mode set to 100755
File size: 1.4 KB
Line 
1#!/bin/bash
2
3NAME=$1
4
5if [ ! -f "raw/${NAME}.out" ]; then
6    echo "Not output for ${NAME}"
7    exit 1
8fi
9
10if [ ! -f "raw/${NAME}.data" ]; then
11    echo "Not perf record for ${NAME}"
12    exit 1
13fi
14
15echo "Processing perf data for ${NAME}"
16
17OPS=$(grep -e 'Total ops' raw/${NAME}.out)
18CPOP=$( echo "Hello $OPS" | \grep -oP ", \K[0-9,]+(?=o)" --color | tr -d ',')
19CPUSH=$(echo "Hello $OPS" | \grep -oP "\(\K[0-9,]+(?=i)" --color | tr -d ',')
20
21REPORT=''
22perf report -n --percent-limit 5 --stdio --no-children -i raw/${NAME}.data > raw/.temp
23EVENT=$(cat raw/.temp | grep -e '^# Samples'| cut -d ' ' -f 6)
24SPOP=$( cat raw/.temp | grep -e '] relaxed_list<Node>::pop'  | tr -s ' ' | cut -d ' ' -f 3)
25SPUSH=$(cat raw/.temp | grep -e '] relaxed_list<Node>::push' | tr -s ' ' | cut -d ' ' -f 3)
26SARR=$( cat raw/.temp | grep -e '] snz[i|m]_t::node::arrive_h'   | tr -s ' ' | cut -d ' ' -f 3)
27
28echo "$OPS"
29echo "Push count: $CPUSH"
30echo "Pop  count: $CPOP"
31
32echo "Pop    samples: $SPOP"
33echo "Push   samples: $SPUSH"
34echo "Arrive samples: $SARR"
35
36SpPUSH=$(bc -l <<< "scale=9; $SPUSH / $CPUSH")
37SpPOP=$( bc -l <<< "scale=9; $SPOP  / $CPOP" )
38SpARR=$( bc -l <<< "scale=9; $SARR  / $CPUSH")
39
40printf "%s per push()  : %.9f\n" $EVENT $SpPUSH | sed ':a;s/\B[0-9]\{3\}\>/,&/;ta'
41printf "%s per pop()   : %.9f\n" $EVENT $SpPOP  | sed ':a;s/\B[0-9]\{3\}\>/,&/;ta'
42printf "%s per arrive(): %.9f\n" $EVENT $SpARR  | sed ':a;s/\B[0-9]\{3\}\>/,&/;ta'
Note: See TracBrowser for help on using the repository browser.