bts: Drop specific functions to increase 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
grep -r -l ^CREATE_COUNT_INLINE . | xargs cat | grep "^CREATE_COUNT_INLINE("| 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}()#do_rate_ctr_inc(${ctr_name})#g" $f
done;
done < /tmp/hello
grep -r -l "void do_rate_ctr_inc" | xargs sed -i "/void do_rate_ctr_inc(CTR/d"
grep -r -l "CREATE_COUNT_INLINE" | xargs sed -i "/^CREATE_COUNT_INLINE/d"
"""
Change-Id: I360e322a30edf639aefb3c0f0e4354d98c9035a3
diff --git a/src/sba.cpp b/src/sba.cpp
index 32735e8..cc58405 100644
--- a/src/sba.cpp
+++ b/src/sba.cpp
@@ -86,7 +86,7 @@
sba->ta = ta;
llist_add(&sba->list, &m_sbas);
- m_bts.sba_allocated();
+ m_bts.do_rate_ctr_inc(CTR_SBA_ALLOCATED);
*_trx = trx;
*_ts = ts;
@@ -132,14 +132,14 @@
LOGP(DRLCMAC, LOGL_NOTICE,
"Poll timeout for SBA (TRX=%u, TS=%u, FN=%u, TA=%u)\n", sba->trx_no,
sba->ts_no, sba->fn, sba->ta);
- m_bts.sba_timedout();
+ m_bts.do_rate_ctr_inc(CTR_SBA_TIMEDOUT);
free_sba(sba);
return 0;
}
void SBAController::free_sba(gprs_rlcmac_sba *sba)
{
- m_bts.sba_freed();
+ m_bts.do_rate_ctr_inc(CTR_SBA_FREED);
llist_del(&sba->list);
talloc_free(sba);
}