Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable logging outside of local domain, with no other changes #644

Merged
merged 1 commit into from
Feb 2, 2024

Conversation

jml985
Copy link
Contributor

@jml985 jml985 commented Feb 1, 2024

Clean version of the pull request disabling DAQ logging when compiling outside of the local domain.

@plexoos
Copy link
Member

plexoos commented Feb 2, 2024

supersedes #643

@plexoos plexoos merged commit 2ffb8a4 into star-bnl:main Feb 2, 2024
148 checks passed
@jml985 jml985 deleted the logging_branch branch February 2, 2024 13:12
@genevb
Copy link
Contributor

genevb commented Feb 7, 2024

This seems to be working OK in DEV. My understanding is that this PR needs to be back-propagated into any in-use libraries. I suggest to tag the following for now, and I'll begin the re-compilations on SDCC.
SL23 a/c/d/e/f
SL22 a/b/c
SL21 c/d

plexoos pushed a commit to plexoos/star-sw that referenced this pull request Feb 7, 2024
…bnl#644)

Clean version of the pull request disabling DAQ logging when compiling
outside of the local domain.
plexoos pushed a commit to plexoos/star-sw that referenced this pull request Feb 7, 2024
…bnl#644)

Clean version of the pull request disabling DAQ logging when compiling
outside of the local domain.
plexoos pushed a commit to plexoos/star-sw that referenced this pull request Feb 7, 2024
…bnl#644)

Clean version of the pull request disabling DAQ logging when compiling
outside of the local domain.
plexoos pushed a commit to plexoos/star-sw that referenced this pull request Feb 7, 2024
…bnl#644)

Clean version of the pull request disabling DAQ logging when compiling
outside of the local domain.
plexoos pushed a commit to plexoos/star-sw that referenced this pull request Feb 7, 2024
…bnl#644)

Clean version of the pull request disabling DAQ logging when compiling
outside of the local domain.
plexoos pushed a commit to plexoos/star-sw that referenced this pull request Feb 7, 2024
…bnl#644)

Clean version of the pull request disabling DAQ logging when compiling
outside of the local domain.
plexoos pushed a commit to plexoos/star-sw that referenced this pull request Feb 7, 2024
…bnl#644)

Clean version of the pull request disabling DAQ logging when compiling
outside of the local domain.
plexoos pushed a commit to plexoos/star-sw that referenced this pull request Feb 7, 2024
…bnl#644)

Clean version of the pull request disabling DAQ logging when compiling
outside of the local domain.
plexoos pushed a commit to plexoos/star-sw that referenced this pull request Feb 7, 2024
…bnl#644)

Clean version of the pull request disabling DAQ logging when compiling
outside of the local domain.
@plexoos
Copy link
Member

plexoos commented Feb 7, 2024

The patch worked fine with SL23 but there were conflicts with SL22 and SL21 branches. For these branches, I forced the incoming changes over the existing ones. I don't think our CI will be able to catch potential problems with the online code should they happen. If there is a way to test the patched branches before we merge them, please let me know.

@jml985
Copy link
Contributor Author

jml985 commented Feb 7, 2024

@plexoos What are the conflicts? Are this git conflicts or compile conflicts?

@plexoos
Copy link
Member

plexoos commented Feb 7, 2024

A conflict when the patch is applied. Here, for example,

diff --git a/StRoot/RTS/src/rtsmakefile.def b/StRoot/RTS/src/rtsmakefile.def
index b22ce170a7..e65f702e75 100755
--- a/StRoot/RTS/src/rtsmakefile.def
+++ b/StRoot/RTS/src/rtsmakefile.def
@@ -372,8 +374,46 @@ endif
 DEFINES = -D_REENTRANT ${RTS_DAQMAN_FLAGS} -DRTS_HOST_NAME=\"${HOST_NAME}\" -DTARGET_SYSTEM=\"${TARGET_SYSTEM}\" -DPROJDIR=\"${PROJDIR}\"  -DINSTALL_SUFFIX=\"${INSTALL_SUFFIX}\" -D${RTS_TYPE} ${HOW} ${HOSTDEFINES} -DRTS_ONLINE
 
 
+<<<<<<< HEAD
 BASEFLAGS = -O3 -Wall -pipe -fverbose-asm ${HOSTFLAGS} 
 #BASEFLAGS= -Wall -pipe -fverbose-asm ${HOSTFLAGS} 
+=======
+# Set strict errors in LINUX
+BASEFLAGS = -O3 -Wall -Wno-error=strict-overflow -Wno-error=maybe-uninitialized -Wno-error=unused-label -Wno-error=unused-value -Wno-error=unused-variable -Wno-error=unused-function -Wno-unused-but-set-variable -pipe -fverbose-asm ${HOSTFLAGS}
+
+
+#-O3
+ifneq (${TARGET_SYSTEM}, LINUX)
+     BASEFLAGS = -Wall  -pipe -fverbose-asm ${HOSTFLAGS} 
+endif
+
+ifeq (${HOST_NAME},xvme01.daq.bnl.local) 
+     BASEFLAGS = -O3 -Wall -Wno-error=strict-overflow -Wno-error=unused-label -Wno-error=unused-value -Wno-error=unused-variable -Wno-error=unused-function -Wno-unused-but-set-variable -pipe -fverbose-asm ${HOSTFLAGS}
+endif
+
+# if not compiling on one of the standard domains, then 
+# use the default log destination of std_err
+# if compiling on local domain, write to daqman
+#
+# if compiling somewhere else for writing to daqman these defines
+ifeq (${HOSTDOMAIN},starp.bnl.gov)
+       DEFINES += -DRTS_LOG_DEFAULT_NET
+       DEFINES += -DRTS_ENABLE_LOG
+else ifeq (${HOSTDOMAIN},daq.bnl.local) 
+       DEFINES += -DRTS_LOG_DEFAULT_NET
+       DEFINES += -DRTS_ENABLE_LOG
+else ifeq (${HOSTDOMAIN},daq2.bnl.local)
+       DEFINES += -DRTS_LOG_DEFAULT_NET
+       DEFINES += -DRTS_ENABLE_LOG
+else ifeq (${HOSTDOMAIN},trg.bnl.local)
+       DEFINES += -DRTS_LOG_DEFAULT_NET
+       DEFINES += -DRTS_ENABLE_LOG
+else ifeq (${HOSTDOMAIN},l4.bnl.local)
+       DEFINES += -DRTS_LOG_DEFAULT_NET
+       DEFINES += -DRTS_ENABLE_LOG
+endif
+
+>>>>>>> 2ffb8a419a (Disable logging outside of local domain, with no other changes (#644))
 CCFLAGS  = ${BASEFLAGS} ${USRCCFLAGS}  ${DEFINES} ${INCLUDES} 
 CXXFLAGS = ${BASEFLAGS} ${USRCXXFLAGS} ${DEFINES} ${INCLUDES} 
 CFLAGS   = ${BASEFLAGS} ${USRCFLAGS}   ${DEFINES} ${INCLUDES} 

@plexoos
Copy link
Member

plexoos commented Feb 7, 2024

diff --git a/StRoot/RTS/src/LOG/rtsLogUnix.c b/StRoot/RTS/src/LOG/rtsLogUnix.c
index c48799c7d8..3083e23858 100755
--- a/StRoot/RTS/src/LOG/rtsLogUnix.c
+++ b/StRoot/RTS/src/LOG/rtsLogUnix.c
@@ -29,7 +29,35 @@ extern "C" {
 volatile int tonkoLogLevel = 2 ;       
 
 
+<<<<<<< HEAD
 static char *getCmd(void) ;
+=======
+
+
+
+
+#ifdef RTS_ENABLE_LOG
+#warning "DAQ logging is enabled"
+#ifdef RTS_LOG_DEFAULT_NET
+#warning "DAQ logging defaults to daqman"
+#else
+#warning "DAQ logging defaults to STDERR"
+#endif  /* RTS_LOG_DEFAULT_NET */
+#else
+#warning "DAQ logging is disabled"
+#endif  /* RTS_ENABLE_LOG */
+
+
+#ifdef RTS_ENABLE_LOG
+
+#ifdef RTS_LOG_DEFAULT_NET
+static int output_flag = RTS_LOG_NET ;
+#else
+static int output_flag = RTS_LOG_STDERR ;
+#endif
+
+static const char *getCmd(void) ;
+>>>>>>> 2ffb8a419a (Disable logging outside of local domain, with no other changes (#644))
 static int  odesc = -1 ;
 static int handchange ;
 static FILE *fdesc = 0 ;
@@ -328,9 +355,13 @@ int rtsLogUnix_v(const char *str, ...)
        return 0 ;
 }
 
+<<<<<<< HEAD
 
 
 static char *getCmd(void)
+=======
+static const char *getCmd(void)
+>>>>>>> 2ffb8a419a (Disable logging outside of local domain, with no other changes (#644))
 {
 
 

@jml985
Copy link
Contributor Author

jml985 commented Feb 7, 2024

I don't understand how these patches map on the changes that were made, which were simple. Maybe git has trouble with the ifdefs. There are only 2 files that are part of the offline compile: rtsLog.h and rtsLogUnix.c. It doesn't look like these have changed since 2019 in our repository, so I don't know why this is occurring. In any event the files should override whatever exists. There aren't multiple branches or anything like that to get confused by.

plexoos added a commit that referenced this pull request Feb 8, 2024
plexoos added a commit that referenced this pull request Feb 8, 2024
plexoos added a commit that referenced this pull request Feb 8, 2024
plexoos added a commit that referenced this pull request Feb 8, 2024
Clean version of the pull request disabling DAQ logging when compiling
outside of the local domain.

Co-authored-by: jml985 <[email protected]>
plexoos added a commit that referenced this pull request Feb 9, 2024
Clean version of the pull request disabling DAQ logging when compiling
outside of the local domain.

Co-authored-by: jml985 <[email protected]>
plexoos added a commit that referenced this pull request Feb 9, 2024
plexoos pushed a commit that referenced this pull request Feb 13, 2024
Clean version of the pull request disabling DAQ logging when compiling
outside of the local domain.
plexoos pushed a commit that referenced this pull request Feb 13, 2024
Clean version of the pull request disabling DAQ logging when compiling
outside of the local domain.
plexoos pushed a commit that referenced this pull request Feb 13, 2024
Clean version of the pull request disabling DAQ logging when compiling
outside of the local domain.
@plexoos
Copy link
Member

plexoos commented Feb 14, 2024

For the record, the following branches have been patched and tagged respectively (#644 (comment)):

SL21c_9, SL21d_4
SL22a_2, SL22b_2, SL22c_1
SL23a_1, SL23b_1, SL23c_1, SL23d_2, SL23e_2, SL23f_2

dkapukchyan pushed a commit to dkapukchyan/star-sw that referenced this pull request Mar 11, 2024
…bnl#644)

Clean version of the pull request disabling DAQ logging when compiling
outside of the local domain.
@plexoos plexoos mentioned this pull request Mar 28, 2024
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.

3 participants