Commit Graph

10 Commits

Author SHA1 Message Date
Pau Espin 88955fb550 Fix all references to config.h
config.h is created in $(top_buildir)/config.h.
Let's make sure all CPPFLAGS add correct -Ipath includes,
and that all code includes the correct file.

Change-Id: Ie9ea38bb009bc715b01cde4d66d181f7bec2e7bd
2023-01-18 19:04:36 +01:00
Harald Welte e61d459cef Support building with -Werror=strict-prototypes / -Werror=old-style-definition
Unfortunately "-std=c99" is not sufficient to make gcc ignore code that
uses constructs of earlier C standards, which were abandoned in C99.

See https://lwn.net/ml/fedora-devel/Y1kvF35WozzGBpc8@redhat.com/ for
some related discussion.

Change-Id: I84fd99442d0cc400fa562fa33623c142649230e2
2022-11-03 12:44:28 +01:00
Harald Welte c17546faff vty: Support platforms that don't support pthread_getname_np()
pthread_getname_np() is a non-portable extension of pthreads.  While
it exists in glibc, for example musl didn't have it until rather
recently (April 2021) and there still hasn't yet been a musl release
with this change, resulting even current OpenWRT not yet supporting
pthread_getname_np.

So let's check if pthread_getname_np is supported, and only use it
in that case.

Change-Id: Ibd01485af24e2fe574006f8d049bf37226dda966
2022-03-29 12:58:01 +00:00
Neels Hofmeyr 34907fe6e1 revisit some calls of strtol(), stroul(), strtoull()
Replace some with atoi(), where the VTY has already validated correct
range of the argument.

Replace others with the new osmo_str_to_int() or osmo_str_to_int64()
functions, possibly covering more detection of invalid number strings.

Leave those strtol() callers that depend on endptr to provide the next
string token.

Related: SYS#5542
Change-Id: I0ebb06e751c28f7d1cdf328de29cd227a2449391
2021-10-04 11:24:59 +00:00
Pau Espin 64c67bb088 vty: Mark cpu_sched_vty commands with attr immediate
Change-Id: I85c80376c13c7dddf34dadd2a6c09caf23fd70ce
2020-11-09 11:24:21 +01:00
Vadim Yanitskiy 8e7c49649e vty: use install_lib_element() and install_lib_element_ve()
See https://lists.osmocom.org/pipermail/openbsc/2020-October/013278.html.

Change-Id: Ic541126ffd4975daf87199abfafb465e2055e44f
Related: SYS#4937
2020-10-06 00:22:22 +07:00
Vadim Yanitskiy e0ed147984 vty: fix 'Unsigned compared against 0' generate_cpu_hex_mask()
Change-Id: I49549439d5bbfbb83954ba92957304b03062d003
Fixes: CID#212137
2020-09-11 20:14:34 +07:00
Pau Espin 62be97e89d vty: Fix cpu-sched VTY node name
Durin dev cycle, node was initially called "sched" instead of
"cpu-sched", and when it was renamed, this specific part was missed.

Change-Id: I0709fee12cc8ddc4d57efb4ea40b0b79b7ea4151
2020-08-20 08:40:30 +00:00
Eric Wild dde327275c vty cpu sched: do not assert if sched impossible
Shared code might be used by applications that have no vty, so sched
can't be initialized, do not assert and break everything in this case, a
warning should suffice.

Change-Id: Ic40075df8d4cf9fe8f1d711f899dae9a4b5b0928
2020-08-17 10:14:27 +00:00
Pau Espin eb6882fa52 vty: Introduce support to set cpu-affinity and scheduler policy
Process willing to support this kind of configuration through VTY simply
need to call "osmo_sched_vty_init(tall_ctx);" during startup to register
the commands.
For multithreaded processes, new threads willing to get their
cpu-affinity mask according to VTY config should call
osmo_sched_vty_apply_localthread() (potentially after
setting the thread name through pthread_setname_np()).

Related: SYS#4986
Change-Id: If76a4bd2cc7b3c7adf5d84790a944d78be70e10a
2020-08-10 14:11:18 +00:00