0fb49c98fee3c55f6dd2805a30a4ee4c44145fa5
8 find $dirs -type f
-name '*.erl' -exec grep -Hn "\<$target_module\>:" '{}' \
; \
11 -F "${target_module}:" \
12 -v target_module
="$target_module" \
13 -v target_fun_regex
="$target_fun_regex" '
15 caller_module_file = $1
16 sub(":.*$", "", caller_module_file)
19 sub("\\(.*$", "", called_function)
21 if (called_function ~ /^[a-z][a-zA-Z_0-9]+$/) {
22 if (called_function ~ target_fun_regex) {
23 Calls[called_function]++
24 Calls_from[caller_module_file, called_function]++
25 Caller_modules[caller_module_file]++
29 "[WARN] skipped an invalid erlang function name. File: \"%s\", function: \"%s\", original line: \"%s\"\n", \
30 caller_module_file, called_function, $0 \
38 print "group-by-caller"
39 for (caller_module_file in Caller_modules) {
40 printf "%s%s\n", indent, caller_module_file;
41 for (cf in Calls_from) {
42 split(cf, call, SUBSEP);
43 if (call[1] == caller_module_file)
44 printf "%s%s %d\n", indent indent, call[2], Calls_from[cf] | "sort";
50 for (called_function in Calls)
51 printf "%s%s %d\n", indent, called_function, Calls[called_function] | "sort"
This page took 0.072025 seconds and 3 git commands to generate.