Xhprof + PHP5.4 + Ubuntu + Chamilo 1.10dev

(Read the update below before starting to copy-paste) To install Xhprof on PHP5.4 on Ubuntu (assuming you've already got PHP5.4 from Andrej or somewhere safe) in order to measure the load of Chamilo 1.10 dev (you need to have a mercurial clone, otherwise the "tests" directory will not exist), follow this procedure (all lines prefixed with # are comments):
cd /tmp
sudo apt-get install php5-dev php-pear
pecl bundle xhprof
cd xhprof
# Here you will have to apply the patch mentioned here: https://bugs.php.net/bug.php?id=61674 to your extension/xhprof.c file (otherwise it won't compile