Skip to content

Improve E3 logging: errno on failure + configurable, uid-namespaced log path#33

Merged
Thecave3 merged 4 commits into
mainfrom
improve-logs
Jun 25, 2026
Merged

Improve E3 logging: errno on failure + configurable, uid-namespaced log path#33
Thecave3 merged 4 commits into
mainfrom
improve-logs

Conversation

@Thecave3

Copy link
Copy Markdown
Collaborator

Summary

Two logging improvements, motivated by a real failure: a root gNB could not open /tmp/e3_agent.log and the logger gave no reason. Root cause was fs.protected_regular=2 — in sticky world-writable /tmp, an O_CREAT open of a regular file is denied (even for root) unless the file is owned by the opener or by /tmp's owner. The log had been left owned by a prior non-sudo run, so the root gNB's fopen(..., "a") got EACCES.

Changes

  • add better error logging — the logger now reports strerror(errno) + errno on a failed open, instead of a bare "Failed to open log file".
  • feat: make log file path configurable with uid-namespaced default
    • Add E3Config::log_path (and log_path to the C e3_config_t) so callers can redirect the shared log file explicitly. Empty / NULL = auto.
    • When empty, derive /tmp/e3_<role>[_<sanitized-id>]_<euid>.log. The trailing effective uid keeps the file owned by whoever opens it, so the fs.protected_regular wedge cannot recur regardless of running as root or as a user. The <id> (ran_identifier for RAN, dapp_name for DAPP, sanitized to [A-Za-z0-9._-], omitted when empty) disambiguates multiple instances on one host.

Examples

  • root gNB, ran_identifier="DU-1"/tmp/e3_agent_DU-1_0.log
  • user dApp → /tmp/e3_dapp_libe3-dapp_1000.log

Notes / follow-ups

  • Backward compatible: existing callers that don't set log_path just get the new auto path instead of the fixed /tmp/e3_agent.log / /tmp/e3_dapp.log.
  • Builds clean (liblibe3).
  • Follow-up (separate, OAI side): read a log_path from the gNB conf and pass it through to E3Config.

Thecave3 added 2 commits June 17, 2026 11:46
Add E3Config::log_path (and log_path to the C e3_config_t) so callers can
redirect the shared log file explicitly. When left empty, derive a default
of the form /tmp/e3_<role>[_<sanitized-id>]_<euid>.log.

The trailing effective-uid keeps the file owned by whoever opens it, which
avoids fs.protected_regular=2 blocking an O_CREAT re-open of a /tmp file
owned by a different user (e.g. a root gNB unable to reopen a log left by a
prior non-sudo run). The sanitized role identifier (ran_identifier for RAN,
dapp_name for DAPP) disambiguates multiple instances on one host.
@github-actions

github-actions Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

⏱️ Full-loop Latency Benchmark (commit 70fd2b5)

Full-loop latency benchmark (N=1024 after 50 warmup)

All values in microseconds (us). Link: zmq, transport: ipc, encoding: ASN.1 APER.

Phase mean p50 p99 max
1. Collect indication data 0 0 0 1
2. Create & encode indication 0 0 1 8
3. Deliver indication (RAN -> dApp) 94 90 171 725
4. Decode indication 0 0 1 42
5. Process data 0 0 0 0
6. Create & encode control 0 0 0 9
7. Deliver control (dApp -> RAN) 111 113 180 997
8. Decode & handle control 0 0 1 17
Total round-trip 207 195 331 1522

Benchmarked on ubuntu-latest, Release build, ZMQ + IPC, ASN.1 APER.

@github-actions

github-actions Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

🔀 E2E Topologies — multi-dApp / multi-RAN (commit 70fd2b5)

zmq/ipc

  • 1 RAN - 1 dApp: indications=5
    • dapp peer=t11 ran=ran-solo sub=1 indications=5 seq=[0..4] dropped=0 (0%) age_ms(avg=0 max=0 @seq=0) hist[<=1:5 2-5:0 6-10:0 >10:0]
  • 1 RAN - 2 dApps: dApp#1 ind=5 sub=1, dApp#2 ind=6 sub=2, RAN saw 2 dApps
    • dapp1 peer=t12 ran=ran-shared sub=1 indications=5 seq=[0..4] dropped=0 (0%) age_ms(avg=0 max=0 @seq=0) hist[<=1:5 2-5:0 6-10:0 >10:0]
    • dapp2 peer=t12 ran=ran-shared sub=2 indications=6 seq=[0..5] dropped=0 (0%) age_ms(avg=0 max=0 @seq=0) hist[<=1:6 2-5:0 6-10:0 >10:0]
  • 2 RANs - 1 dApp: from ran-a ind=5, from ran-b ind=5
    • dapp peer=t2a ran=ran-a sub=1 indications=5 seq=[0..4] dropped=0 (0%) age_ms(avg=0.6 max=1 @seq=2) hist[<=1:5 2-5:0 6-10:0 >10:0]
    • dapp peer=t2b ran=ran-b sub=1 indications=5 seq=[0..4] dropped=0 (0%) age_ms(avg=0.4 max=1 @seq=2) hist[<=1:5 2-5:0 6-10:0 >10:0]

zmq/tcp

  • 1 RAN - 1 dApp: indications=5
    • dapp peer=default ran=ran-solo sub=1 indications=5 seq=[0..4] dropped=0 (0%) age_ms(avg=0.2 max=1 @seq=0) hist[<=1:5 2-5:0 6-10:0 >10:0]
  • 1 RAN - 2 dApps: dApp#1 ind=5 sub=1, dApp#2 ind=6 sub=2, RAN saw 2 dApps
    • dapp1 peer=default ran=ran-shared sub=1 indications=5 seq=[0..4] dropped=0 (0%) age_ms(avg=1 max=1 @seq=0) hist[<=1:5 2-5:0 6-10:0 >10:0]
    • dapp2 peer=default ran=ran-shared sub=2 indications=6 seq=[0..5] dropped=0 (0%) age_ms(avg=0.666667 max=1 @seq=1) hist[<=1:6 2-5:0 6-10:0 >10:0]
  • 2 RANs - 1 dApp: from ran-a ind=5, from ran-b ind=5
    • dapp peer=default ran=ran-a sub=1 indications=5 seq=[0..4] dropped=0 (0%) age_ms(avg=0.8 max=1 @seq=1) hist[<=1:5 2-5:0 6-10:0 >10:0]
    • dapp peer=off100 ran=ran-b sub=1 indications=5 seq=[0..4] dropped=0 (0%) age_ms(avg=0.4 max=1 @seq=0) hist[<=1:5 2-5:0 6-10:0 >10:0]

example_simple_agent + example_simple_dapp on ubuntu-latest, Release. Indication age is report-only.

@github-actions

github-actions Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

🔄 E2E dApp Integration Results (commit 70fd2b5)

posix/ipc

  • dApp exit: 0
  • Indications received: 7

posix/tcp

  • dApp exit: 0
  • Indications received: 7

zmq/ipc

  • dApp exit: 0
  • Indications received: 7

zmq/tcp

  • dApp exit: 0
  • Indications received: 7

example_simple_agent + example_simple_dapp on ubuntu-latest, Release build

Thecave3 and others added 2 commits June 25, 2026 12:55
LIBE3_ENABLE_ASN1 and LIBE3_ENABLE_JSON are independent compile-time
inclusion flags; both can be ON simultaneously. The active encoding is
selected at runtime via e3_config_t.encoding. Fix line 123 which
incorrectly described JSON as mutually exclusive with ASN.1.
…cture

Add --link, --transport, --encoding CLI flags to bench_full_loop_latency
so the paper's run_baseline.sh can sweep the full (link x transport x
encoding) parameter matrix without upstream changes.  Transport-aware
endpoint setup: IPC uses a private tmpdir; TCP/SCTP uses default localhost
ports (both sides run in the same process).  Temporary IPC socket files
are cleaned up after the run.

Update README: redesign architecture section with a dual-role deployment
topology diagram showing both RAN and dApp sides and the E3AP link between
them.  Fix API-reference description from 'for RAN vendors' to role-neutral.
Remove references to private repository names.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@Thecave3 Thecave3 marked this pull request as ready for review June 25, 2026 18:53
@Thecave3 Thecave3 merged commit fe3e1fe into main Jun 25, 2026
14 checks passed
@Thecave3 Thecave3 deleted the improve-logs branch June 25, 2026 18:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant