Skip to content

Commit 82ac952

Browse files
rostedtacmel
authored andcommitted
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 <rostedt@goodmis.org> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Namhyung Kim <namhyung@kernel.org> Link: http://lkml.kernel.org/r/20150324135923.650983637@goodmis.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
1 parent c5e6919 commit 82ac952

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

‎tools/lib/traceevent/kbuffer-parse.c‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -729,3 +729,14 @@ void kbuffer_set_old_format(struct kbuffer *kbuf)
729729

730730
kbuf->next_event = __old_next_event;
731731
}
732+
733+
/**
734+
* kbuffer_start_of_data - return offset of where data starts on subbuffer
735+
* @kbuf: The kbuffer
736+
*
737+
* Returns the location on the subbuffer where the data starts.
738+
*/
739+
int kbuffer_start_of_data(struct kbuffer *kbuf)
740+
{
741+
return kbuf->start;
742+
}

‎tools/lib/traceevent/kbuffer.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,5 +63,6 @@ int kbuffer_missed_events(struct kbuffer *kbuf);
6363
int kbuffer_subbuffer_size(struct kbuffer *kbuf);
6464

6565
void kbuffer_set_old_format(struct kbuffer *kbuf);
66+
int kbuffer_start_of_data(struct kbuffer *kbuf);
6667

6768
#endif /* _K_BUFFER_H */

0 commit comments

Comments
 (0)