LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > General > LinuxQuestions.org Member Intro
User Name
Password
LinuxQuestions.org Member Intro New to LinuxQuestions.org? Been a long time member but never made a post? Introduce yourself here.

Notices

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

Rep: Reputation: 0
Adding a profiler to linux kernel scheduler


Please help me......

I need to build a profiler for the Linux kernel scheduler.
I need 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 _le (/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
 
Old 09-29-2004, 07:31 AM   #2
Aussie
Senior Member
 
Registered: Sep 2001
Location: Brisvegas, Antipodes
Distribution: Slackware
Posts: 4,590

Rep: Reputation: 56
Please do not post the same thread in more than one forum. Picking the most relevant forum and posting it once there makes it easier for other members to help you and keeps the discussion all in one place.

http://www.linuxquestions.org/rules.php
 
  


Closed Thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
building a profiler for linux kernel scheduler svi_ya Programming 0 09-28-2004 04:23 PM
Best I/O Scheduler for a Desktop System w/ 2.6.6 kernel haimeltjnfg Linux - Software 4 05-22-2004 09:09 PM


All times are GMT -5. The time now is 05:16 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration