Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1584626

[PATCH 3/4] perf: Add a flag for partial AUX records

From Alexander Shishkin <alexander.shishkin@linux.intel.com>
Newsgroups linux.kernel
Subject [PATCH 3/4] perf: Add a flag for partial AUX records
Date 2017-02-20 14:50 +0100
Message-ID <tcWvM-5kr-17@gated-at.bofh.it> (permalink)
References <tcWm6-5gN-23@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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.

Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
---
 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 c66a485a24..8306415207 100644
--- a/include/uapi/linux/perf_event.h
+++ b/include/uapi/linux/perf_event.h
@@ -885,6 +885,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 f3ebafe060..cd5e902a27 100644
--- a/kernel/events/ring_buffer.c
+++ b/kernel/events/ring_buffer.c
@@ -425,8 +425,8 @@ EXPORT_SYMBOL_GPL(perf_aux_output_begin);
  */
 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 */
-- 
2.11.0

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/4] perf, pt, coresight: AUX flags and VMX update Alexander Shishkin <alexander.shishkin@linux.intel.com> - 2017-02-20 14:40 +0100
  [PATCH 2/4] perf: Keep AUX flags in the output handle Alexander Shishkin <alexander.shishkin@linux.intel.com> - 2017-02-20 14:50 +0100
    Re: [PATCH 2/4] perf: Keep AUX flags in the output handle Mathieu Poirier <mathieu.poirier@linaro.org> - 2017-02-20 21:50 +0100
    Re: [PATCH 2/4] perf: Keep AUX flags in the output handle Will Deacon <will.deacon@arm.com> - 2017-02-21 11:50 +0100
      Re: [PATCH 2/4] perf: Keep AUX flags in the output handle Alexander Shishkin <alexander.shishkin@linux.intel.com> - 2017-02-21 12:00 +0100
  [PATCH 1/4] perf: Export AUX buffer helpers to modules Alexander Shishkin <alexander.shishkin@linux.intel.com> - 2017-02-20 14:50 +0100
  [PATCH 3/4] perf: Add a flag for partial AUX records Alexander Shishkin <alexander.shishkin@linux.intel.com> - 2017-02-20 14:50 +0100
  [PATCH 4/4] perf/x86/intel/pt: Handle VMX better Alexander Shishkin <alexander.shishkin@linux.intel.com> - 2017-02-20 15:00 +0100
  Re: [PATCH 0/4] perf, pt, coresight: AUX flags and VMX update Alexander Shishkin <alexander.shishkin@linux.intel.com> - 2017-02-20 16:30 +0100
    Re: [PATCH 0/4] perf, pt, coresight: AUX flags and VMX update Adrian Hunter <adrian.hunter@intel.com> - 2017-02-20 16:50 +0100
      Re: [PATCH 0/4] perf, pt, coresight: AUX flags and VMX update Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-02-20 17:20 +0100
        Re: [PATCH 0/4] perf, pt, coresight: AUX flags and VMX update Alexander Shishkin <alexander.shishkin@linux.intel.com> - 2017-02-20 17:40 +0100

csiph-web