summaryrefslogtreecommitdiffstats
path: root/test/profile-history.sh
blob: 02831f808dbfed6eafa8bf7ae81d3e82de7fbc00 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/sh

case $1 in
	cumulative)
		python -c "import pstats; s = pstats.Stats(\"$2\"); s.sort_stats(\"cumulative\").print_stats()" | less
		;;
	time)
		python -c "import pstats; s = pstats.Stats(\"$2\"); s.sort_stats(\"time\").print_stats()" | less
		;;
	timecum)
		python -c "import pstats; s = pstats.Stats(\"$2\"); s.sort_stats(\"time\", \"cum\").print_stats()" | less
		;;
	callers)
		python -c "import pstats; s = pstats.Stats(\"$2\"); s.print_callers(.5, \"$3\")" | less
		;;
	verbose)
		PYTHONPATH=. ./crm -X "$2" -H "$3" history log
		;;
	*)
		PYTHONPATH=. ./crm -X "$1" -H "$2" history log >/dev/null
		;;
esac