mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: sounak chakraborty <sounakrin@yahoo.co.in>
To: linux-kernel@vger.kernel.org
Subject: problem with tsk->mm in exit.c
Date: Tue, 11 Jan 2005 10:59:29 +0000 (GMT)	[thread overview]
Message-ID: <20050111105929.84325.qmail@web53305.mail.yahoo.com> (raw)

  
  dear sir
i want to get the information when a thread gets
exited from the system .so i wrote some printk at the
beginning of do_exit in kernel/exit.c.like of
tsk->pid.
now as i have to check over there that it is kernel
thread or user thread so i am putting a if statement
like
if(tsk->flags & CLONE_VM)  //for the checking of
threads
  {
     if(tsk->mm==NULL)   //for the checking of kernel
threads
      printk(kernel thread exiting);
     else
      printk(user thread exiting);
    }
but here aises the problem when i have finished
compilling the output shows every thread as user.i.e
"user thread exiting

that means in somewhere after do_fork in
/kernel/fork.c
the p->mm is getting filled in case of kernel thread.
so is there any other way so that i can distinguish
between
the user level and kernel level in do_exit()in
/kernel/exit.c
or i have to place my sample code in somewhere else 
so that i can find the values while terminating the
threads with the proper distinction between user level
threads and kernel level threads

thanks in advance
sounak 


________________________________________________________________________
Yahoo! India Matrimony: Find your partner online. http://yahoo.shaadi.com/india-matrimony/

                 reply	other threads:[~2005-01-11 10:59 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050111105929.84325.qmail@web53305.mail.yahoo.com \
    --to=sounakrin@yahoo.co.in \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®