LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 09-28-2004, 04:23 PM   #1
svi_ya
LQ Newbie
 
Registered: Sep 2004
Posts: 2

Rep: Reputation: 0
building a profiler for linux kernel scheduler


Please help me with this...

I need to build a profiler for the Linux kernel scheduler.
I have to add code to the existing Linux kernel's schedule() function so that upon every 1000th call, a sequence of information is
printed to the system log file (/var/log/messages). This information should include:
_ the PID of the process currently running on the CPU being scheduled for,
_ the total number of tasks in the active runqueue,
_ the total number of tasks in the expired runqueue,
_ the total number of tasks waiting for I/O,
_ for each possible priority:
{ if there are no processes with this priority, do nothing
{ if there are processes with this priority, then print out:
_ the priority value,
_ for each active process of this priority:
_ the process ID,
_ the executable name,
_ the time slice left,
_ the static priority,
_ the dynamic priority,
_ the interactivity count.
_ the same for each expired process of this priority.

Example Output
After booting your kernel, sections similar to this should show up in /var/log/messages:
Sep 13 15:14:42 bluehen kernel: ~~~~~~~~~ BEGIN SCHEDULER PROFILE ~~~~~~~~~
Sep 13 15:14:42 bluehen kernel: The pid running right now is 4633
Sep 13 15:14:42 bluehen kernel: The number of active tasks is 3
Sep 13 15:14:42 bluehen kernel: The number of expired tasks is 6
Sep 13 15:14:42 bluehen kernel: The number of tasks waiting on I/O is 0
Sep 13 15:14:42 bluehen kernel: =====PRIORITY: 115====
Sep 13 15:14:42 bluehen kernel: 4633(netscape-bin), TSL=106, PRS=120, PRD=115, I
C=101
Sep 13 15:14:42 bluehen kernel: ------
Sep 13 15:14:42 bluehen kernel: =====PRIORITY: 125====
Sep 13 15:14:42 bluehen kernel: ------
Sep 13 15:14:42 bluehen kernel: 4573(a.out), TSL=102, PRS=120, PRD=125, IC=-101,
Sep 13 15:14:42 bluehen kernel: 4572(a.out), TSL=102, PRS=120, PRD=125, IC=-101
Sep 13 15:14:42 bluehen kernel: =====PRIORITY: 135====
Sep 13 15:14:42 bluehen kernel: ------
Sep 13 15:14:42 bluehen kernel: 4560(a.out), TSL=53, PRS=130, PRD=135, IC=-101

thanks
-v
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
1600x1200@90 with nvidia / Kernel IO Scheduler? zord Slackware 5 05-13-2005 06:54 PM
Linux System Profiler kazu Linux - Software 3 04-21-2005 12:31 AM
Memory profiler in Linux Franziss Programming 1 02-18-2005 12:29 PM
Adding a profiler to linux kernel scheduler svi_ya LinuxQuestions.org Member Intro 1 09-29-2004 07:31 AM
Best I/O Scheduler for a Desktop System w/ 2.6.6 kernel haimeltjnfg Linux - Software 4 05-22-2004 09:09 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:52 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration