OILS / benchmarks / callgrind.sh View on Github | oilshell.org

36 lines, 20 significant
1#!/usr/bin/env bash
2#
3# Usage:
4# benchmarks/callgrind.sh <function name>
5
6set -o nounset
7set -o pipefail
8set -o errexit
9
10fib() {
11 # Hm dbg build seems to give more exact info
12 local osh=_bin/cxx-dbg/osh
13 #local osh=_bin/cxx-opt/osh
14
15 ninja $osh
16
17 valgrind --tool=callgrind \
18 $osh benchmarks/compute/fib.sh 10 44
19}
20
21with-callgrind() {
22 local out_file=$1 # Ignored for now, same interface as with-cachegrind
23 shift
24
25 valgrind --tool=callgrind \
26 "$@"
27}
28
29install-kcachegrind() {
30 sudo apt-get install kcachegrind
31}
32
33file=$(basename $0)
34if test $file = 'callgrind.sh'; then
35 "$@"
36fi