LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 03-16-2009, 01:21 AM   #1
nisarg
LQ Newbie
 
Registered: Mar 2009
Posts: 3

Rep: Reputation: 0
How to a detect process is running in system call or not?


Hello All,

I have two running processes A and B. After some time, process B stops (SIGSTOP) the process A.

Now, process B wants to determine that - " when the process A was stopped (SIGSTOP), was it (process A) executing some system call or not? "

And if the process A was in system call, then in which system call was it executing?



Thank you and wishing your reply...

from,
Nisarg
 
Old 03-16-2009, 05:33 AM   #2
IND
LQ Newbie
 
Registered: Mar 2009
Posts: 7

Rep: Reputation: 0
Hi,
I understand your problem, when process A executing a system cal then it should be in kernel mode, so if you see an assembly language when context switch happen user mode to kernel mode there is one exception handler, so if you go through it once y may get the answer for your doubt.

Thanks....
 
Old 03-16-2009, 11:33 PM   #3
nisarg
LQ Newbie
 
Registered: Mar 2009
Posts: 3

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by IND View Post
Hi,
I understand your problem, when process A executing a system cal then it should be in kernel mode, so if you see an assembly language when context switch happen user mode to kernel mode there is one exception handler, so if you go through it once y may get the answer for your doubt.

Thanks....
Hi IND,

But, the process B is working via the kernel-module. So, can you tell me "how to detect process-A in system call" in kernel-module?
 
Old 03-18-2009, 06:19 PM   #4
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 9,078
Blog Entries: 4

Rep: Reputation: 3181Reputation: 3181Reputation: 3181Reputation: 3181Reputation: 3181Reputation: 3181Reputation: 3181Reputation: 3181Reputation: 3181Reputation: 3181Reputation: 3181
In the Linux operating-system (vs. a microkernel architecture), "being in supervisor state" might well be equivalent to "executing a system call." But in the most-general case, this may or may not be reliable.

Can you elaborate as to why, and under what conditions, you need to be able to make this determination? Further, does this requirement extend in the general case to a multi-CPU situation? Do you need to consider this on a per-process or per-thread case?
 
  


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 to write a system call to display the process information? balasquare@yahoo.com Programming 3 09-30-2005 01:05 AM
How can I detect if a wine process isn't running? jon_k Linux - Software 1 06-04-2005 11:31 PM
When does process swap happen in a system call? oldfogie Programming 3 05-03-2005 07:35 PM
is there a system call to send process to run in the background? feetyouwell Programming 4 10-01-2004 04:58 AM
linux system call to detect changes in a directory lucianomx Programming 4 06-05-2002 06:54 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 10:33 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