The invention relates to the technical field of computers, and discloses a tracking method for a Linux
application layer to monitor process generation and process behaviors in real time. The method comprises the following steps: S1, establishing a relation between the
application layer and a kernel layer based on a netlink socker technology of a Linux
system; S2, on the basis of netlink socker communication, obtaining events related to the process in the whole Linux
system a through cn_proc, wherein process
generation time exists, and then a newly-generated process PID can be obtained; and S3, then by using a ptrace technology provided by the Linux
system, tracking, monitoring and specifying the newly generated process PID. According to the
application layer process monitoring method, the error-tolerant rate is very high, even if the program crashes due to the internal running error of the program, the whole system crashes, the application layer monitoring process uses a connector mechanism provided by a
Linux kernel, and the generation of the Linux process can be obtained by driving ten pieces through cn_proc in real time, and then the conditions of
delay and inaccuracy caused by acquiring the generation condition of the Linux process by reading a / proc / PID catalog are avoided.