If you need to strace the process for any reason, the below command will let you strace all of the active cPanel or WHM processes.
As root run the command:
TSTAMP=$(date +%s); TDIR=/root/strace/strace-${TSTAMP}; mkdir -p ${TDIR} && echo "Working Directory: ${TDIR}" && strace -ff -T -t -v -s 8192 -o ${TDIR}/pid $(ps auxwww | egrep 'cpsrv[d]|whostmgr[d]|cpanel[d]' | egrep -v 'defunct' | tee ${TDIR}/process-list.txt | awk '{ printf " -p " $2; }')
Then try to replicate the issue in cPanel or WHM with your custom plugin or code.
More information on strace that may be useful: