Re: kernel space: finding cpu usage of individual process/thread

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

 



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@xxxxxxxxxxxxxxxxx
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]

  Powered by Linux