2010-02-20 20:09:24 +00:00
|
|
|
# This is _NOT_ the library release version, it's an API version.
|
2016-12-13 17:41:17 +00:00
|
|
|
# Please read chapter "Library interface versions" of the libtool documentation
|
|
|
|
# before making any modifications: https://www.gnu.org/software/libtool/manual/html_node/Versioning.html
|
2021-11-16 12:08:22 +00:00
|
|
|
LIBVERSION=18:0:0
|
2010-02-20 20:09:24 +00:00
|
|
|
|
2013-06-02 23:59:25 +00:00
|
|
|
AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include
|
2020-12-01 21:21:14 +00:00
|
|
|
AM_CFLAGS = -Wall $(TALLOC_CFLAGS) $(PTHREAD_CFLAGS) $(LIBSCTP_CFLAGS) $(LIBMNL_CFLAGS)
|
2010-02-20 20:09:24 +00:00
|
|
|
|
2017-05-15 19:37:34 +00:00
|
|
|
if ENABLE_PSEUDOTALLOC
|
|
|
|
AM_CPPFLAGS += -I$(top_srcdir)/src/pseudotalloc
|
|
|
|
endif
|
|
|
|
|
2010-02-20 20:09:24 +00:00
|
|
|
lib_LTLIBRARIES = libosmocore.la
|
|
|
|
|
2019-10-10 15:38:35 +00:00
|
|
|
libosmocore_la_LIBADD = $(BACKTRACE_LIB) $(TALLOC_LIBS) $(LIBRARY_RT) $(PTHREAD_LIBS) $(LIBSCTP_LIBS)
|
2019-03-18 16:17:43 +00:00
|
|
|
libosmocore_la_SOURCES = context.c timer.c timer_gettimeofday.c timer_clockgettime.c \
|
2018-02-26 18:42:22 +00:00
|
|
|
select.c signal.c msgb.c bits.c \
|
2017-10-15 17:46:19 +00:00
|
|
|
bitvec.c bitcomp.c counter.c fsm.c \
|
2011-05-21 16:54:32 +00:00
|
|
|
write_queue.c utils.c socket.c \
|
2016-12-02 14:30:02 +00:00
|
|
|
logging.c logging_syslog.c logging_gsmtap.c rate_ctr.c \
|
2011-03-23 17:08:08 +00:00
|
|
|
gsmtap_util.c crc16.c panic.c backtrace.c \
|
2013-02-21 05:16:29 +00:00
|
|
|
conv.c application.c rbtree.c strrb.c \
|
2014-08-18 17:03:40 +00:00
|
|
|
loggingrb.c crc8gen.c crc16gen.c crc32gen.c crc64gen.c \
|
2016-11-24 12:24:32 +00:00
|
|
|
macaddr.c stat_item.c stats.c stats_statsd.c prim.c \
|
2021-12-06 15:31:02 +00:00
|
|
|
stats_tcp.c \
|
2018-05-11 15:39:21 +00:00
|
|
|
conv_acc.c conv_acc_generic.c sercomm.c prbs.c \
|
add osmo_tdef API, originally adopted from osmo-bsc T_def
Move T_def from osmo-bsc to libosmocore as osmo_tdef. Adjust naming to be more
consistent. Upgrade to first class API:
- add timer grouping
- add generic vty support
- add mising API doc
- add C test
- add VTY transcript tests, also as examples for using the API
From osmo_fsm_inst_state_chg() API doc, cross reference to osmo_tdef API.
The root reason for moving to libosmocore is that I want to use the
mgw_endpoint_fsm in osmo-msc for inter-MSC handover, and hence want to move the
FSM to libosmo-mgcp-client. This FSM uses the T_def from osmo-bsc. Though the
mgw_endpoint_fsm's use of T_def is minimal, I intend to use the osmo_tdef API
in osmo-msc (and probably elsewhere) as well. libosmocore is the most sensible
place for this.
osmo_tdef provides:
- a list of Tnnnn (GSM) timers with description, unit and default value.
- vty UI to allow users to configure non-default timeouts.
- API to tie T timers to osmo_fsm states and set them on state transitions.
- a few standard units (minute, second, millisecond) as well as a custom unit
(which relies on the timer's human readable description to indicate the
meaning of the value).
- conversion for standard units: for example, some GSM timers are defined in
minutes, while our FSM definitions need timeouts in seconds. Conversion is
for convenience only and can be easily avoided via the custom unit.
By keeping separate osmo_tdef arrays, several groups of timers can be kept
separately. The VTY tests in tests/tdef/ showcase different schemes:
- tests/vty/tdef_vty_test_config_root.c:
Keep several timer definitions in separately named groups: showcase the
osmo_tdef_vty_groups*() API. Each timer group exists exactly once.
- tests/vty/tdef_vty_test_config_subnode.c:
Keep a single list of timers without separate grouping.
Put this list on a specific subnode below the CONFIG_NODE.
There could be several separate subnodes with timers like this, i.e.
continuing from this example, sets timers could be separated by placing
timers in specific config subnodes instead of using the global group name.
- tests/vty/tdef_vty_test_dynamic.c:
Dynamically allocate timer definitions per each new created object.
Thus there can be an arbitrary number of independent timer definitions, one
per allocated object.
T_def was introduced during the recent osmo-bsc refactoring for inter-BSC
handover, and has proven useful:
- without osmo_tdef, each invocation of osmo_fsm_inst_state_chg() needs to be
programmed with the right timeout value, for all code paths that invoke this
state change. It is a likely source of errors to get one of them wrong. By
defining a T timer exactly for an FSM state, the caller can merely invoke the
state change and trust on the original state definition to apply the correct
timeout.
- it is helpful to have a standardized config file UI to provide user
configurable timeouts, instead of inventing new VTY commands for each
separate application of T timer numbers.
Change-Id: Ibd6b1ed7f1bd6e1f2e0fde53352055a4468f23e5
2019-01-26 19:36:12 +00:00
|
|
|
isdnhdlc.c \
|
2019-02-25 01:45:06 +00:00
|
|
|
tdef.c \
|
2021-02-17 16:46:02 +00:00
|
|
|
thread.c \
|
2021-11-13 22:19:33 +00:00
|
|
|
time_cc.c \
|
2019-02-25 01:45:06 +00:00
|
|
|
sockaddr_str.c \
|
2019-02-11 19:32:25 +00:00
|
|
|
use_count.c \
|
2019-12-16 22:14:45 +00:00
|
|
|
exec.c \
|
2019-08-06 17:56:16 +00:00
|
|
|
it_q.c \
|
2020-09-26 09:51:32 +00:00
|
|
|
probes.d \
|
2021-09-17 06:35:32 +00:00
|
|
|
base64.c \
|
2019-02-25 01:45:06 +00:00
|
|
|
$(NULL)
|
2010-06-30 17:43:11 +00:00
|
|
|
|
2017-11-17 10:41:34 +00:00
|
|
|
if HAVE_SSSE3
|
2017-06-19 10:59:48 +00:00
|
|
|
libosmocore_la_SOURCES += conv_acc_sse.c
|
2017-05-28 11:20:02 +00:00
|
|
|
if HAVE_SSE4_1
|
2017-11-17 10:41:34 +00:00
|
|
|
conv_acc_sse.lo : AM_CFLAGS += -mssse3 -msse4.1
|
2017-05-28 11:20:02 +00:00
|
|
|
else
|
2017-11-17 10:41:34 +00:00
|
|
|
conv_acc_sse.lo : AM_CFLAGS += -mssse3
|
2017-05-28 11:20:02 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
if HAVE_AVX2
|
2017-06-19 10:59:48 +00:00
|
|
|
libosmocore_la_SOURCES += conv_acc_sse_avx.c
|
2017-05-28 11:20:02 +00:00
|
|
|
if HAVE_SSE4_1
|
2017-11-17 10:41:34 +00:00
|
|
|
conv_acc_sse_avx.lo : AM_CFLAGS += -mssse3 -mavx2 -msse4.1
|
2017-05-28 11:20:02 +00:00
|
|
|
else
|
2017-11-17 10:41:34 +00:00
|
|
|
conv_acc_sse_avx.lo : AM_CFLAGS += -mssse3 -mavx2
|
2017-05-28 11:20:02 +00:00
|
|
|
endif
|
|
|
|
endif
|
2017-04-28 17:16:43 +00:00
|
|
|
endif
|
|
|
|
|
2020-07-23 00:16:46 +00:00
|
|
|
if HAVE_NEON
|
|
|
|
libosmocore_la_SOURCES += conv_acc_neon.c
|
|
|
|
# conv_acc_neon.lo : AM_CFLAGS += -mfpu=neon no, could as well be vfp with neon
|
|
|
|
endif
|
|
|
|
|
2012-06-29 20:01:21 +00:00
|
|
|
BUILT_SOURCES = crc8gen.c crc16gen.c crc32gen.c crc64gen.c
|
refactor stat_item: get rid of FIFO and "skipped" error
Intead of attempting to store all distinct values of a reporting period,
just store min, max, last as well as a sum and N of each reporting
period.
This gets rid of error messages like
DLSTATS ERROR stat_item.c:285 num_bts:oml_connected: 44 stats values skipped
while at the same time more accurately reporting the max value for each
reporting period. (So far stats_item only reports the max value; keep
that part unchanged, as shown in stats_test.c.)
With the other so far unused values (min, sum), we are ready to also
report the minimum value as well as an average value per reporting
period in the future, if/when our stats reporter allows for it.
Store the complete record of the previous reporting period. So far we
only compare the 'max' value, but like this we are ready to also see
changes in min, last and average value between reporting periods.
This patch breaks API by removing:
- struct members osmo_stats_item.stats_next_id, .last_offs and .values[]
- struct osmo_stats_item_value
- osmo_stat_item_get_next()
- osmo_stat_item_discard()
- osmo_stat_item_discard_all()
and by making struct osmo_stats_item opaque.
In libosmocore, we do have a policy of never breaking API. But since the
above should never be accessed by users of the osmo_stats_item API -- or
if they are, would no longer yield useful results, we decided to make an
exception in this case. The alternative would be to introduce a new
osmo_stats_item2 API and maintaining an unused legacy osmo_stats_item
forever, but we decided that the effort is not worth it. There are no
known users of the removed items.
Related: SYS#5542
Change-Id: I137992a5479fc39bbceb6c6c2af9c227bd33b39b
2021-09-14 12:37:38 +00:00
|
|
|
|
|
|
|
EXTRA_DIST = \
|
|
|
|
conv_acc_sse_impl.h \
|
|
|
|
conv_acc_neon_impl.h \
|
|
|
|
crcXXgen.c.tpl \
|
|
|
|
stat_item_internal.h \
|
|
|
|
$(NULL)
|
2012-06-29 20:01:21 +00:00
|
|
|
|
2017-10-30 12:19:58 +00:00
|
|
|
libosmocore_la_LDFLAGS = -version-info $(LIBVERSION) -no-undefined
|
|
|
|
|
2010-06-30 17:43:11 +00:00
|
|
|
if ENABLE_PLUGIN
|
|
|
|
libosmocore_la_SOURCES += plugin.c
|
2018-05-04 17:21:58 +00:00
|
|
|
libosmocore_la_LIBADD += $(LIBRARY_DLOPEN)
|
2010-03-07 19:24:30 +00:00
|
|
|
endif
|
2010-10-06 16:00:15 +00:00
|
|
|
|
|
|
|
if ENABLE_MSGFILE
|
|
|
|
libosmocore_la_SOURCES += msgfile.c
|
|
|
|
endif
|
2011-09-02 20:18:24 +00:00
|
|
|
|
|
|
|
if ENABLE_SERIAL
|
|
|
|
libosmocore_la_SOURCES += serial.c
|
|
|
|
endif
|
2011-09-16 20:59:18 +00:00
|
|
|
|
logging: introduce 'systemd-journal' target
This change implements 'systemd-journal' logging target, that is
similar to the existing 'syslog' target. The key difference is
that 'systemd-journal' allows us to offload rendering of the meta
information, such as location (file name, line number), subsystem,
and logging level, to systemd. Moreover, we can attach arbitrary,
user-specific fields [1] to the logging messages, so they can be
used for advanced log filtering (e.g. by IMSI/TMSI/TLLI):
$ journalctl OSMO_SUBSYS=DMSC -f
Since we don't want to make libsystemd a required dependency, this
feature is optional, and needs to be enabled at build-time:
$ ./configure --enable-systemd-logging
The new logging target can be configured in the same way as any
other one - via the VTY interface, or using the configuration file:
log systemd-journal [raw]
logging level set-all notice
logging filter all 1
Two logging handlers are available: generic and raw. The first one
behaves similarly to both 'syslog' and 'stderr', i.e. all the meta
information is rendered by libosmocore itself, and then passed to
systemd together with the logging message. The later is more like
the 'gsmtap' target, so all available meta information is handed
over to systemd in form of fields [1]:
- CODE_FILE / CODE_LINE - location info,
- PRIORITY - syslog-compatible logging level,
- OSMO_SUBSYS - Osmocom-specific sub-system (e.g. DMSC),
- OSMO_SUBSYS_HEX - same as OSMO_SUBSYS, but encoded in hex,
- MESSAGE - the logging message itself,
and then can be rendered in any supported format (e.g. JSON).
More details about the API can be found in [2].
[1] https://www.freedesktop.org/software/systemd/man/systemd.journal-fields.html
[2] https://www.freedesktop.org/software/systemd/man/sd-journal.html
Change-Id: I609f5cf438e6ad9038d8fc95f00add6aac29fb23
2020-09-08 20:36:48 +00:00
|
|
|
if ENABLE_SYSTEMD_LOGGING
|
|
|
|
libosmocore_la_SOURCES += logging_systemd.c
|
|
|
|
libosmocore_la_LIBADD += $(SYSTEMD_LIBS)
|
|
|
|
endif
|
|
|
|
|
2020-12-01 21:21:14 +00:00
|
|
|
if ENABLE_LIBMNL
|
|
|
|
libosmocore_la_SOURCES += mnl.c
|
|
|
|
libosmocore_la_LIBADD += $(LIBMNL_LIBS)
|
|
|
|
endif
|
|
|
|
|
2020-09-26 09:51:32 +00:00
|
|
|
if ENABLE_SYSTEMTAP
|
|
|
|
probes.h: probes.d
|
|
|
|
$(DTRACE) -C -h -s $< -o $@
|
|
|
|
|
|
|
|
probes.lo: probes.d
|
|
|
|
$(LIBTOOL) --mode=compile $(AM_V_lt) --tag=CC env CFLAGS="$(CFLAGS)" $(DTRACE) -C -G -s $< -o $@
|
|
|
|
|
|
|
|
BUILT_SOURCES += probes.h probes.lo
|
|
|
|
libosmocore_la_LIBADD += probes.lo
|
|
|
|
endif
|
|
|
|
|
2011-09-16 20:59:18 +00:00
|
|
|
crc%gen.c: crcXXgen.c.tpl
|
2012-06-29 20:01:20 +00:00
|
|
|
$(AM_V_GEN)sed -e's/XX/$*/g' $< > $@
|