Sometimes the parent process is executed instantly, and only tracking PPID does not know who executed the command. Adding PCOMM is a good choice. At the same time, rename the original PCOMM to COMM, and use PCOMM as the parent command.
Before:
$ sudo ./execsnoop.py
COMM PID PPID RET ARGS
sh 44789 44682 0 /bin/sh -c cd /home/...
gcc 44788 44682 0 /usr/bin/gcc -DCAPST...
After:
$ sudo ./execsnoop.py -M
COMM PID PCOMM PPID RET ARGS
sh 44789 make 44682 0 /bin/sh -c cd /home/...
gcc 44788 make 44682 0 /usr/bin/gcc -DCAPST...
^^^^^^^^^^^^^^^^
Sometimes the parent process is executed instantly, and only tracking PPID does not know who executed the command. Adding PCOMM is a good choice. At the same time, rename the original PCOMM to COMM, and use PCOMM as the parent command.
Before:
After: