osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40588?usp=email )
Change subject: Cosmetic: testenv: tweak argparse formatting
......................................................................
Cosmetic: testenv: tweak argparse formatting
Make all "add_argument" calls consistently have one function argument in
one line, instead of only having it in some places, and have all
arguments in one line in others. Having one function arg in one line is
enforced via ruff format when having a comma at the end of the function
call.
Change-Id: Ia1804f0313a27ddf8f7197ce0b2ad3b56421b290
---
M _testenv/testenv/__init__.py
1 file changed, 31 insertions(+), 6 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/88/40588/1
diff --git a/_testenv/testenv/__init__.py b/_testenv/testenv/__init__.py
index 511ec58..f2f0321 100644
--- a/_testenv/testenv/__init__.py
+++ b/_testenv/testenv/__init__.py
@@ -73,7 +73,10 @@
sub_run = sub.add_parser("run", help="build components and run a testsuite")
group = sub_run.add_argument_group("testsuite options")
- group.add_argument("testsuite", help="a directory in osmo-ttcn3-hacks.git (msc, bsc, mgw, ...)")
+ group.add_argument(
+ "testsuite",
+ help="a directory in osmo-ttcn3-hacks.git (msc, bsc, mgw, ...)",
+ )
group.add_argument(
"-t",
"--test",
@@ -85,8 +88,17 @@
action="append",
help="which testenv.cfg to use (supports * wildcards via fnmatch)",
)
- group.add_argument("-i", "--io-uring", action="store_true", help="set LIBOSMO_IO_BACKEND=IO_URING")
- group.add_argument("-T", "--titan-version", help="which eclipse-titan version to use")
+ group.add_argument(
+ "-i",
+ "--io-uring",
+ action="store_true",
+ help="set LIBOSMO_IO_BACKEND=IO_URING",
+ )
+ group.add_argument(
+ "-T",
+ "--titan-version",
+ help="which eclipse-titan version to use",
+ )
group = sub_run.add_argument_group("source/binary options", "All components are built from source by default.")
group.add_argument(
@@ -147,10 +159,19 @@
" repository ending in :latest is set"
" or --latest is used.",
)
- group.add_argument("--latest", action="store_true", help="use latest configs")
+ group.add_argument(
+ "--latest",
+ action="store_true",
+ help="use latest configs",
+ )
group = sub_run.add_argument_group("podman options", "All components are run directly on the host by default.")
- group.add_argument("-p", "--podman", action="store_true", help="run all components inside podman")
+ group.add_argument(
+ "-p",
+ "--podman",
+ action="store_true",
+ help="run all components inside podman",
+ )
group.add_argument(
"-d",
"--distro",
@@ -165,7 +186,11 @@
)
group = sub_run.add_argument_group("output options")
- group.add_argument("-l", "--log-dir", help="log here instead of a random dir in /tmp")
+ group.add_argument(
+ "-l",
+ "--log-dir",
+ help="log here instead of a random dir in /tmp",
+ )
group.add_argument(
"-n",
"--no-tee",
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40588?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Ia1804f0313a27ddf8f7197ce0b2ad3b56421b290
Gerrit-Change-Number: 40588
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40589?usp=email )
Change subject: testenv: add run --asan
......................................................................
testenv: add run --asan
Add a new --asan option for building Osmocom libraries and programs from
source with address sanitizer enabled. This works by adding
sanitize.opts to osmo-dev's gen_makefile.py, which in turn adds
--enable-sanitize to most Osmocom projects.
The --autoreconf-in-src-copy argument for gen_makefile.py must be moved
up, so the list of *.opts files is not interrupted by another type of
argument that causes argument parsing to fail.
Suggested-by: Pau Espin Pedrol <pespin(a)sysmocom.de>
Related: https://gitea.osmocom.org/osmocom/osmo-dev/src/branch/master/sanitize.opts
Change-Id: I1947dd3a7d9ce51dcbef9cffd5d7b402f236b9e2
---
M _testenv/testenv/__init__.py
M _testenv/testenv/cmd.py
M _testenv/testenv/osmo_dev.py
3 files changed, 16 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/89/40589/1
diff --git a/_testenv/testenv/__init__.py b/_testenv/testenv/__init__.py
index f2f0321..3de7f0c 100644
--- a/_testenv/testenv/__init__.py
+++ b/_testenv/testenv/__init__.py
@@ -113,6 +113,12 @@
help="number of jobs to run simultaneously (default: nproc)",
type=int,
)
+ group.add_argument(
+ "-a",
+ "--asan",
+ action="store_true",
+ help="pass --enable-sanitize to Osmocom configure scripts",
+ )
group = sub_run.add_argument_group("exit options", "When and how testenv should exit when done.")
group = group.add_mutually_exclusive_group()
@@ -229,6 +235,11 @@
if args.action != "run":
return
+ if args.binary_repo and args.asan:
+ raise NoTraceException(
+ "--binary-repo cannot be used with --asan, consider using '--binary-repo osmocom:nightly:asan' instead"
+ )
+
if args.binary_repo and not args.podman:
raise NoTraceException("--binary-repo requires --podman")
diff --git a/_testenv/testenv/cmd.py b/_testenv/testenv/cmd.py
index d4a1e9a..e8598f0 100644
--- a/_testenv/testenv/cmd.py
+++ b/_testenv/testenv/cmd.py
@@ -56,6 +56,8 @@
else:
make_dir = os.path.join(testenv.args.cache, "host", "make")
make_dir += str(make_dir_version)
+ if testenv.args.asan:
+ make_dir += "-asan"
env_extra["OSMO_DEV_MAKE_DIR"] = make_dir
if testenv.args.kernel == "debian":
diff --git a/_testenv/testenv/osmo_dev.py b/_testenv/testenv/osmo_dev.py
index 45912ae..5852063 100644
--- a/_testenv/testenv/osmo_dev.py
+++ b/_testenv/testenv/osmo_dev.py
@@ -58,6 +58,8 @@
return
extra_opts = []
+ if testenv.args.asan:
+ extra_opts += ["sanitize.opts"]
if testenv.args.jobs:
extra_opts += [f"-j{testenv.args.jobs}"]
@@ -73,6 +75,7 @@
"--no-ldconfig",
"--src-dir",
testenv.src_dir,
+ "--autoreconf-in-src-copy",
"default.opts",
"ccache.opts",
"gtp_linux.opts",
@@ -85,7 +88,6 @@
"no_systemd.opts",
"werror.opts",
os.path.join(testenv.data_dir, "osmo-dev/testenv.opts"),
- "--autoreconf-in-src-copy",
] + extra_opts
cwd = get_osmo_dev_dir()
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40589?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I1947dd3a7d9ce51dcbef9cffd5d7b402f236b9e2
Gerrit-Change-Number: 40589
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Attention is currently required from: jolly.
pespin has posted comments on this change by jolly. ( https://gerrit.osmocom.org/c/libosmocore/+/40491?usp=email )
Change subject: Add multiple messages buffers to struct iofd_msghdr
......................................................................
Patch Set 3:
(1 comment)
Patchset:
PS3:
Maybe if this are partial steps, please ad something like [1/N], [2/N] at the end of each commit, to denote they should be merged/reverted together.
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/40491?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I4fb1067de4615cc22cc6caf99b481491e7f2ef92
Gerrit-Change-Number: 40491
Gerrit-PatchSet: 3
Gerrit-Owner: jolly <andreas(a)eversberg.eu>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: jolly <andreas(a)eversberg.eu>
Gerrit-Comment-Date: Fri, 04 Jul 2025 13:54:58 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Attention is currently required from: jolly.
pespin has posted comments on this change by jolly. ( https://gerrit.osmocom.org/c/libosmocore/+/40491?usp=email )
Change subject: Add multiple messages buffers to struct iofd_msghdr
......................................................................
Patch Set 3: Code-Review-1
(4 comments)
Patchset:
PS3:
I'm not sure I'm understanding this commit. You are adding arrays but only using the first one despite configuring the global variable to something != 1?
This shouldn't be submitted like this alone imho.
File src/core/osmo_io.c:
https://gerrit.osmocom.org/c/libosmocore/+/40491/comment/f5d41077_e8478105?… :
PS3, Line 165: hdr->msg_max = (g_io_backend == OSMO_IO_BACKEND_IO_URING) ? g_io_uring_iov : 1;
this info should be obtained from osmo_io_fd struct.
https://gerrit.osmocom.org/c/libosmocore/+/40491/comment/b77abd4b_03d9c085?… :
PS3, Line 406: struct msgb *msg = msghdr->msg[0];
why is this and below always [0]?
File src/core/osmo_io_internal.h:
https://gerrit.osmocom.org/c/libosmocore/+/40491/comment/b2a486b1_a188b6b3?… :
PS3, Line 140: int msg_max;
this field should probably be in struct osmo_iofd.
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/40491?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I4fb1067de4615cc22cc6caf99b481491e7f2ef92
Gerrit-Change-Number: 40491
Gerrit-PatchSet: 3
Gerrit-Owner: jolly <andreas(a)eversberg.eu>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: jolly <andreas(a)eversberg.eu>
Gerrit-Comment-Date: Fri, 04 Jul 2025 13:54:10 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Attention is currently required from: jolly.
pespin has posted comments on this change by jolly. ( https://gerrit.osmocom.org/c/libosmocore/+/40491?usp=email )
Change subject: Add multiple messages buffers to struct iofd_msghdr
......................................................................
Patch Set 3:
(1 comment)
File src/core/osmo_io_uring.c:
https://gerrit.osmocom.org/c/libosmocore/+/40491/comment/c32b5dec_2317b491?… :
PS3, Line 110: g_io_uring_iov = atoi(env);
afaict this is not some information which is needed really early in the startup of the program, before logging, etc. (the reason why we have an envvar to set the osmo_io backend), hence I think this new config shouldn't be an envvar, but rather some config to set using an API on a given osmo_iofd or similar, which then the app developer can tweak based on socket requirements.
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/40491?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I4fb1067de4615cc22cc6caf99b481491e7f2ef92
Gerrit-Change-Number: 40491
Gerrit-PatchSet: 3
Gerrit-Owner: jolly <andreas(a)eversberg.eu>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: jolly <andreas(a)eversberg.eu>
Gerrit-Comment-Date: Fri, 04 Jul 2025 13:49:11 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Attention is currently required from: jolly.
pespin has posted comments on this change by jolly. ( https://gerrit.osmocom.org/c/libosmocore/+/40584?usp=email )
Change subject: osmo-io: Append received message to pending message segment
......................................................................
Patch Set 1: Code-Review-1
(2 comments)
Commit Message:
https://gerrit.osmocom.org/c/libosmocore/+/40584/comment/035600be_08802272?… :
PS1, Line 9: If there is pending data of an incomplete segmented message, received
Would you mind rewriting this?
The way it is written makes it not really clear what the previous state was, what the patch changes, etc.
Specially since you say some stuff will be done in a later patch. So I'm not sure if you are breaking previously working stuff or what.
File src/core/osmo_io.c:
https://gerrit.osmocom.org/c/libosmocore/+/40584/comment/436bb2b9_175cb01d?… :
PS1, Line 303: msg_pending = iofd_msgb_alloc2(iofd, extra_len);
afaiu this is wrong. You are confusing the received_len with the size of the msgb.
What you'd want to pass here is, in the event that "expected_len > iofd->msgb_alloc.size" (which shouldn't happen imho, and in that case it would be a bug of the user of osmo_iodf when configuring it based on protocol expectancies):
iofd_msgb_alloc2(iofd, expected_len - iofd->msgb_alloc.size);
In any case, this would also break the assumption on the user that the msgbs obtained are of a certain configured length.
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/40584?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I08df9736ccc5e9a7df61ca6dcf94629ee010752f
Gerrit-Change-Number: 40584
Gerrit-PatchSet: 1
Gerrit-Owner: jolly <andreas(a)eversberg.eu>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: jolly <andreas(a)eversberg.eu>
Gerrit-Comment-Date: Fri, 04 Jul 2025 13:45:40 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Attention is currently required from: jolly.
pespin has posted comments on this change by jolly. ( https://gerrit.osmocom.org/c/libosmocore/+/40490?usp=email )
Change subject: Submit all SQEs to kernel if they don't fit in the io_uring
......................................................................
Patch Set 3: Code-Review-1
(1 comment)
File src/core/osmo_io_uring.c:
https://gerrit.osmocom.org/c/libosmocore/+/40490/comment/88a3ad63_028b3dfa?… :
PS3, Line 139: sqe = io_uring_get_sqe(&g_ring.ring);
I bet this can still probably return NULL since between call to io_uring_submit() and this line the kernel may not have had time to process any sqe in the queue.
hence probably the OSMO_ASSERT(sqe) below will potentially be false at some point.
Feel free to tell me I'm wrong, I'm just assuming the behavior/API here.
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/40490?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I476d9db285a1d257a4a5d43ee45ee0116c7d7009
Gerrit-Change-Number: 40490
Gerrit-PatchSet: 3
Gerrit-Owner: jolly <andreas(a)eversberg.eu>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: jolly <andreas(a)eversberg.eu>
Gerrit-Comment-Date: Fri, 04 Jul 2025 13:37:03 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Attention is currently required from: jolly.
pespin has posted comments on this change by jolly. ( https://gerrit.osmocom.org/c/libosmocore/+/40489?usp=email )
Change subject: Allow io_uring_submit batching just ahead of poll/select
......................................................................
Patch Set 1:
(1 comment)
Patchset:
PS1:
Several comments:
* Do we really want to have this configurable over envvar? what's the reasoning? to be able to temporarily spot failures and compare?
* It probably makes sense to change the patch to do the following, to avoid calling io_uring_submit() every loop iteration unconditionally:
* in rubmit_rx, submit_tx, etc, if we had to call io_uring_submit() then set some new global var "io_uring_submit_needed" to true.
* during the poll loop iteration, only call io_uring_submit() if the var was set to true, and set it to false again.
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/40489?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Id34fe2ced32c63d15b14810e145744f7509064cc
Gerrit-Change-Number: 40489
Gerrit-PatchSet: 1
Gerrit-Owner: jolly <andreas(a)eversberg.eu>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: laforge <laforge(a)osmocom.org>
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: jolly <andreas(a)eversberg.eu>
Gerrit-Comment-Date: Fri, 04 Jul 2025 13:34:28 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No