Merge branch 'readme' of git://repo.or.cz/notion/jeffpc into readme
[notion.git] / utils / profiling / indent.pl
blob88fab5773a2678921d2b333d9bbbe8d789f1466c
1 #!/usr/bin/perl
3 # Take the output of addr2line.sh, select only the 'Enter' calls and indent
4 # them to show the call hierarchy. The result can be browsed for example with
5 # vim and ':set foldmethod=indent'.
7 use strict;
9 my $currentIndent = 4;
11 while (<STDIN>) {
12 if ($_ =~ /^Enter/) {
13 print "\t" x $currentIndent ;
14 print "$_";
16 $currentIndent++;
17 } else {
18 $currentIndent--;