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

47 lines, 26 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
10build-and-run() {
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 "$@"
19}
20
21fib() {
22 build-and-run benchmarks/compute/fib.sh 10 44
23}
24
25parse-cpython-configure() {
26 # Goal: eliminate string slicing in this workload! It should just be
27 # creating fixed size Tokens, syntax.asdl nodes, and List<T>
28
29 build-and-run -n --ast-format none Python-2.7.13/configure
30}
31
32with-callgrind() {
33 local out_file=$1 # Ignored for now, same interface as with-cachegrind
34 shift
35
36 valgrind --tool=callgrind \
37 "$@"
38}
39
40install-kcachegrind() {
41 sudo apt-get install kcachegrind
42}
43
44file=$(basename $0)
45if test $file = 'callgrind.sh'; then
46 "$@"
47fi