kernel qs:system call execution in entry.S

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

 



Hello,

I had a question regarding making some changes to the execution of system
calls. I am relatively new to kernel programming and the working of the
kernel and wanted to make sure, that my modifications will not have
serious consequences in some other part of the kernel. ( dont want to see
smoke from the cpu :) )

I wanted to monitor the execution of system calls, mainly I want to record
when system calls fail and make note of those. I need to check the return
value in EAX register and if the call returned an error, increment a
counter and set some flags and may be write it to a file. I need to store
how many calls fail for a particular process. I have coded the
part which does the stuff that I need to, but I am not sure where
should I make a call to this function. I think this is to be done in
entry.S, immediately after the call indexing the sys_call table returns
and the return value of the sys call is saved.

>From entry.S ->

ENTRY(system_call)
   :
   :
   :
 jne tracesys
 cmpl $(NR_syscalls), %eax
 jae badsys
 call *SYMBOL_NAME(sys_call_table)(,%eax,4)
 movl %eax,EAX(%esp)
# is this where i can make a call to my funct ?

ENTRY(ret_from_sys_call)
  :
  :
  :

This question is probably meant for the kernel related mailing lists and
I apologize for placing it here.

Thank you.

Ashish.

Graduate Student
Dept of Computer Science
Rochester Institute of Technology


-- 
redhat-list mailing list
unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list

[Index of Archives]     [CentOS]     [Kernel Development]     [PAM]     [Fedora Users]     [Red Hat Development]     [Big List of Linux Books]     [Linux Admin]     [Gimp]     [Asterisk PBX]     [Yosemite News]     [Red Hat Crash Utility]


  Powered by Linux