|
Carlos Rodriguez-Fernandez |
5305f8 |
#!/bin/bash
|
|
Carlos Rodriguez-Fernandez |
5305f8 |
# Author: Carlos Rodriguez-Fernandez <carlosrodrifernandez@gmail.com>
|
|
Carlos Rodriguez-Fernandez |
5305f8 |
|
|
Carlos Rodriguez-Fernandez |
5305f8 |
t_Log "Running $0 - perf tests"
|
|
Carlos Rodriguez-Fernandez |
5305f8 |
|
|
Carlos Rodriguez-Fernandez |
5305f8 |
tests_in_order=(
|
|
Carlos Rodriguez-Fernandez |
5305f8 |
"perf version"
|
|
Carlos Rodriguez-Fernandez |
5305f8 |
"perf record -F 49 -a -g -- sleep 1"
|
|
Carlos Rodriguez-Fernandez |
5305f8 |
"perf report --stdio > /dev/null 2>&1"
|
|
Carlos Rodriguez-Fernandez |
5305f8 |
)
|
|
Carlos Rodriguez-Fernandez |
5305f8 |
|
|
Carlos Rodriguez-Fernandez |
5305f8 |
for cmd in "${tests_in_order[@]}"; do
|
|
Carlos Rodriguez-Fernandez |
5305f8 |
t_Log "Running $0 - perf test: ${cmd}"
|
|
Carlos Rodriguez-Fernandez |
5305f8 |
if ! eval "${cmd}" > /dev/null 2>&1; then
|
|
Carlos Rodriguez-Fernandez |
5305f8 |
t_Log "FAIL: $0: perf test: ${cmd}"
|
|
Carlos Rodriguez-Fernandez |
5305f8 |
exit 1
|
|
Carlos Rodriguez-Fernandez |
5305f8 |
else
|
|
Carlos Rodriguez-Fernandez |
5305f8 |
t_Log "PASS: $0: perf test: ${cmd}"
|
|
Carlos Rodriguez-Fernandez |
5305f8 |
fi
|
|
Carlos Rodriguez-Fernandez |
5305f8 |
done
|
|
Carlos Rodriguez-Fernandez |
5305f8 |
|
|
Carlos Rodriguez-Fernandez |
5305f8 |
t_Log "Cleaning up $0 - perf tests data"
|
|
Carlos Rodriguez-Fernandez |
5305f8 |
rm -f perf.data
|