[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Yjwav36K8D+8yPli@kroah.com>
Date: Thu, 24 Mar 2022 08:16:15 +0100
From: Greg KH <greg@...ah.com>
To: Pintu Agarwal <pintu.ping@...il.com>
Cc: open list <linux-kernel@...r.kernel.org>,
Kernelnewbies <kernelnewbies@...nelnewbies.org>,
Johannes Weiner <hannes@...xchg.org>, mingo@...hat.com,
peterz@...radead.org, juri.lelli@...hat.com
Subject: Re: kernel space: finding cpu usage of individual process/thread
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
Powered by blists - more mailing lists