home
/
code
/
khome.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
c10264d
)
Sort calls by frequency
author
Siraaj Khandkar
<siraaj@khandkar.net>
Wed, 3 Mar 2021 16:49:31 +0000
(11:49 -0500)
committer
Siraaj Khandkar
<siraaj@khandkar.net>
Wed, 3 Mar 2021 16:49:31 +0000
(11:49 -0500)
home/bin/erlcode-find-calls
patch
|
blob
|
blame
|
history
diff --git
a/home/bin/erlcode-find-calls
b/home/bin/erlcode-find-calls
index
0fb49c9
..
ad1884e
100755
(executable)
--- a/
home/bin/erlcode-find-calls
+++ b/
home/bin/erlcode-find-calls
@@
-38,16
+38,18
@@
find $dirs -type f -name '*.erl' -exec grep -Hn "\<$target_module\>:" '{}' \; \
print "group-by-caller"
for (caller_module_file in Caller_modules) {
printf "%s%s\n", indent, caller_module_file;
print "group-by-caller"
for (caller_module_file in Caller_modules) {
printf "%s%s\n", indent, caller_module_file;
+ sort = "sort -n -k 2 -r | column -t | sed \"s/^/" indent indent "/\""
for (cf in Calls_from) {
split(cf, call, SUBSEP);
if (call[1] == caller_module_file)
for (cf in Calls_from) {
split(cf, call, SUBSEP);
if (call[1] == caller_module_file)
- printf "%s
%s %d\n", indent indent, call[2], Calls_from[cf] | "sort"
;
+ printf "%s
%d\n", call[2], Calls_from[cf] | sort
;
}
}
- close(
"sort"
)
+ close(
sort
)
}
print "all"
}
print "all"
+ sort = "sort -n -k 2 -r | column -t | sed \"s/^/" indent "/\""
for (called_function in Calls)
for (called_function in Calls)
- printf "%s
%s %d\n", indent, called_function, Calls[called_function] | "sort"
- close(
"sort"
)
+ printf "%s
%d\n", called_function, Calls[called_function] | sort
+ close(
sort
)
}'
}'
This page took
0.034032 seconds
and
4
git commands to generate.