repo.or.cz
/
notion.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Merge branch 'readme' of git://repo.or.cz/notion/jeffpc into readme
[notion.git]
/
utils
/
profiling
/
indent.pl
blob
88fab5773a2678921d2b333d9bbbe8d789f1466c
1
#!/usr/bin/perl
2
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'.
6
7
use
strict
;
8
9
my
$currentIndent
=
4
;
10
11
while
(<
STDIN
>) {
12
if
(
$_
=~
/^Enter/
) {
13
print
"
\t
"
x
$currentIndent
;
14
print
"
$_
"
;
15
16
$currentIndent
++;
17
}
else
{
18
$currentIndent
--;
19
}
20
}