Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp603300ybz; Wed, 29 Apr 2020 06:13:08 -0700 (PDT) X-Google-Smtp-Source: APiQypKKaTRYEBcKy2hbuivcbcO0+XT8E99wnEFdLh+79C9vxE3j/aC3bTX2ndB2Pmg3sus7pyDA X-Received: by 2002:a50:874b:: with SMTP id 11mr2286205edv.384.1588165987892; Wed, 29 Apr 2020 06:13:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588165987; cv=none; d=google.com; s=arc-20160816; b=We3mrByLh+rkLU49heUfqABLy9nq0BB6ne97ST6RlIJwo9TEx9as7Fg844hGla9H7w Cwz9nUDSFFy31OHXpuwEpHj4jTNNB37hTr9M96V4JWBgNurDqgpb/PpmfjAFxI9IvXnn PUQl5SIckh5E5vFE+q/ys3fYSesdfrnP1liFdxQ4i9xfBwYcQfakb19Qml0fRKYJNGVz +fYbPPpTccI7cmcqxi7qAsaHK1koxCnbH587MicCSRHzdIMv+ujTc7KkYPhqMWUlmyxX wvYfV/GXaGiUm2qT0Qxfesbnd2CAzUwczLrypNrPJ5jDHnFnSjtREUtB06J+M15UX9Ux 1QtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=18lk7pKOOAbs0oo8+n1tmbSWcbxMVjEVjaLvApdETgg=; b=FL1RJE1ai4b161A3hrs9fvWtT5otv91+mjiO3x0Ug6a6JwkAQPBDNMewhCwAShKIyO eHLIvEoWHQo5q0Vzi+BDeNurMJmXy09fxITCG2jT4bK17uOANwaMv4c2kNoOnsC9ZSFd yUXfU6z33jFTROnN8OTLTEgKnWi5lncsK1sjgF+Mqj/Rx3VDpBYCfHQdEv/slzlDaHLE zW+wL01OXE0wSE99Rf0BAjNcdxtgW40CTzNaRutNUPZC5dEZQ0vkms2EXLpCX1sJcY0R TGFsyjWaG/s8aNEJRRDuG2RQJj3GT582TwIZZDDKttRLGVaQBLfMAFOy5IS+NqN+PTD8 tG8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=U5MNTIS1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z16si3429162edm.215.2020.04.29.06.12.42; Wed, 29 Apr 2020 06:13:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=U5MNTIS1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726905AbgD2NLO (ORCPT + 99 others); Wed, 29 Apr 2020 09:11:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:47444 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726617AbgD2NLO (ORCPT ); Wed, 29 Apr 2020 09:11:14 -0400 Received: from quaco.ghostprotocols.net (unknown [179.97.37.151]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B532121D93; Wed, 29 Apr 2020 13:11:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588165873; bh=6IXkE1cnWFyVqOyK/FQYm2XXLLmRWPsdtD52ivzRHvI=; h=From:To:Cc:Subject:Date:From; b=U5MNTIS1/5uYGYDP6VdEHaq37mLdGvPGaPFlkMU9zo3JpChB976KM+CS5ncl5ms8F gIOVCbZ9L5yEfXhaL6MqfU0LIJb3LKx7KzeekpxakwuICXoK4FmyTzObzkkJK9sre+ CQBpC4VKqtqwlZ520uLmtzegt66hCLzij/RnnJ7c= From: Arnaldo Carvalho de Melo To: Jiri Olsa , Namhyung Kim Cc: Ingo Molnar , Thomas Gleixner , Clark Williams , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, Arnaldo Carvalho de Melo , Adrian Hunter , Song Liu , Wang Nan Subject: [RFC PATCHSET v2] Implement --switch-output-event Date: Wed, 29 Apr 2020 10:10:58 -0300 Message-Id: <20200429131106.27974-1-acme@kernel.org> X-Mailer: git-send-email 2.21.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi guys, Please consider reviewing, this addresses comments by Jiri in the V1. Again, the example provided is too simple, using 'perf probe' to put probes in specific places in some workload to then get any other event close to the time the trigger hits comes to mind as well, using the signal was just to reuse the pre-existing logic and keep the patchkit small. One other thing that occurred to me while testing is that this can be combined with 'perf report/perf script' --switch-off option: $ perf report -h --switch-off Usage: perf report [] --switch-off Stop considering events after the ocurrence of this event $ To remove from consideration the events that end up being recorded in the ring buffer after the --switch-output-event but gets in the ring buffer because we process the --switch-output-event asynchronously. Its available at: git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git perf/switch-output-event Best regards, - Arnaldo Arnaldo Carvalho de Melo (8): perf record: Move sb_evlist to 'struct record' perf top: Move sb_evlist to 'struct perf_top' perf bpf: Decouple creating the evlist from adding the SB event perf parse-events: Add parse_events_option() variant that creates evlist perf evlist: Allow reusing the side band thread for more purposes libsubcmd: Introduce OPT_CALLBACK_SET() perf record: Introduce --switch-output-event perf record: Move side band evlist setup to separate routine tools/lib/subcmd/parse-options.h | 2 + tools/perf/Documentation/perf-record.txt | 13 ++++ tools/perf/builtin-record.c | 75 ++++++++++++++++++++---- tools/perf/builtin-top.c | 20 +++++-- tools/perf/util/bpf-event.c | 3 +- tools/perf/util/bpf-event.h | 7 +-- tools/perf/util/evlist.c | 39 +++++++----- tools/perf/util/evlist.h | 3 +- tools/perf/util/parse-events.c | 23 ++++++++ tools/perf/util/parse-events.h | 1 + tools/perf/util/top.h | 2 +- 11 files changed, 151 insertions(+), 37 deletions(-) -- 2.21.1