1 /* SPDX-License-Identifier: LGPL-2.1 */
3 * Copyright (C) 2012 Red Hat Inc, Steven Rostedt <srostedt@redhat.com>
15 KBUFFER_ENDIAN_LITTLE
,
18 enum kbuffer_long_size
{
24 KBUFFER_TYPE_PADDING
= 29,
25 KBUFFER_TYPE_TIME_EXTEND
= 30,
26 KBUFFER_TYPE_TIME_STAMP
= 31,
31 struct kbuffer
*kbuffer_alloc(enum kbuffer_long_size size
, enum kbuffer_endian endian
);
32 void kbuffer_free(struct kbuffer
*kbuf
);
33 int kbuffer_load_subbuffer(struct kbuffer
*kbuf
, void *subbuffer
);
34 void *kbuffer_read_event(struct kbuffer
*kbuf
, unsigned long long *ts
);
35 void *kbuffer_next_event(struct kbuffer
*kbuf
, unsigned long long *ts
);
36 unsigned long long kbuffer_timestamp(struct kbuffer
*kbuf
);
37 unsigned long long kbuffer_subbuf_timestamp(struct kbuffer
*kbuf
, void *subbuf
);
38 unsigned int kbuffer_ptr_delta(struct kbuffer
*kbuf
, void *ptr
);
40 void *kbuffer_translate_data(int swap
, void *data
, unsigned int *size
);
42 void *kbuffer_read_at_offset(struct kbuffer
*kbuf
, int offset
, unsigned long long *ts
);
44 int kbuffer_curr_index(struct kbuffer
*kbuf
);
46 int kbuffer_curr_offset(struct kbuffer
*kbuf
);
47 int kbuffer_curr_size(struct kbuffer
*kbuf
);
48 int kbuffer_event_size(struct kbuffer
*kbuf
);
49 int kbuffer_missed_events(struct kbuffer
*kbuf
);
50 int kbuffer_subbuffer_size(struct kbuffer
*kbuf
);
52 void kbuffer_set_old_format(struct kbuffer
*kbuf
);
53 int kbuffer_start_of_data(struct kbuffer
*kbuf
);
57 struct kbuffer_raw_info
{
60 unsigned long long delta
;
65 struct kbuffer_raw_info
*kbuffer_raw_get(struct kbuffer
*kbuf
, void *subbuf
,
66 struct kbuffer_raw_info
*info
);
68 #endif /* _K_BUFFER_H */