From: Greg KH <greg@kroah.com>
To: Pintu Agarwal <pintu.ping@gmail.com>
Cc: juri.lelli@redhat.com,
Kernelnewbies <kernelnewbies@kernelnewbies.org>,
peterz@infradead.org, open list <linux-kernel@vger.kernel.org>,
mingo@redhat.com, Johannes Weiner <hannes@cmpxchg.org>
Subject: Re: kernel space: finding cpu usage of individual process/thread
Date: Thu, 24 Mar 2022 08:16:15 +0100 [thread overview]
Message-ID: <Yjwav36K8D+8yPli@kroah.com> (raw)
In-Reply-To: <CAOuPNLhB8pojv4wqv6d4FvhoBbNvUxD19ciK-6E8HtbbrnjF9g@mail.gmail.com>
On Wed, Mar 23, 2022 at 09:15:16PM +0530, Pintu Agarwal wrote:
> Hi,
>
> For one of my requirements I need to find cpu usage or load_avg of an
> individual process or thread using "for_each_process_thread(process,
> thread)" where process/thread is a pointer to "task_struct".
Who is making such a crazy requirement?
Have you looked at how normal tools get this information today? We have
loads of userspace examples and libraries that provide you this
information, no need to reinvent the wheel.
Unless this is a homework assignment. Then that's up to you to solve,
not us :)
good luck!
greg k-h
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
prev parent reply other threads:[~2022-03-24 7:16 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-23 15:45 kernel space: finding cpu usage of individual process/thread Pintu Agarwal
2022-03-24 7:16 ` Greg KH [this message]
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=Yjwav36K8D+8yPli@kroah.com \
--to=greg@kroah.com \
--cc=hannes@cmpxchg.org \
--cc=juri.lelli@redhat.com \
--cc=kernelnewbies@kernelnewbies.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=pintu.ping@gmail.com \
/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;
as well as URLs for NNTP newsgroup(s).