No debug output from DPL workflow

Dear experts,

when I run a DPL workflow I don’t manage to see the debug output which should be available from the device. According to the README of the core framework I should be able to set the infologger severity via --infologger-severity DEBUG, but this setting seems to affect only the DPL itself, not the device in question.
So I run:
o2-trd-trap-sim -b --infologger-severity debug
and I see debug messages from DPL like
[26543:TRDDIGITREADER]: 2020-12-11 11:27:51.550693 DPL: socket polled UV_WRITEABLE
which are hidden if I don’t set the infologger severity, but from the code which I am interested in (TrapSimulator.cxx) I don’t see debug messages, only [WARN] messages.
@swenzel pointed out that I might need to build O2 again without the NDEBUG flag which I did but still I don’t see the log messages I am interested in.
Does anybody know what might be the reason for this?

Cheers,
Ole

@eulisse: Is DPL forwarding the logger severity to the individual process loggers? Otherwise it’s probably easily put into place.

As far as I remember, debug messages are only shown in debug builds. @oschmidt, did you compile in debug mode?

Hi Jens,
I tried, but maybe I did it wrong…
I removed the NDEBUG flag from the CMAKE_CXX_FLAGS_[RELEASE,RELWITHDEBINFO] in dependencies/O2CompileFlags.cmake. In the same file I furthermore set FAIR_MIN_SEVERITY to debug instead of info.
Or should this be done differently? Can I change the o2 recipe in alidist to enable the debug mode?
Cheers,
Ole

Hi,

I’d guess the proper way would be to use something like

CMAKE_BUILD_TYPE=DEBUG aliBuild --defaults o2 build O2 --debug

(or tweak the CMakeCache.txt for that CMAKE_BUILD_TYPE variable in your build directory)

1 Like

I had a look with my nightly debug build. It seems to me that --infologger-severity debug only enables debug output in the DPL driver and not for the actual processes. @eulisse: What do you think about propagating this flag to the final Logger instances? I think this would be very helpful.

There is actually also a more general --severity flag but that also doesn’t seem to have any effect.

@oschmidt: I am making a dedicated debug O2 package like this:

# copy recipe
cp alidist/o2.sh alidist/o2-debug.sh
# change name of package
sed -i 's/package: O2/package: O2-Debug/' alidist/o2-debug.sh
# insert lines into recipe that make it compile in debug mode
sed -i '/#!\/bin\/sh/ a unset CXXFLAGS && CXXFLAGS="-fPIC -std=c++17" && unset CMAKE_BUILD_TYPE && CMAKE_BUILD_TYPE=Debug' alidist/o2-debug.sh
# make a soft link of O2 git repo to O2-Debug git repo
ln -s O2 O2-Debug 

IIRC, if you want to enable the severity for the various devices you should:

  • enable DEBUG mode when compiling
  • pass --severity debug or --data-processor-name --severity debug

–infologger- stuff is only for the backend and should not be touched by users.

@eulisse: I tested with the standard digitiser workflow which should print a few debug messages (right at initialisation).
The command tried was

o2-sim-digitizer-workflow -n 10 --severity debug --onlyDet EMC

but no debug output is visible.

Same for me with o2-trd-trap-sim -b --severity debug. I don’t see any debug messages from the TRAP simulation that I am interested in.
@swenzel and @laphecet thanks a lot for providing the information how to build in debug mode!

Did you recompile with CMAKE_BUILD_TYPE=DEBUG?

Indeed something seems wrong… I will look into it.

@eulisse: Should we make a JIRA ticket to track this or is there one already?

Dear @eulisse, @swenzel,

I found this ticket since I have a similar problem with DEBUG statements. I managed to compile my code with CMAKE_BUILD_TYPE=Debug but I see a strange behaviour when running my tasks with --severity debug option. In particular it seems to depend on the presence/position of “\n”:
LOGF(debug,“test”); // nothing is printed
LOGF(debug,“test\n”); // empty lines are printed
LOGF(debug,"\n test"); // I finally see my debugs

Is it a bug of feature in the logger?

Evgeny