Article 4XS9T Process state change tracker - system call

Process state change tracker - system call

by
JKostov
from LinuxQuestions.org on (#4XS9T)
I want to create a new system call that gets the process state changes in last T seconds for the requested process(with PID).
Example: sys_task_state_changes(pid, tsec) returns array R, S, R, S.

My plan was to add a new linked list in the task_struct structure that will save the process states and the time of change. When the system call is called it would read the list and return the states that are in the requested time.
My problem is how and where to save the states in this linked list?
Is this approach good or there is a better one?latest?d=yIl2AUoC8zA latest?i=-hl8NOy4_Qk:dB9rw4eOtHc:F7zBnMy latest?i=-hl8NOy4_Qk:dB9rw4eOtHc:V_sGLiP latest?d=qj6IDK7rITs latest?i=-hl8NOy4_Qk:dB9rw4eOtHc:gIN9vFw-hl8NOy4_Qk
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments