All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hagen Paul Pfeifer <hagen@jauu.net>
To: linux-kernel@vger.kernel.org
Cc: Hagen Paul Pfeifer <hagen@jauu.net>,
	Arnaldo Carvalho de Melo <acme@redhat.com>
Subject: [PATCH 2/2] perf script: add min, max to futex-contention
Date: Mon, 21 Sep 2020 22:19:28 +0200	[thread overview]
Message-ID: <20200921201928.799498-2-hagen@jauu.net> (raw)
In-Reply-To: <20200921201928.799498-1-hagen@jauu.net>

Average is quite informative, but the outliners - especially max - are
also of interest.

Before:

mutex-locker[793299] lock 5637ec61e080 contended 3400 times, 446 avg ns
mutex-locker[793301] lock 5637ec61e080 contended 3563 times, 385 avg ns
mutex-locker[793300] lock 5637ec61e080 contended 3110 times, 1855 avg ns

After:

mutex-locker[795251] lock 55b14e6dd080 contended 3853 times, 1279 avg ns [max: 12270 us, min 340 us]
mutex-locker[795253] lock 55b14e6dd080 contended 2911 times, 518 avg ns [max: 51660261 us, min 347 us]
mutex-locker[795252] lock 55b14e6dd080 contended 3843 times, 385 avg ns [max: 24323998 us, min 338 us]

Signed-off-by: Hagen Paul Pfeifer <hagen@jauu.net>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/scripts/python/futex-contention.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/perf/scripts/python/futex-contention.py b/tools/perf/scripts/python/futex-contention.py
index c440f02627dd..e8a02aecabd9 100644
--- a/tools/perf/scripts/python/futex-contention.py
+++ b/tools/perf/scripts/python/futex-contention.py
@@ -53,5 +53,5 @@ def trace_begin():
 def trace_end():
     for (tid, lock) in lock_waits:
         min, max, avg, count = lock_waits[tid, lock]
-        print("%s[%d] lock %x contended %d times, %d avg ns" %
-              (process_names[tid], tid, lock, count, avg))
+        print("%s[%d] lock %x contended %d times, %d avg ns [max: %d us, min %d us]" %
+              (process_names[tid], tid, lock, count, avg, max, min))
-- 
2.28.0


  reply	other threads:[~2020-09-21 20:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-21 20:19 [PATCH 1/2] perf script: autopep8 futex-contention Hagen Paul Pfeifer
2020-09-21 20:19 ` Hagen Paul Pfeifer [this message]
2020-09-22 20:09   ` [PATCH v2] perf script: add min, max to futex-contention Hagen Paul Pfeifer
2020-09-23 12:31     ` Arnaldo Carvalho de Melo
2020-09-23 12:40       ` Hagen Paul Pfeifer
2020-09-23 14:07         ` Arnaldo Carvalho de Melo

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=20200921201928.799498-2-hagen@jauu.net \
    --to=hagen@jauu.net \
    --cc=acme@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.