LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Kernel (https://www.linuxquestions.org/questions/linux-kernel-70/)
-   -   Explanation of /proc/sched_debug (https://www.linuxquestions.org/questions/linux-kernel-70/explanation-of-proc-sched_debug-4175447891/)

dutchgold92 01-30-2013 03:31 PM

Explanation of /proc/sched_debug
 
Hi, I'm developing a process management application, and for particular reasons I'm looking into /proc/sched_debug at the moment. Unfortunately, I can't find documentation about this file anywhere, so I have a couple of questions if anyone can help:
  1. Does .curr->pid under a CPU indicate a process that was physically executing WHEN sched_debug was read, or simply the last process to be scheduled on that CPU?
  2. If the .curr->pid field is 0 for a CPU, what exactly does this indicate? Does this simply mean no process is currently scheduled?

Thanks for your time, I hope to receive some useful insight.

sundialsvcs 01-30-2013 07:53 PM

I doubt that you can get that degree of useful-detail from such a source ... and here is why: whatever results you get will be those of "that particular instant," not plus-or-minus one microsecond later. Perhaps you could tell us more about what your "process management application" needs to do, and to report? Tell us all where you're coming from and where you need to go.

dutchgold92 01-31-2013 10:54 AM

Quote:

Originally Posted by sundialsvcs (Post 4881010)
I doubt that you can get that degree of useful-detail from such a source ... and here is why: whatever results you get will be those of "that particular instant," not plus-or-minus one microsecond later. Perhaps you could tell us more about what your "process management application" needs to do, and to report? Tell us all where you're coming from and where you need to go.

I'm aware of that. One thing I'm trying to do at the moment is display a time line of PIDs that are physically executing on the CPUs across a period of time. I know that ideally I would need to monitor this from the kernel, but it seems as though that can't realistically be done without significant overhead.

I'm looking into this file as a possible simpler solution. If I could instead read this file at short intervals (1 second?), and read from it which PIDs were physically executing at the particular instant the file is generated, that should suffice. I just can't find information as to exactly what the relevant contents of the file indicate.

syg00 02-01-2013 02:42 AM

I had a look at this some time back - just looking for some light reading whilst watching some footy on television .... :p

Basically you'll have to trawl through lkml, and after that you'll discover the attitude seems to be - "read the source". There is damn-all doco on it, and Ingo doesn't seem the least bit interested in changing the situation.

dutchgold92 02-01-2013 05:52 AM

I feared as much, maybe I'll just have to search through the scheduler source to find mention of the file, and hopefully then comprehend how it works.


All times are GMT -5. The time now is 01:39 AM.