diff options
author | Pau Espin Pedrol <pespin@sysmocom.de> | 2020-05-12 22:32:24 +0200 |
---|---|---|
committer | pespin <pespin@sysmocom.de> | 2020-05-14 11:19:05 +0000 |
commit | a107f8f4966ecfe80aa2555c56c8790374fd59e9 (patch) | |
tree | 67462a478c1028eb90060509ab62f800eb7b9048 /src/tbf_ul.cpp | |
parent | 2338e5318eb899e6b8af5d36f18eedfbf4f4f646 (diff) |
bts: Drop specific functions to add values to counters
It's super annoying seeing lots of functions being called everywhere
only to find out they are only incrementing a counter. Let's drop all
those functions and increment the counter so people looking at code
doesn't see dozens of code paths evyerwhere.
Most of the commit was generated by following sh snippet:
"""
#!/bin/bash
define_pattern="^CREATE_COUNT_ADD_INLINE"
generic_func="do_rate_ctr_add"
grep -r -l "${define_pattern}" . | xargs cat | grep "${define_pattern}("| tr -d ",;" | tr "()" " " | awk '{ print $2 " " $3 }' >/tmp/hello
while read -r func_name ctr_name
do
#echo "$func_name -> $ctr_name";
files="$(grep -r -l "${func_name}(" .)"
for f in $files; do
echo "$f: $func_name -> $ctr_name";
sed -i "s#${func_name}(#${generic_func}(${ctr_name}, #g" $f
done;
done < /tmp/hello
grep -r -l "void ${generic_func}" | xargs sed -i "/void ${generic_func}(CTR/d"
grep -r -l "$define_pattern" | xargs sed -i "/$define_pattern/d"
"""
Change-Id: I966221d6f9fb9bb4f6068bf45ca2978008a0efed
Diffstat (limited to 'src/tbf_ul.cpp')
-rw-r--r-- | src/tbf_ul.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/tbf_ul.cpp b/src/tbf_ul.cpp index 90cbf8df..fee9919e 100644 --- a/src/tbf_ul.cpp +++ b/src/tbf_ul.cpp @@ -92,7 +92,7 @@ int gprs_rlcmac_ul_tbf::assemble_forward_llc(const gprs_rlc_data *_data) frame = frames + i; if (frame->length) { - bts->rlc_ul_payload_bytes(frame->length); + bts->do_rate_ctr_add(CTR_RLC_UL_PAYLOAD_BYTES, frame->length); LOGPTBFUL(this, LOGL_DEBUG, "Frame %d " "starts at offset %d, " @@ -108,7 +108,7 @@ int gprs_rlcmac_ul_tbf::assemble_forward_llc(const gprs_rlc_data *_data) /* send frame to SGSN */ LOGPTBFUL(this, LOGL_DEBUG, "complete UL frame len=%d\n", m_llc.frame_length()); snd_ul_ud(); - bts->llc_ul_bytes(m_llc.frame_length()); + bts->do_rate_ctr_add(CTR_LLC_UL_BYTES, m_llc.frame_length()); m_llc.reset(); } } |