Hi, You can find this info on the wiki here: https://cwiki.apache.org/confluence/display/TRAFODION/Debugging+Tips#DebuggingTips-TrafodionProcessDebugHooks
Feel free to correct and update as you see fit. Dave -----Original Message----- From: Dave Birdsall Sent: Wednesday, January 25, 2017 10:04 AM To: [email protected] Subject: RE: Using hook to debug Trafodion processes Hi, Thanks, Narendra! I'll add this info to the wiki. Dave -----Original Message----- From: Narendra Goyal [mailto:[email protected]] Sent: Wednesday, January 25, 2017 10:02 AM To: [email protected] Subject: RE: Using hook to debug Trafodion processes Hi Dave, The cwd directory of most processes started by sqstart is $MY_SQROOT/sql/scripts. But mxosrvr's is $MY_SQROOT Also these two files in $MY_SQROOT/sql/scripts to create/delete all the hook files (for debugging): - createhooks - delhooks Thanks, -Narendra -----Original Message----- From: Dave Birdsall [mailto:[email protected]] Sent: Wednesday, January 25, 2017 9:59 AM To: [email protected] Subject: RE: Using hook to debug Trafodion processes Hi, I looked at the code for msg_debug_hook. (It's in $TRAF_HOME/src/seabed/src/ms.cpp.) It uses getcwd to determine what directory to look into. So, if I start sqlci, then sqlci.hook needs to be in my current working directory in order for sqlci to continue. I wonder what the current working directory is for processes started by sqstart? Thanks, Dave -----Original Message----- From: Dave Birdsall [mailto:[email protected]] Sent: Wednesday, January 25, 2017 9:47 AM To: [email protected] Subject: RE: Using hook to debug Trafodion processes Hi, I did some grepping around the Trafodion code and came up with this list of hook files. (There are a lot of others but they seem to be associated with test programs.) Does this look right? Dave ./core/sqf/src/seabed/src/fs.cpp: msg_debug_hook(pp_who, pp_fname); ./core/sqf/src/stfs/common/stfs_util.cpp: msg_debug_hook("STFS", "stfs.hook"); ./core/sqf/src/tm/tm.cpp: msg_debug_hook ("tm.hook", "tm.hook"); ./core/sqf/src/tm/idtmsrv.cpp: msg_debug_hook("s", "s"); ./core/sql/common/memtest.cpp: msg_debug_hook("memtest", "memtest.hook"); ./core/sql/qms/QmpMain.cpp: msg_debug_hook("tdm_arkqmp", "tdm_arkqmp.hook"); ./core/sql/qms/QmmMain.cpp: msg_debug_hook("tdm_arkqmm", "tdm_arkqmm.hook"); ./core/sql/qms/QmsMain.cpp: msg_debug_hook("tdm_arkqms", "tdm_arkqms.hook"); ./core/sql/bin/ex_esp_main.cpp: msg_debug_hook("arkesp", "esp.hook"); ./core/sql/bin/SqlciMain.cpp: msg_debug_hook("sqlci", "sqlci.hook"); ./core/sql/bin/ex_sscp_main.cpp: msg_debug_hook("mxsscp", "mxsscp.hook"); ./core/sql/bin/arkcmp.cpp: msg_debug_hook("arkcmp", "ark.hook"); ./core/sql/bin/ex_ssmp_main.cpp: msg_debug_hook("mxssmp", "mxssmp.hook"); ./core/sql/bin/mpisetup.cpp: msg_debug_hook("NGG", "ngg.hook"); -----Original Message----- From: Dave Birdsall [mailto:[email protected]] Sent: Wednesday, January 25, 2017 9:38 AM To: [email protected] Subject: Using hook to debug Trafodion processes Hi, I need to debug an issue in tdm_arkcmp that may occur very early in its processing. I remember we had a technique called "hook" which caused any SeaQuest process to wait until a particular file exists. The way it works was, you'd set HOOK_ENABLE=1 in your $TRAF_HOME/etc/ms.env file and restart your instance. Then, every process instrumented with a msg_debug_hook call in it would block until the file named in the call existed. So, for example, the main for tdm_arkcmp.cpp (in core/sql/bin/arkcmp.cpp) has msg_debug_hook("arkcmp", "ark.hook"); so tdm_arkcmp will block until the file ark.hook exists. I remember that in earlier versions of the code a collection of *.hook files were present in the source distribution. These seem to be gone now; I cannot find them. I tried this yesterday, and sqstart doesn't complete. The probable reason is one or more of the processes that fire up at sqstart time has a msg_debug_hook call. Now the question: Does anyone know off the top of their head the complete set of *.hook calls? Also, what directory does msg_debug_hook look into to find these files? I'll update the Trafodion wiki with this information once I have the complete story. Thanks, Dave
