3

I am trying to develop a multi-process system with RaspberryPi in which I want to monitor all major processes and how they are scheduled using Linux. That is, obtaining scheduler states, start time, release time etc. I have been messing with '/proc' folder in order to find such an information but I haven't able to find anything really useful so far.

For example, if you go into /proc/pid/task/pid you can see:

se.exec_start
se.vruntime
se.sum_exec_runtime
se.statistics.wait_start
se.statistics.sleep_start
se.statistics.block_start
se.statistics.sleep_max
se.statistics.block_max
se.statistics.iowait_sum
se.statistics.wakeups

and so on. Now, this looks like I am up to something, but not clear enough. I want to just see how processes are scheduled in cores. i.e, Process1 released at 0.30, then Process2 started at 0.70 (system timer values) etc.

Is something like this possible by monitoring kernel folders such as '/proc'? If not, is there a way to determine this using another tracing tools or scheduler tools for Linux?

Any guidance is greately appreciated. Please tell me if there is something else I need to provide.

Thanks in advance.

EDIT: using kernelshark, enter image description here

I want to find out exactly, for other processes too, when does cpu complete one iteration for every task.

5

I want to just see how processes are scheduled in cores. i.e, Process1 released at 0.30, then Process2 started at 0.70 (system timer values) etc.

This is called tracing, and usually done in the kernel after request from user. There are several kernel event tracers in Linux. Try

Gregg has some info of Linux tracing (with "pony-corn mascot" magic): http://www.brendangregg.com/blog/2015-07-08/choosing-a-linux-tracer.html (there should be some presentation about tracing in https://www.slideshare.net/brendangregg)...

Is something like this possible by monitoring kernel folders such as '/proc'

There is no inotify for /proc (it has no real directories or real files inside: https://stackoverflow.com/a/24898733), so you can't monitor for changes, you can only reread some /proc (or some /sys) periodically.

7
  • hmm sorry for the delay to reply. I will try these today and let you know. – mozcelikors Mar 7 '17 at 12:30
  • @mozcelikors, do you want to monitor the scheduling from your application automatically, or you need some tools to investigate scheduling in manual mode for several times? – osgx Mar 7 '17 at 13:18
  • Investigation works for me. Your suggestion with perf sched seems like what I would want exactly. Let me ask about my concern: seeing perf sched map really helps visualizing details, but can I get release, start and end times for these processes (in parallel computing terminology) Also, do I need to investigate several times? I would like to assume one ivestigation should give me idea of processes. – mozcelikors Mar 7 '17 at 13:25
  • Try perf sched script to get full dump of tracing events. You can parse it. Also, trace-cmd record -e sched + kernelshark and lttng + lttng Eclipse plugin (TraceCompass) will give you GUI and list of events (kernelshark is simple GUI; TraceCompass is very advanced GUI with arrows between events). – osgx Mar 7 '17 at 13:28
  • It was extremely helpful. Thanks for your kind suggestions. To be honest, some people said that it was impossible to derive this info. But I knew there had to be countless kernel tracers to make this possible. I will search methods to derive what I need from what I got. – mozcelikors Mar 7 '17 at 13:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.