Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752147AbdCPLYT (ORCPT ); Thu, 16 Mar 2017 07:24:19 -0400 Received: from terminus.zytor.com ([65.50.211.136]:44664 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751321AbdCPLYR (ORCPT ); Thu, 16 Mar 2017 07:24:17 -0400 Date: Thu, 16 Mar 2017 04:23:30 -0700 From: tip-bot for Alexander Shishkin Message-ID: Cc: tglx@linutronix.de, linux-kernel@vger.kernel.org, jolsa@redhat.com, vincent.weaver@maine.edu, mathieu.poirier@linaro.org, acme@redhat.com, hpa@zytor.com, torvalds@linux-foundation.org, peterz@infradead.org, alexander.shishkin@linux.intel.com, eranian@google.com, acme@infradead.org, mingo@kernel.org Reply-To: hpa@zytor.com, torvalds@linux-foundation.org, eranian@google.com, peterz@infradead.org, alexander.shishkin@linux.intel.com, mingo@kernel.org, acme@infradead.org, tglx@linutronix.de, jolsa@redhat.com, linux-kernel@vger.kernel.org, vincent.weaver@maine.edu, mathieu.poirier@linaro.org, acme@redhat.com In-Reply-To: <20170220133352.17995-4-alexander.shishkin@linux.intel.com> References: <20170220133352.17995-4-alexander.shishkin@linux.intel.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf/core: Add a flag for partial AUX records Git-Commit-ID: ae0c2d995d648d5165545d5e05e2869642009b38 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 Content-Length: 2563 Lines: 61 Commit-ID: ae0c2d995d648d5165545d5e05e2869642009b38 Gitweb: http://git.kernel.org/tip/ae0c2d995d648d5165545d5e05e2869642009b38 Author: Alexander Shishkin AuthorDate: Mon, 20 Feb 2017 15:33:51 +0200 Committer: Ingo Molnar CommitDate: Thu, 16 Mar 2017 09:51:11 +0100 perf/core: Add a flag for partial AUX records The Intel PT driver needs to be able to communicate partial AUX transactions, that is, transactions with gaps in data for reasons other than no room left in the buffer (i.e. truncated transactions). Therefore, this condition does not imply a wakeup for the consumer. To this end, add a new "partial" AUX flag. Signed-off-by: Alexander Shishkin Signed-off-by: Peter Zijlstra (Intel) Cc: Arnaldo Carvalho de Melo Cc: Arnaldo Carvalho de Melo Cc: Jiri Olsa Cc: Linus Torvalds Cc: Mathieu Poirier Cc: Peter Zijlstra Cc: Stephane Eranian Cc: Thomas Gleixner Cc: Vince Weaver Cc: vince@deater.net Link: http://lkml.kernel.org/r/20170220133352.17995-4-alexander.shishkin@linux.intel.com Signed-off-by: Ingo Molnar --- include/uapi/linux/perf_event.h | 1 + kernel/events/ring_buffer.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/include/uapi/linux/perf_event.h b/include/uapi/linux/perf_event.h index bec0aad..d09a9cd 100644 --- a/include/uapi/linux/perf_event.h +++ b/include/uapi/linux/perf_event.h @@ -915,6 +915,7 @@ enum perf_callchain_context { */ #define PERF_AUX_FLAG_TRUNCATED 0x01 /* record was truncated to fit */ #define PERF_AUX_FLAG_OVERWRITE 0x02 /* snapshot from overwrite mode */ +#define PERF_AUX_FLAG_PARTIAL 0x04 /* record contains gaps */ #define PERF_FLAG_FD_NO_GROUP (1UL << 0) #define PERF_FLAG_FD_OUTPUT (1UL << 1) diff --git a/kernel/events/ring_buffer.c b/kernel/events/ring_buffer.c index 9654e55..2831480 100644 --- a/kernel/events/ring_buffer.c +++ b/kernel/events/ring_buffer.c @@ -424,8 +424,8 @@ err: */ void perf_aux_output_end(struct perf_output_handle *handle, unsigned long size) { + bool wakeup = !!(handle->aux_flags & PERF_AUX_FLAG_TRUNCATED); struct ring_buffer *rb = handle->rb; - bool wakeup = !!handle->aux_flags; unsigned long aux_head; /* in overwrite mode, driver provides aux_head via handle */