Attention is currently required from: osmith, dexter.
fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/26950 )
Change subject: logging: log to stdout when logging is not initialized
......................................................................
Patch Set 1:
(1 comment)
File src/logging.c:
https://gerrit.osmocom.org/c/libosmocore/+/26950/comment/aa880d44_4cb9245a
PS1, Line 765: printf
I agree with Harald here, why not fprintf(stderr, ...)? stdout is generally used for generating data (e.g. osmo-config-merge, osmo-gapk), while here IMO stderr is a better target.
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/26950
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I9b1b0988e02322e3e44fd4ceea3e1bc2d4df3c45
Gerrit-Change-Number: 26950
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: dexter <pmaier(a)sysmocom.de>
Gerrit-Comment-Date: Thu, 20 Jan 2022 09:05:20 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
Attention is currently required from: neels.
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/26606 )
Change subject: PFCP: add DLPFCP and osmo-upf port numbers
......................................................................
Patch Set 2:
(1 comment)
Patchset:
PS2:
tests need to pass, but apart from this the patch could long be merged.
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/26606
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I0a46b147ec6a76d909df28136cfd2b764b2c75ea
Gerrit-Change-Number: 26606
Gerrit-PatchSet: 2
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: lynxis lazus <lynxis(a)fe80.eu>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 19 Jan 2022 14:34:58 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
Attention is currently required from: osmith, dexter.
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/26950 )
Change subject: logging: log to stdout when logging is not initialized
......................................................................
Patch Set 1: Code-Review+1
(1 comment)
Patchset:
PS1:
not sure if stderr wouldn't be preferred over stdout (not sure)? I think later on the default log target also is to stderr, right? so if you have I/O redirection for logging, then both early and normal logging should use the same file descriptor.
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/26950
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I9b1b0988e02322e3e44fd4ceea3e1bc2d4df3c45
Gerrit-Change-Number: 26950
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: dexter <pmaier(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 19 Jan 2022 14:33:02 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Attention is currently required from: osmith, dexter.
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/26950 )
Change subject: logging: log to stdout when logging is not initialized
......................................................................
Patch Set 1:
(1 comment)
Patchset:
PS1:
> (gerrit made this a "resolved" comment, marking as "unresolved")
logging before explicit logging initialization: what about some low-level initialization code in __atrribute__((constructor)) ? There will always be situations where you want to log before logging has been properly initialized, and some sane way of "early logging" at that point is ceratinly useful.
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/26950
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I9b1b0988e02322e3e44fd4ceea3e1bc2d4df3c45
Gerrit-Change-Number: 26950
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: dexter <pmaier(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 19 Jan 2022 14:31:03 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: osmith <osmith(a)sysmocom.de>
Gerrit-MessageType: comment
Attention is currently required from: dexter.
osmith has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/26950 )
Change subject: logging: log to stdout when logging is not initialized
......................................................................
Patch Set 1:
(1 comment)
Patchset:
PS1:
> I don't understand the use case, isn't this a bug in the program using libosmocore, if it attempts t […]
(gerrit made this a "resolved" comment, marking as "unresolved")
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/26950
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I9b1b0988e02322e3e44fd4ceea3e1bc2d4df3c45
Gerrit-Change-Number: 26950
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: dexter <pmaier(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 19 Jan 2022 13:37:42 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: osmith <osmith(a)sysmocom.de>
Gerrit-MessageType: comment
Attention is currently required from: laforge, pespin, dexter.
osmith has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/26950 )
Change subject: logging: log to stdout when logging is not initialized
......................................................................
Patch Set 1:
(1 comment)
Patchset:
PS1:
I don't understand the use case, isn't this a bug in the program using libosmocore, if it attempts to log before initializing logging?
With this patch it seems that it won't complain at all about logging not being initialized, since the log_check_level -> assert_loginfo() code path isn't executed. Is this intended?
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/26950
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I9b1b0988e02322e3e44fd4ceea3e1bc2d4df3c45
Gerrit-Change-Number: 26950
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: dexter <pmaier(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 19 Jan 2022 13:36:02 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/26950 )
Change subject: logging: log to stdout when logging is not initialized
......................................................................
logging: log to stdout when logging is not initialized
When the logging framework is not initialized we get an error:
"ERROR: osmo_log_info == NULL! You must call log_init() before
using logging in ..."
There are sometimes situations where some code tries to log before
logging was initialied. This is a problem because the actual log
line with the debug info we need is covered up by the error message
from the logging framework.
Lets introduce a fallback logging function that is called when the
the logging framework is not available. This function can just use
printf.
Change-Id: I9b1b0988e02322e3e44fd4ceea3e1bc2d4df3c45
---
M include/osmocom/core/logging.h
M src/logging.c
2 files changed, 33 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/50/26950/1
diff --git a/include/osmocom/core/logging.h b/include/osmocom/core/logging.h
index 4a34c7d..fea6b56 100644
--- a/include/osmocom/core/logging.h
+++ b/include/osmocom/core/logging.h
@@ -56,6 +56,10 @@
#ifndef LIBOSMOCORE_NO_LOGGING
#define LOGPC(ss, level, fmt, args...) \
do { \
+ if (!log_initialized()) { \
+ logp_stub(__FILE__, __LINE__, 1, fmt, ##args); \
+ break; \
+ } \
if (log_check_level(ss, level)) \
logp2(ss, level, __FILE__, __LINE__, 1, fmt, ##args); \
} while(0)
@@ -94,6 +98,13 @@
#ifndef LIBOSMOCORE_NO_LOGGING
#define LOGPSRCC(ss, level, caller_file, caller_line, cont, fmt, args...) \
do { \
+ if (!log_initialized()) { \
+ if (caller_file) \
+ logp_stub(caller_file, caller_line, cont, fmt, ##args); \
+ else \
+ logp_stub(__FILE__, __LINE__, cont, fmt, ##args); \
+ break; \
+ } \
if (log_check_level(ss, level)) {\
if (caller_file) \
logp2(ss, level, caller_file, caller_line, cont, fmt, ##args); \
@@ -380,7 +391,9 @@
void logp2(int subsys, unsigned int level, const char *file,
int line, int cont, const char *format, ...)
__attribute__ ((format (printf, 6, 7)));
+void logp_stub(const char *file, int line, int cont, const char *format, ...);
int log_init(const struct log_info *inf, void *talloc_ctx);
+int log_initialized(void);
void log_fini(void);
int log_check_level(int subsys, unsigned int level);
diff --git a/src/logging.c b/src/logging.c
index 9d2a065..03b06a8 100644
--- a/src/logging.c
+++ b/src/logging.c
@@ -312,6 +312,14 @@
}
}
+/* Check whether the logging framework is initialized (osmo_log_info exists) */
+int log_initialized(void)
+{
+ if (!osmo_log_info)
+ return 0;
+ return 1;
+}
+
/* special magic for negative (library-internal) log subsystem numbers */
static int subsys_lib2index(int subsys)
{
@@ -748,6 +756,18 @@
TRACE(LIBOSMOCORE_LOG_DONE());
}
+/* This logging function is used as a fallback when the logging framework is
+ * not is not properly initialized. */
+void logp_stub(const char *file, int line, int cont, const char *format, ...)
+{
+ va_list ap;
+ if (!cont)
+ printf("%s:%d ", file, line);
+ va_start(ap, format);
+ vprintf(format, ap);
+ va_end(ap);
+}
+
/*! Register a new log target with the logging core
* \param[in] target Log target to be registered
*/
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/26950
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I9b1b0988e02322e3e44fd4ceea3e1bc2d4df3c45
Gerrit-Change-Number: 26950
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-MessageType: newchange
laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-e1-hardware/+/26949 )
Change subject: icE1usb doc: Add pictures of front and back side
......................................................................
icE1usb doc: Add pictures of front and back side
Closes: OS#5406
Change-Id: Ifc382c762119b397dd9a6b484ebc9a237897fba9
---
M doc/manuals/chapters/hardware.adoc
A doc/manuals/images/icE1usb-e1_side.jpg
A doc/manuals/images/icE1usb-usb_side.jpg
3 files changed, 19 insertions(+), 1 deletion(-)
Approvals:
laforge: Looks good to me, approved
Jenkins Builder: Verified
diff --git a/doc/manuals/chapters/hardware.adoc b/doc/manuals/chapters/hardware.adoc
index 8055e64..0e129c2 100644
--- a/doc/manuals/chapters/hardware.adoc
+++ b/doc/manuals/chapters/hardware.adoc
@@ -19,7 +19,14 @@
PDF rendered schematics are available at https://git.osmocom.org/osmo-e1-hardware/plain/hardware/icE1usb/r1.0/icE1us…
-=== Connectors
+=== Connectors on E1 side
+
+image::images/icE1usb-e1_side.jpg[width=400,title="E1 side of icE1usb"]
+
+From left to right, there are the following connectors:
+
+* X5A: Primary E1 Port
+* X5B: Secondary E1 Port
==== X5A and X5B: E1 Interface Connectors
@@ -57,6 +64,17 @@
different pin-out. Particularly, you cannot use an Ethernet cross-over
cable as an E1 cross-over!
+=== Connectors on USB side
+
+image::images/icE1usb-usb_side.jpg[width=400,title="USB side of icE1usb"]
+
+From left to right, there are the following connectors:
+
+* X1: GPS Antenna Connector
+* X2: Serial Console Connector
+* X4: USB Connector
+* X3: GPIO / Extension Connector
+
==== X4: USB Connector
The USB connector is a USB Type C connector. However, it only carries
diff --git a/doc/manuals/images/icE1usb-e1_side.jpg b/doc/manuals/images/icE1usb-e1_side.jpg
new file mode 100644
index 0000000..5bd274d
--- /dev/null
+++ b/doc/manuals/images/icE1usb-e1_side.jpg
Binary files differ
diff --git a/doc/manuals/images/icE1usb-usb_side.jpg b/doc/manuals/images/icE1usb-usb_side.jpg
new file mode 100644
index 0000000..5d833d6
--- /dev/null
+++ b/doc/manuals/images/icE1usb-usb_side.jpg
Binary files differ
--
To view, visit https://gerrit.osmocom.org/c/osmo-e1-hardware/+/26949
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-e1-hardware
Gerrit-Branch: master
Gerrit-Change-Id: Ifc382c762119b397dd9a6b484ebc9a237897fba9
Gerrit-Change-Number: 26949
Gerrit-PatchSet: 2
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: merged