From 4469e9b712b5509a6ae4c7e134dcf2881d4c0ba2 Mon Sep 17 00:00:00 2001 From: Mark Vejvoda Date: Wed, 12 Jun 2013 06:44:23 +0000 Subject: [PATCH] added profiler script --- mk/linux/mg_callgrind.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 mk/linux/mg_callgrind.sh diff --git a/mk/linux/mg_callgrind.sh b/mk/linux/mg_callgrind.sh new file mode 100755 index 000000000..cfac42d1e --- /dev/null +++ b/mk/linux/mg_callgrind.sh @@ -0,0 +1,18 @@ +#! /bin/sh +# Use this script to test performance while running MegaGlest +# ---------------------------------------------------------------------------- +# Written by Mark Vejvoda +# Copyright (c) 2011 Mark Vejvoda under GNU GPL v3.0+ + +exec 3>&1 +export GLIBCPP_FORCE_NEW=1 +export GLIBCXX_FORCE_NEW=1 +export G_SLICE=always-malloc + +exec valgrind --tool=callgrind \ + "$@" 2>&1 1>&3 3>&- | +sed 's/^==[0-9]*==/==/' >&2 1>&2 3>&- + +echo 'Look for a generated file called callgrind.out.x.' +echo 'You can then use kcachegrind tool to read this file.' +echo 'It will give you a graphical analysis of things with results like which lines cost how much.'