Infrastructure:

We were not handling POLLHUP notifications for event file descriptors.
 
 Fix it by filtering entries in the events file descriptor array after
 poll returns, refcounting mmaps so that when the last fd pointing to
 a perf mmap goes away we do the unmap.
 
 User visible:
 
 Now 'record' and 'trace' properly exit when a target thread exits.
 
 Arnaldo Carvalho de Melo (14):
   perf evlist: Introduce perf_evlist__filter_pollfd method
   perf tests: Add test for perf_evlist__filter_pollfd()
   perf evlist: Monitor POLLERR and POLLHUP events too
   perf evlist: We need to poll all event file descriptors
   perf evlist: Allow growing pollfd on add method
   perf tests: Add pollfd growing test
   perf kvm stat live: Use perf_evlist__add_pollfd() instead of local equivalent
   perf evlist: Introduce poll method for common code idiom
   tools lib api: Adopt fdarray class from perf's evlist
   perf evlist: Refcount mmaps
   tools lib fd array: Allow associating an integer cookie with each entry
   perf evlist: Unmap when all refcounts to fd are gone and events drained
   perf record: Filter out POLLHUP'ed file descriptors
   perf trace: Filter out POLLHUP'ed file descriptors
 
 Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJUJI75AAoJENZQFvNTUqpA0TIP/1M8t0AnGhdq2+PtP3z8p3ik
 UP9vaa0T3GnA03jcV3CrjR6KwKXTvJsRrvfFOWjTiLUmIU+3YNLICKaeAfSukARk
 zp17TKP8GBXUur8Lo8VX+dl4lN16axYUBRRCwndWrVzEbG8vZtEe8Fgo/RH5jQ1V
 J19jA7YPubFV9iG4gQjJ0lg+ONuB10QgrwnBjsM5OckT2I37RiYasw6cTHNln0AY
 WRF93S63D+7/798D8zcDR+7c4OBPBJARfxHV8LtoAG/47BTndUHJUxL//kOaQEMf
 UkoNu3DW3KXsBR3BYdwyxo2H6GWyZlquvW6MA+bRLPJBSuelYgXIs7Ogjii6tXZc
 8jJT7EUoegpcr6ircNEkvG4mmLjUReU3DofVqj4nozVZ7NnJbIncCTX2d5PyJ1qV
 1m5EluGyZY0DG4A3pFxK9JnnrC0TTWynqAKvbFTFmLA9Fe39sCLvWVDdKtiBedap
 lj9bgpJnqVh54WiPXSaoZIGJ/fxdlHzAS6hyylclt1S1hnby0WMUM3ZG3kz2nY5S
 64GXGa+Wp0Me3g3lsv0Vv9yU+hBHbhnp97vKfE9Ucd6W1AT387yA9UNDYGiwC/hI
 mp8wPMERqjbaUArjjDvCjqu31fiIQrLz3G+znnhS9x5l8EkJ7ubMAazV9dPgXKmL
 JvS2Um2j5KbXG8d7I8Yi
 =84lL
 -----END PGP SIGNATURE-----

Merge tag 'perf-fdarray-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core

Pull perf tooling updates from Arnaldo Carvalho de Melo.

Infrastructure changes:

  * We were not handling POLLHUP notifications for event file descriptors.

    Fix it by filtering entries in the events file descriptor array after
    poll() returns, refcounting mmaps so that when the last fd pointing to
    a perf mmap goes away we do the unmap. (Arnaldo Carvalho de Melo)

User visible changes:

  * Now 'record' and 'trace' properly exit when a target thread exits.
    (Arnaldo Carvalho de Melo)

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
This commit is contained in:
Ingo Molnar 2014-09-26 11:12:46 +02:00
commit cf8102f64c
17 changed files with 501 additions and 43 deletions