LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-28-2009, 02:28 AM   #1
aloktiagi
LQ Newbie
 
Registered: Jul 2009
Posts: 20

Rep: Reputation: 0
what are the system calls used by vmstat command?


i need the system calls used by vmstat command on its execution.
please help
thanks

Last edited by aloktiagi; 07-28-2009 at 02:39 AM.
 
Old 07-28-2009, 03:12 AM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 15,034

Rep: Reputation: 1912Reputation: 1912Reputation: 1912Reputation: 1912Reputation: 1912Reputation: 1912Reputation: 1912Reputation: 1912Reputation: 1912Reputation: 1912Reputation: 1912
First post - sounds like homework. LQ has rules regarding that.
What have you tried, what didn't work ?.
 
Old 07-28-2009, 03:23 AM   #3
aloktiagi
LQ Newbie
 
Registered: Jul 2009
Posts: 20

Original Poster
Rep: Reputation: 0
i have tried giving strace vmstat

but that just gives me the function calls with parameters

i need the system calls made by vmstat as i need them for my code in C
 
Old 07-28-2009, 03:43 AM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 15,034

Rep: Reputation: 1912Reputation: 1912Reputation: 1912Reputation: 1912Reputation: 1912Reputation: 1912Reputation: 1912Reputation: 1912Reputation: 1912Reputation: 1912Reputation: 1912
The function calls are C code - they ensure that the ensuing system call is properly constructed. For userspace code that is what you should probably use.
Why do you think you need to make direct system calls ?.
 
Old 07-28-2009, 03:53 AM   #5
aloktiagi
LQ Newbie
 
Registered: Jul 2009
Posts: 20

Original Poster
Rep: Reputation: 0
i need to write a code to simulate vmstat command

either i can use /proc file system to get the details of all the processes and memory usage
or
i make use of the system calls made by vmstat on its execution,making use of the libraries available in C/C++

the second option is the one i'm interested in
please also tell about userspace you had mentioned

thank you
 
Old 07-28-2009, 04:54 AM   #6
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 15,034

Rep: Reputation: 1912Reputation: 1912Reputation: 1912Reputation: 1912Reputation: 1912Reputation: 1912Reputation: 1912Reputation: 1912Reputation: 1912Reputation: 1912Reputation: 1912
f you don't believe strace that vmstat uses /proc, have a look at the source.
 
Old 07-28-2009, 05:04 AM   #7
aloktiagi
LQ Newbie
 
Registered: Jul 2009
Posts: 20

Original Poster
Rep: Reputation: 0
so i can just give $cat /proc/cpuinfo in the c code

i'm short of time. so then what does the source code consist of, if i can get the info with the above command

thank you
 
  


Reply


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
how does java calls the system calls which are written in c babu198649 Linux - General 3 12-05-2011 04:40 AM
Changing the hierarchy of system calls executed in response to a command ipshita Programming 7 05-01-2009 08:24 AM
user command,system calls and func like... goldeneagle1234 Linux - Newbie 1 09-14-2008 06:30 AM
A command on shell which does not make system calls piyush masrani Linux - General 12 07-26-2008 08:54 AM


All times are GMT -5. The time now is 08:55 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration