From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753093AbbGaNx4 (ORCPT ); Fri, 31 Jul 2015 09:53:56 -0400 Received: from terminus.zytor.com ([198.137.202.10]:57127 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752206AbbGaNxs (ORCPT ); Fri, 31 Jul 2015 09:53:48 -0400 Date: Fri, 31 Jul 2015 06:53:12 -0700 From: tip-bot for Arnaldo Carvalho de Melo Message-ID: Cc: namhyung@kernel.org, jeder@redhat.com, linux-kernel@vger.kernel.org, peterz@infradead.org, acme@redhat.com, lcapitulino@redhat.com, tglx@linutronix.de, adrian.hunter@intel.com, dsahern@gmail.com, mingo@kernel.org, hpa@zytor.com, jskarvad@redhat.com, jolsa@redhat.com, eranian@google.com, bp@suse.de, fweisbec@gmail.com Reply-To: adrian.hunter@intel.com, tglx@linutronix.de, hpa@zytor.com, jskarvad@redhat.com, jolsa@redhat.com, bp@suse.de, eranian@google.com, fweisbec@gmail.com, dsahern@gmail.com, mingo@kernel.org, peterz@infradead.org, namhyung@kernel.org, linux-kernel@vger.kernel.org, jeder@redhat.com, lcapitulino@redhat.com, acme@redhat.com To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf python: Make twatch.py use soft dummy event, freq=0 Git-Commit-ID: 58b32c1b538f2d197ce385d6a314e83f8b787021 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 58b32c1b538f2d197ce385d6a314e83f8b787021 Gitweb: http://git.kernel.org/tip/58b32c1b538f2d197ce385d6a314e83f8b787021 Author: Arnaldo Carvalho de Melo AuthorDate: Mon, 27 Jul 2015 17:13:21 -0300 Committer: Arnaldo Carvalho de Melo CommitDate: Wed, 29 Jul 2015 10:51:45 -0300 perf python: Make twatch.py use soft dummy event, freq=0 To not sample, what we want are just the PERF_RECORD_ lifetime events for threads, using the default, PERF_TYPE_HARDWARE + PERF_COUNT_HW_CYCLES and freq=1 (the default), makes perf reenable irq_vectors:local_timer_entry, disabling nohz, not good for some use cases where all we want is to get notifications when threads comes and goes... Fix it by using PERF_TYPE_SOFTWARE (no counter rotation) and PERF_COUNT_SW_DUMMY (created by Adrian so that we could have access to those PERF_RECORD_ goodies). Reported-by: Luiz Fernando Capitulino Suggested-by: Peter Zijlstra Cc: Adrian Hunter Cc: Borislav Petkov Cc: David Ahern Cc: Frederic Weisbecker Cc: Jaroslav Skarvada Cc: Jeremy Eder Cc: Jiri Olsa Cc: Namhyung Kim Cc: Stephane Eranian Link: http://lkml.kernel.org/n/tip-kfsijirfrs6xfhkcdxeoen06@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/python/twatch.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tools/perf/python/twatch.py b/tools/perf/python/twatch.py index 2225162..b9d5083 100755 --- a/tools/perf/python/twatch.py +++ b/tools/perf/python/twatch.py @@ -18,10 +18,20 @@ import perf def main(): cpus = perf.cpu_map() threads = perf.thread_map() - evsel = perf.evsel(task = 1, comm = 1, mmap = 0, + evsel = perf.evsel(type = perf.TYPE_SOFTWARE, + config = perf.COUNT_SW_DUMMY, + task = 1, comm = 1, mmap = 0, freq = 0, wakeup_events = 1, watermark = 1, sample_id_all = 1, sample_type = perf.SAMPLE_PERIOD | perf.SAMPLE_TID | perf.SAMPLE_CPU) + + """What we want are just the PERF_RECORD_ lifetime events for threads, + using the default, PERF_TYPE_HARDWARE + PERF_COUNT_HW_CYCLES & freq=1 + (the default), makes perf reenable irq_vectors:local_timer_entry, when + disabling nohz, not good for some use cases where all we want is to get + threads comes and goes... So use (perf.TYPE_SOFTWARE, perf_COUNT_SW_DUMMY, + freq=0) instead.""" + evsel.open(cpus = cpus, threads = threads); evlist = perf.evlist(cpus, threads) evlist.add(evsel)