From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932426AbbCXQf3 (ORCPT ); Tue, 24 Mar 2015 12:35:29 -0400 Received: from terminus.zytor.com ([198.137.202.10]:56954 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753269AbbCXQfY (ORCPT ); Tue, 24 Mar 2015 12:35:24 -0400 Date: Tue, 24 Mar 2015 09:35:09 -0700 From: "tip-bot for Steven Rostedt (Red Hat)" Message-ID: Cc: jolsa@redhat.com, linux-kernel@vger.kernel.org, akpm@linux-foundation.org, hpa@zytor.com, rostedt@goodmis.org, mingo@kernel.org, namhyung@kernel.org, acme@redhat.com, tglx@linutronix.de Reply-To: rostedt@goodmis.org, mingo@kernel.org, tglx@linutronix.de, namhyung@kernel.org, acme@redhat.com, jolsa@redhat.com, linux-kernel@vger.kernel.org, akpm@linux-foundation.org, hpa@zytor.com In-Reply-To: <20150324135923.650983637@goodmis.org> References: <20150324135923.650983637@goodmis.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] tools lib traceevent: Add way to find sub buffer boundary Git-Commit-ID: 82ac952be6348dc072dcfd80a2dcb511d0cd6bea 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: 82ac952be6348dc072dcfd80a2dcb511d0cd6bea Gitweb: http://git.kernel.org/tip/82ac952be6348dc072dcfd80a2dcb511d0cd6bea Author: Steven Rostedt (Red Hat) AuthorDate: Tue, 24 Mar 2015 09:57:56 -0400 Committer: Arnaldo Carvalho de Melo CommitDate: Tue, 24 Mar 2015 12:22:09 -0300 tools lib traceevent: Add way to find sub buffer boundary For debugging purposes, it may be helpful for the kbuffer library to flag when crossing a sub buffer. Signed-off-by: Steven Rostedt Cc: Andrew Morton Cc: Jiri Olsa Cc: Namhyung Kim Link: http://lkml.kernel.org/r/20150324135923.650983637@goodmis.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/lib/traceevent/kbuffer-parse.c | 11 +++++++++++ tools/lib/traceevent/kbuffer.h | 1 + 2 files changed, 12 insertions(+) diff --git a/tools/lib/traceevent/kbuffer-parse.c b/tools/lib/traceevent/kbuffer-parse.c index deb3569..3bcada3 100644 --- a/tools/lib/traceevent/kbuffer-parse.c +++ b/tools/lib/traceevent/kbuffer-parse.c @@ -729,3 +729,14 @@ void kbuffer_set_old_format(struct kbuffer *kbuf) kbuf->next_event = __old_next_event; } + +/** + * kbuffer_start_of_data - return offset of where data starts on subbuffer + * @kbuf: The kbuffer + * + * Returns the location on the subbuffer where the data starts. + */ +int kbuffer_start_of_data(struct kbuffer *kbuf) +{ + return kbuf->start; +} diff --git a/tools/lib/traceevent/kbuffer.h b/tools/lib/traceevent/kbuffer.h index c831f64..03dce75 100644 --- a/tools/lib/traceevent/kbuffer.h +++ b/tools/lib/traceevent/kbuffer.h @@ -63,5 +63,6 @@ int kbuffer_missed_events(struct kbuffer *kbuf); int kbuffer_subbuffer_size(struct kbuffer *kbuf); void kbuffer_set_old_format(struct kbuffer *kbuf); +int kbuffer_start_of_data(struct kbuffer *kbuf); #endif /* _K_BUFFER_H */