Ignore:
Timestamp:
Jun 26, 2020, 2:53:34 PM (4 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
b813f53
Parents:
f2b18d01
Message:

added --save-temps and --outfile to halts viewing

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/perf/process_halts.sh

    rf2b18d01 r359d12d  
    11#!/bin/bash -e
    22
    3 DIR=$( dirname "${BASH_SOURCE[0]}")
    4 echo $DIR
    5 tmpfile=$(mktemp)
    6 function finish {
    7   rm -rf "$tmpfile"
    8 }
    9 trap finish EXIT
     3SAVE_TEMPS=false
     4while (( "$#" )); do
     5        case "$1" in
     6        -s|--save-temps)
     7                SAVE_TEMPS=true
     8                shift
     9                ;;
     10        *) # preserve positional arguments
     11                PARAMS="$PARAMS $1"
     12                shift
     13                ;;
     14        esac
     15done
     16# set positional arguments in their proper place
     17eval set -- "$PARAMS"
    1018
     19if $SAVE_TEMPS; then
     20        tmpfile=$(mktemp --tmpdir=$(pwd))
     21        echo "Saving to $tmpfile"
     22else
     23        tmpfile=$(mktemp)
     24        function finish {
     25                rm -rf "$tmpfile"
     26        }
     27        trap finish EXIT
     28fi
    1129# split the wanted and unwanted output
    1230awk "/^Processor|^PH:[0-9]+ - [0-9]+ [0-9]+/ {print \$0 > \"$tmpfile\"; next}{print \$0; fflush()}"
    1331
    1432# pass the data to the python scirpt
    15 $DIR/view_halts.py $tmpfile
     33DIR=$( dirname "${BASH_SOURCE[0]}")
     34cat $tmpfile | $DIR/view_halts.py ${PARAMS}
Note: See TracChangeset for help on using the changeset viewer.