Draft: Adapt to change in /usr/include/linux/cn_proc.h
I ran today into an issue where Online (master) would no longer build, I was getting this error
FAILED: Online/ROMon/CMakeFiles/DiracMon.dir/main/DiracMon.cpp.o
/usera/jonesc/LHCb/stack/Master/utils/compile.sh /usera/jonesc/LHCb/stack/Master/Online/build.x86_64_v3-el9-gcc13-opt/toolchain/g++-13.1.0-b3d18-2.40-acaab -DDD4HEP_NONE=1 -DDD4HEP_NS_NAME=Online -DDD4HEP_PARSERS_NO_ROOT=1 -DDD4HEP_USE_BOOST=1 -DDD4HEP_USE_TINYXML -DDD4hep_Flavor=Gaudi -DGAUDI_V20_COMPAT -DMIPSEL -DUSE_DD4HEP -DUSE_TORCH -Ddd4hep=Online -I../Online/ROMon/include -I../Online/dim/include -I../Online/dim/include/dim -I../Online/Parsers/include -I../Online/Parsers/include/parsers_detail -I../Online/OnlineBase/include -isystem /cvmfs/lhcb.cern.ch/lib/lcg/releases/Boost/1.82.0-fbfc9/x86_64-el9-gcc13-opt/include -march=x86-64-v3 -fmessage-length=0 -pipe -fdiagnostics-color -pedantic -Wall -Wextra -Werror=return-type -Wwrite-strings -Wpointer-arith -Woverloaded-virtual -Wnon-virtual-dtor -Wsuggest-override -ffile-prefix-map=/usera/jonesc/LHCb/stack/Master=. -g -O0 -O3 -DNDEBUG -Wno-pedantic -Wno-shadow -Wno-c++20-extensions -std=gnu++2a -MD -MT Online/ROMon/CMakeFiles/DiracMon.dir/main/DiracMon.cpp.o -MF Online/ROMon/CMakeFiles/DiracMon.dir/main/DiracMon.cpp.o.d -o Online/ROMon/CMakeFiles/DiracMon.dir/main/DiracMon.cpp.o -c ../Online/ROMon/main/DiracMon.cpp
In file included from /usera/jonesc/LHCb/stack/Master/Online/Online/ROMon/main/DiracMon.cpp:20:
/usr/include/linux/cn_proc.h: In function 'proc_cn_event valid_event(proc_cn_event)':
/usr/include/linux/cn_proc.h:72:17: error: invalid conversion from 'unsigned int' to 'proc_cn_event' [-fpermissive]
72 | ev_type &= PROC_EVENT_ALL;
| ^
| |
| unsigned int
/usera/jonesc/LHCb/stack/Master/Online/Online/ROMon/main/DiracMon.cpp: In function 'void* handle_proc_ev(void*)':
/usera/jonesc/LHCb/stack/Master/Online/Online/ROMon/main/DiracMon.cpp:658:24: error: 'PROC_EVENT_NONE' is not a member of 'proc_event'
658 | case proc_event::PROC_EVENT_NONE:
| ^~~~~~~~~~~~~~~
/usera/jonesc/LHCb/stack/Master/Online/Online/ROMon/main/DiracMon.cpp:663:24: error: 'PROC_EVENT_FORK' is not a member of 'proc_event'
663 | case proc_event::PROC_EVENT_FORK:
| ^~~~~~~~~~~~~~~
/usera/jonesc/LHCb/stack/Master/Online/Online/ROMon/main/DiracMon.cpp:692:24: error: 'PROC_EVENT_EXEC' is not a member of 'proc_event'
692 | case proc_event::PROC_EVENT_EXEC:
| ^~~~~~~~~~~~~~~
/usera/jonesc/LHCb/stack/Master/Online/Online/ROMon/main/DiracMon.cpp:710:24: error: 'PROC_EVENT_UID' is not a member of 'proc_event'
710 | case proc_event::PROC_EVENT_UID:
| ^~~~~~~~~~~~~~
/usera/jonesc/LHCb/stack/Master/Online/Online/ROMon/main/DiracMon.cpp:719:24: error: 'PROC_EVENT_GID' is not a member of 'proc_event'
719 | case proc_event::PROC_EVENT_GID:
| ^~~~~~~~~~~~~~
/usera/jonesc/LHCb/stack/Master/Online/Online/ROMon/main/DiracMon.cpp:728:24: error: 'PROC_EVENT_EXIT' is not a member of 'proc_event'
728 | case proc_event::PROC_EVENT_EXIT:
| ^~~~~~~~~~~~~~~
Investigating, it appears to a system update to the rh9 package kernel-headers
which provides the header /usr/include/linux/cn_proc.h
which has been updated in a way that breaks Online. The version that broke things is
> yum list --installed | grep kernel-headers
kernel-headers.x86_64 5.14.0-503.11.1.el9_5 @appstream
where as the previous one i think was
> yum list --installed | grep kernel-headers
kernel-headers.x86_64 5.14.0-427.42.1.el9_4 @rhel-9-appstream
The changes in this MR are what I needed to adapt to this change.
I am posting this just for reference. You probably shouldn't merge this right now, as it unfortunately depends on the version of the package a user has on their machine as to which variant of the code is correct, but given this is a system update I suspect you will find over time more systems hitting it.
Edited by Christopher Rob Jones