#!/bin/bash
set -e

name=$1
event=$2

shift 2

echo "perf record -F 99 -a -g -o raw/$name.data -e $event -- $@ > raw/$name.out"
perf record -F 99 -a -g -o raw/$name.data -e $event -- $@ > raw/$name.out
echo "=============================="
cat raw/$name.out
echo "=============================="
./process.sh $name