RE: Linux Security Module and System Response Time Tracking

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Lin Wrote:
>Hi all,
>
>I would like to track the system response time on kernel 2.6.
>
>Does anyone know if use Linux Security Module (LSM) mechanism is a good
way to track the system response time?
>
>My idea is to hook some system calls as open, read and write operations
and log the status (for instance the current >time) of each one to a
file and after that post process the log file to figure out the system
response time. Is it >feasible?
>
>BR,
>
>Mauricio Lin

Dear Lin,

I have the small sample code which will print the time wherever you want
to print it. I used it in my modules for getting the time value to
compare the performance of the code.

static unsigned int ms = 0;
static struct timeval start_tm,cur_tm;

do_gettimeofday(&start_tm);
ms = (cur_tm.tv_sec*1000000+cur_tm.tv_usec)-
(start_tm.tv_sec*1000000+start_tm.tv_usec) + 1;
printk("%10ld.%3ld ms",ms/1000, ms%1000);

Call the system call
	
do_gettimeofday( &cur_tm );
ms = (cur_tm.tv_sec*1000000+cur_tm.tv_usec)-
(start_tm.tv_sec*1000000+start_tm.tv_usec) + 1;
printk("%10ld.%3ld ms",ms/1000, ms%1000);

Regards,
Srinivas G



--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux