Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3087674yba; Tue, 16 Apr 2019 04:34:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqzVUfHGNuDA/vEYlaxEmgVVYmiXVJKgAD8fx+fWdgLgixnrSx5rvK8a+X+ZhcQLx+1VaNPj X-Received: by 2002:a17:902:2aa8:: with SMTP id j37mr18278154plb.164.1555414484506; Tue, 16 Apr 2019 04:34:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555414484; cv=none; d=google.com; s=arc-20160816; b=R2MVYYio4DnzWfSfR8uljnc2r5BF7ASE5kOKJAaEIf/QPnTqJpBKbfY6myGc5lkiPd 3YS+OrZckHs+AP5c6YwujQ3ohuIfdGayNkbN8pGaxhbPX2QhY+03Hw4LlUsRxj28E29u TadHNYX19coFJKG0cVcpalwX4/lCXEEbS0/SwaIX2nHV2vr1WtzGa3aHGqZMNYeWtHOy wOP44cPcVAVwj0VMsXnXmFC7H827VEVSt0Et9nnw1vj2WjkPjdb4596XZRNYkh7AKfNl RjYLUm79vsK6kTircus9ts2KV/kO/Jv/oSRF6JUWdUYyjd9SWbE2c1kA9BHI/8aFR+fy +FRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date; bh=Y48JeJCtfoFQ+9yMznOGBI+phNxWA1+tRX5nZZy3A00=; b=vseWYkvgQAZ20opdVFsEgYIFpEwfQA5DmwK0Dl/94f+DV140cg2ezhqEWgvuC7HQga HJOy+cmjX5at5IxKF2mf5uBD1lFX7feT38fPveZ3oN8bhd+zFB/Z8Urd11qhwLSFospP Yt8gWcJVxAs5S8X2td138VEs86gv69vvtO4GFwK8MR1Og1kyXTVduqROTThFmaI6lsEs S2uJNFYEkocmVNadnbi/dPbk491er38peeMWqvfGD1IuLEIkRv3tcVG8WKlzmArXNTQJ 2TCt8Fv/PA3mUnO2fjDjHbA/u73U90h8dBA7ET85wOO3t4Kr07fZcpNYS+LqxnV/YaT7 U5MQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v16si16463326plo.36.2019.04.16.04.34.28; Tue, 16 Apr 2019 04:34:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729157AbfDPLcI (ORCPT + 99 others); Tue, 16 Apr 2019 07:32:08 -0400 Received: from terminus.zytor.com ([198.137.202.136]:33703 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726816AbfDPLcH (ORCPT ); Tue, 16 Apr 2019 07:32:07 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id x3GBVhYl3427739 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Tue, 16 Apr 2019 04:31:43 -0700 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id x3GBVgxk3427736; Tue, 16 Apr 2019 04:31:42 -0700 Date: Tue, 16 Apr 2019 04:31:42 -0700 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Alexander Shishkin Message-ID: Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, alexander.shishkin@linux.intel.com, mingo@kernel.org, hpa@zytor.com, vincent.weaver@maine.edu, tglx@linutronix.de, torvalds@linux-foundation.org, acme@redhat.com, peterz@infradead.org, jolsa@redhat.com, Ben.Gainey@arm.com, eranian@google.com Reply-To: stable@vger.kernel.org, acme@redhat.com, torvalds@linux-foundation.org, linux-kernel@vger.kernel.org, peterz@infradead.org, alexander.shishkin@linux.intel.com, jolsa@redhat.com, hpa@zytor.com, mingo@kernel.org, Ben.Gainey@arm.com, eranian@google.com, vincent.weaver@maine.edu, tglx@linutronix.de In-Reply-To: <20190329091338.29999-1-alexander.shishkin@linux.intel.com> References: <20190329091338.29999-1-alexander.shishkin@linux.intel.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf/ring_buffer: Fix AUX record suppression Git-Commit-ID: 339bc4183596e1f68c2c98a03b87aa124107c317 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 X-Spam-Status: No, score=0.1 required=5.0 tests=ALL_TRUSTED,BAYES_00, DATE_IN_FUTURE_03_06 autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 339bc4183596e1f68c2c98a03b87aa124107c317 Gitweb: https://git.kernel.org/tip/339bc4183596e1f68c2c98a03b87aa124107c317 Author: Alexander Shishkin AuthorDate: Fri, 29 Mar 2019 11:13:38 +0200 Committer: Ingo Molnar CommitDate: Tue, 16 Apr 2019 12:13:57 +0200 perf/ring_buffer: Fix AUX record suppression The following commit: 1627314fb54a33e ("perf: Suppress AUX/OVERWRITE records") has an unintended side-effect of also suppressing all AUX records with no flags and non-zero size, so all the regular records in the full trace mode. This breaks some use cases for people. Fix this by restoring "regular" AUX records. Reported-by: Ben Gainey Tested-by: Ben Gainey Signed-off-by: Alexander Shishkin Signed-off-by: Peter Zijlstra (Intel) Cc: Cc: Arnaldo Carvalho de Melo Cc: Jiri Olsa Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Stephane Eranian Cc: Thomas Gleixner Cc: Vince Weaver Fixes: 1627314fb54a33e ("perf: Suppress AUX/OVERWRITE records") Link: https://lkml.kernel.org/r/20190329091338.29999-1-alexander.shishkin@linux.intel.com Signed-off-by: Ingo Molnar --- kernel/events/ring_buffer.c | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/kernel/events/ring_buffer.c b/kernel/events/ring_buffer.c index 2545ac08cc77..5eedb49a65ea 100644 --- a/kernel/events/ring_buffer.c +++ b/kernel/events/ring_buffer.c @@ -455,24 +455,21 @@ void perf_aux_output_end(struct perf_output_handle *handle, unsigned long size) rb->aux_head += size; } - if (size || handle->aux_flags) { - /* - * Only send RECORD_AUX if we have something useful to communicate - * - * Note: the OVERWRITE records by themselves are not considered - * useful, as they don't communicate any *new* information, - * aside from the short-lived offset, that becomes history at - * the next event sched-in and therefore isn't useful. - * The userspace that needs to copy out AUX data in overwrite - * mode should know to use user_page::aux_head for the actual - * offset. So, from now on we don't output AUX records that - * have *only* OVERWRITE flag set. - */ - - if (handle->aux_flags & ~(u64)PERF_AUX_FLAG_OVERWRITE) - perf_event_aux_event(handle->event, aux_head, size, - handle->aux_flags); - } + /* + * Only send RECORD_AUX if we have something useful to communicate + * + * Note: the OVERWRITE records by themselves are not considered + * useful, as they don't communicate any *new* information, + * aside from the short-lived offset, that becomes history at + * the next event sched-in and therefore isn't useful. + * The userspace that needs to copy out AUX data in overwrite + * mode should know to use user_page::aux_head for the actual + * offset. So, from now on we don't output AUX records that + * have *only* OVERWRITE flag set. + */ + if (size || (handle->aux_flags & ~(u64)PERF_AUX_FLAG_OVERWRITE)) + perf_event_aux_event(handle->event, aux_head, size, + handle->aux_flags); rb->user_page->aux_head = rb->aux_head; if (rb_need_aux_wakeup(rb))