diff options
author | Neels Hofmeyr <neels@hofmeyr.de> | 2019-02-11 20:32:25 +0100 |
---|---|---|
committer | Neels Hofmeyr <nhofmeyr@sysmocom.de> | 2019-04-08 13:47:17 +0000 |
commit | 0e8df1c7e48bcae2285c7c138bd50f932049bd24 (patch) | |
tree | ebc61be55958db4925f412bfb55906cf100d94eb /tests/Makefile.am | |
parent | 0c7826e9bd8026b239d320dba49416fd603f17fd (diff) |
add osmo_use_count API
Provide a common implementation of use counting that supports naming each user
as well as counting more than just one use per user, depending on the rules the
caller implies.
In osmo-msc, we were originally using a simple int counter to see whether a
connection is still in use or should be discarded. For clarity, we later added
names to each user in the form of a bitmask of flags, to figure out exactly
which users are still active: for logging and to debug double get / double put
bugs. This however is still not adequate, since there may be more than one CM
Service Request pending. Also, it is a specialized implementation that is not
re-usable.
With this generalized implementation, we can:
- fix the problem of inadequate counting of multiple concurrent CM Service
Requests (more than one use count per user category),
- directly use arbitrary names for uses like __func__ or "foo" (no need to
define enums and value_string[]s),
- re-use the same code for e.g. vlr_subscr and get fairly detailed VLR
susbscriber usage logging for free.
Change-Id: Ife31e6798b4e728a23913179e346552a7dd338c0
Diffstat (limited to 'tests/Makefile.am')
-rw-r--r-- | tests/Makefile.am | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am index 88bcd7e9..d123ee2a 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -31,6 +31,7 @@ check_PROGRAMS = timer/timer_test sms/sms_test ussd/ussd_test \ tdef/tdef_vty_test_config_subnode \ tdef/tdef_vty_test_dynamic \ sockaddr_str/sockaddr_str_test \ + use_count/use_count_test \ $(NULL) if ENABLE_MSGFILE @@ -240,6 +241,9 @@ tdef_tdef_vty_test_dynamic_LDADD = $(LDADD) $(top_builddir)/src/vty/libosmovty.l sockaddr_str_sockaddr_str_test_SOURCES = sockaddr_str/sockaddr_str_test.c sockaddr_str_sockaddr_str_test_LDADD = $(LDADD) +use_count_use_count_test_SOURCES = use_count/use_count_test.c +use_count_use_count_test_LDADD = $(LDADD) + # The `:;' works around a Bash 3.2 bug when the output is not writeable. $(srcdir)/package.m4: $(top_srcdir)/configure.ac :;{ \ @@ -309,6 +313,7 @@ EXTRA_DIST = testsuite.at $(srcdir)/package.m4 $(TESTSUITE) \ tdef/tdef_vty_test_config_subnode.vty \ tdef/tdef_vty_test_dynamic.vty \ sockaddr_str/sockaddr_str_test.ok \ + use_count/use_count_test.ok use_count/use_count_test.err \ $(NULL) DISTCLEANFILES = atconfig atlocal conv/gsm0503_test_vectors.c |