This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Fw: systemtap application to find applications doing polling


* Maneesh Soni <maneesh@in.ibm.com> [2009-01-29 22:16:43]:

> 
> Is this something useful for energy management?

Hi Maneesh,

This would be useful for energy management as Ulrich has noted in his
blog.  The rate of wake up is reposted by PowerTop using
/proc/timer_list where even the device driver timers and in kernel
offenders are also identified.

Once the userspace application is identified, then further details on
the type of polling loops and syscall and library APIs will definitely
help optimise the user applications.

Will's script will help to identify types of polling loops and top
offenders at run time in an user space application.
 
> ----- Forwarded message from William Cohen <wcohen@redhat.com> -----
> 
> Date: Wed, 28 Jan 2009 11:52:10 -0500
> From: William Cohen <wcohen@redhat.com>
> To: SystemTAP <systemtap@sources.redhat.com>
> CC: Ulrich Drepper <drepper@redhat.com>
> Subject: systemtap application to find applications doing polling
> 
> Hi All,
> 
> Uli Drepper mentions in a blog entry need "avoid unnecessary wakeups" and that a
> systemtap script to monitor this would be useful:
> 
> http://udrepper.livejournal.com/19041.html
> 
> I talked with Uli about developing the script that identify the processes that
> are doing a lot of polling.  The attached script, timeout.stp, monitors the
> poll, epoll_wait,  select, futex, nanosleep, timer (it_real_fn). The poll and
> epoll are only recorded if the timeout value is greater than zero. The resulting
> output is displayed in a top-like format for the top twenty processes with the
> entries ordered from most problem calls to fewest. The columns indicate the
> count of each type. The output ends up like the following:
> 
>   uid |   poll  select   epoll  itimer   futex nanosle  signal| process
>  2628 |      0     364       0       0       0       0       0| Xorg
>  3586 |     21       0       0       0     179       0       0| thunderbird-bin
>  3575 |     41       0       0       0       0      20       0| xchat
>  3454 |      0      60       0       0       0       0       0| emacs
>  3325 |     43       0       0       0       0       0       0| gnome-terminal
>  3082 |     11       0       0       0       0       0       0| gnome-panel
>  3068 |      7       0       0       0       0       0       0| metacity
>  3181 |      6       0       0       0       0       0       0| wnck-applet
>  3119 |      0       5       0       0       0       0       0| httpd
>  2135 |      4       0       0       0       0       0       0| hald
>  2307 |      4       0       0       0       0       0       0| NetworkManager
>  2362 |      4       0       0       0       0       0       0| setroubleshootd
>  2530 |      0       0       0       0       0       4       0| cups-polld
>  3084 |      3       0       0       0       0       0       0| nautilus
>  3616 |      0       0       0       0       3       0       0| firefox
>  3060 |      2       0       0       0       0       0       0| gnome-settings-
>  2304 |      2       0       0       0       0       0       0| hald-addon-stor
>     0 |      0       0       0       1       0       0       0| swapper
> 
> I plan to check this into systemtap.examples directory in next day or so. Just
> looking to see if people have additional suggestions.
> 
> -Will

This output information and format is good, while I have the following
comments and suggestion:

* Display the observation interval in the output and provide options
  for say 1s or 10s sampling
* At low wakeup rate does the system tap script itself add to the
  wakeups?
* Does these values match closely with PowerTop?
* Can we aggregate these values for a group of PIDs (possibly
  parent pid or tgid) so that we can collect results for a complete
  application stack easily.  I have tried doing this by manually
  adding up wake-ups for a group of PIDs
* Another wishlist item would be to be able to add a probe at various
  locations in library and move closer to userspace code. 

I am a kernel developer and a powertop user.  This systemtap script
seems to open-up possibilities for a flexible and extensible method to
collect wakeup rate for applications.

Thanks
Vaidy

PS: Please explicitly CC me since I am not subscribed to
systemtap@sources.redhat.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]