| #!/bin/bash |
| echo "filename,LN,API,CLS,MSG" |
| item2_array=( "kal_trace" "kal_critical_trace" "kal_brief_trace" "kal_brief_trace_macro" "kal_critical_brief_trace" "_kal_trace" "_kal_brief_trace" "kal_trace_for_3rd_party" "kal_lib_trace" "kal_assert_trace" "kal_critical_assert_trace" "kal_wap_trace" "kal_buffer_trace" "kal_dev_trace" "kal_bootup_trace" "kal_brief_trace_opt_helper" "kal_trace_macro") |
| for i in "${item2_array[@]}" |
| do |
| awk_cmd="awk 'match(\$0, /(${i})\\s*\\((\\w+)\\s*,\\s*(\\w+)/, g) {print FILENAME \",\" NR \",\" g[1] \",\" g[2] \",\" g[3]}'" |
| find_cmd="find . -name *.c -exec ${awk_cmd} {} \;" |
| eval $find_cmd |
| done |
| item3_array=( "dhl_trace" "dhl_brief_trace" "dhl_raw_trace" "dhl_brief_trace_opt_helper") |
| for i in "${item3_array[@]}" |
| do |
| awk_cmd="awk 'match(\$0, /(${i})\\s*\\((\\w+)\\s*,\\s*(\\w+)\\s*,\\s*(\\w+)/, g) {print FILENAME \",\" NR \",\" g[1] \",\" g[2] \",\" g[4]}'" |
| find_cmd="find . -name *.c -exec ${awk_cmd} {} \;" |
| eval $find_cmd |
| done |
| item4_array=( "dhl_internal_trace" "dhl_peer_trace" ) |
| for i in "${item4_array[@]}" |
| do |
| awk_cmd="awk 'match(\$0, /(${i})\\s*\((\\w+)\\s*,\\s*(\\w+)\\s*,\\s*(\\w+)\\s*,\\s*(\\w+)/, g) {print FILENAME \",\" NR \",\" g[1] \",\" g[2] \",\" g[5]}'" |
| find_cmd="find . -name *.c -exec ${awk_cmd} {} \;" |
| eval $find_cmd |
| done |