lkml.org 
[lkml]   [2017]   [Nov]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v4 06/37] ring-buffer: Redefine the unimplemented RINGBUF_TYPE_TIME_STAMP
Hi Tom,

On Mon, Oct 30, 2017 at 03:51:48PM -0500, Tom Zanussi wrote:
> RINGBUF_TYPE_TIME_STAMP is defined but not used, and from what I can
> gather was reserved for something like an absolute timestamp feature
> for the ring buffer, if not a complete replacement of the current
> time_delta scheme.
>
> This code redefines RINGBUF_TYPE_TIME_STAMP to implement absolute time
> stamps. Another way to look at it is that it essentially forces
> extended time_deltas for all events.
>
> The motivation for doing this is to enable time_deltas that aren't
> dependent on previous events in the ring buffer, making it feasible to
> use the ring_buffer_event timetamps in a more random-access way, for
> purposes other than serial event printing.
>
> To set/reset this mode, use tracing_set_timestamp_abs() from the
> previous interface patch.
>
> Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
> ---

[SNIP]
> @@ -2220,13 +2246,16 @@ static void rb_inc_iter(struct ring_buffer_iter *iter)
> }
>
> /* Slow path, do not inline */
> -static noinline struct ring_buffer_event *
> +static struct noinline ring_buffer_event *

struct noinline? Looks like a mistake..

Thanks,
Namhyung


> -rb_add_time_stamp(struct ring_buffer_event *event, u64 delta)
> +rb_add_time_stamp(struct ring_buffer_event *event, u64 delta, bool abs)
> {
> - event->type_len = RINGBUF_TYPE_TIME_EXTEND;
> + if (abs)
> + event->type_len = RINGBUF_TYPE_TIME_STAMP;
> + else
> + event->type_len = RINGBUF_TYPE_TIME_EXTEND;
>
> - /* Not the first event on the page? */
> - if (rb_event_index(event)) {
> + /* Not the first event on the page, or not delta? */
> + if (abs || rb_event_index(event)) {
> event->time_delta = delta & TS_MASK;
> event->array[0] = delta >> TS_SHIFT;
> } else {

\
 
 \ /
  Last update: 2017-11-06 06:10    [W:0.227 / U:0.176 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site