|
Carlos Rodriguez-Fernandez |
0f92db |
#!/bin/bash
|
|
Carlos Rodriguez-Fernandez |
0f92db |
# Author: Carlos Rodriguez-Fernandez <carlosrodrifernandez@gmail.com>
|
|
Carlos Rodriguez-Fernandez |
0f92db |
|
|
Carlos Rodriguez-Fernandez |
0f92db |
|
|
Carlos Rodriguez-Fernandez |
0f92db |
t_Log "Running $0"
|
|
Carlos Rodriguez-Fernandez |
0f92db |
|
|
Carlos Rodriguez-Fernandez |
0f92db |
output_file=$(mktemp)
|
|
Carlos Rodriguez-Fernandez |
0f92db |
trap "rm -f ${output_file}; rm -f perf.data" EXIT
|
|
Carlos Rodriguez-Fernandez |
0f92db |
|
|
Carlos Rodriguez-Fernandez |
0f92db |
t_Log "Running $0: perf record"
|
|
Carlos Rodriguez-Fernandez |
0f92db |
if ! perf record -F 49 -a -g -- sleep 1 > ${output_file} 2>&1; then
|
|
Carlos Rodriguez-Fernandez |
0f92db |
cat ${output_file}
|
|
Carlos Rodriguez-Fernandez |
0f92db |
t_CheckExitStatus 1
|
|
Carlos Rodriguez-Fernandez |
0f92db |
fi
|
|
Carlos Rodriguez-Fernandez |
0f92db |
|
|
Carlos Rodriguez-Fernandez |
0f92db |
t_Log "Running $0: perf report"
|
|
Carlos Rodriguez-Fernandez |
0f92db |
if ! perf report --stats > ${output_file} 2>&1; then
|
|
Carlos Rodriguez-Fernandez |
0f92db |
cat ${output_file}
|
|
Carlos Rodriguez-Fernandez |
0f92db |
t_CheckExitStatus 1
|
|
Carlos Rodriguez-Fernandez |
0f92db |
fi
|
|
Carlos Rodriguez-Fernandez |
0f92db |
|
|
Carlos Rodriguez-Fernandez |
0f92db |
t_CheckExitStatus 0
|