libtraceevent/kbuffer: Add more kbuffer APIs
cover libtraceevent/kbuffer: Add more kbuffer APIs
From: "Steven Rostedt (Google)" <[email protected]>
In preparation to add more advanced kbuffer functionality to libtracefs, some kbuffer APIs are needed. This will also allow libtracefs to add APIs for the upcoming memory mapping of the kernel ring buffer.
Steven Rostedt (Google) (6):
libtraceevent: Add tep_get_sub_buffer_commit_offset()
libtraceevent: Fix tep_kbuffer() to have kbuf assign long_size
kbuffer: Add kbuffer_read_buffer()
kbuffer: Add kbuffer_dup()
kbuffer: Add kbuffer_subbuffer() API
kbuffer: Add kbuffer_refresh() API
.../libtraceevent-kbuffer-create.txt | 30 ++- Documentation/libtraceevent-kbuffer-read.txt | 19 +- Documentation/libtraceevent-page_size.txt | 9 + Documentation/libtraceevent.txt | 5 + include/traceevent/event-parse.h | 1 + include/traceevent/kbuffer.h | 4 + src/event-parse-api.c | 15 ++ src/kbuffer-parse.c | 223 ++++++++++++++++-- src/parse-utils.c | 5 + 9 files changed, 287 insertions(+), 24 deletions(-)
Signature · 1 line
2.42.0
PATCH 1/6 libtraceevent: Add tep_get_sub_buffer_commit_offset()
From: "Steven Rostedt (Google)" <[email protected]>
Add a function that retrieves the offset on the sub-buffer to find where the "commit" variable of the sub buffer is located.
--- Documentation/libtraceevent-page_size.txt | 9 +++++++++ Documentation/libtraceevent.txt | 1 + include/traceevent/event-parse.h | 1 + src/event-parse-api.c | 15 +++++++++++++++ 4 files changed, 26 insertions(+)
Documentation/libtraceevent-page_size.txt +9 -0
@@ -15,6 +15,7 @@ SYNOPSIS int *tep_get_page_size*(struct tep_handle pass:[*]_tep_); void *tep_set_page_size*(struct tep_handle pass:[*]_tep_, int _page_size_); int *tep_get_sub_buffer_size*(struct tep_handle pass:[*]_tep_); +int *tep_get_sub_buffer_commit_offset*(struct tep_handle pass:[*]_tep_); -- DESCRIPTION
@@ -32,6 +33,11 @@ The *tep_get_sub_buffer_size()* returns the size of each "sub buffer" of the ring buffer. The Linux kernel ring buffer is broken up into sections called sub buffers. This returns the size of those buffers. +The *tep_get_sub_buffer_commit_offset()* returns the offset on the sub buffer +that holds the committed portion of data. This number contains the index from +the data portion of the sub buffer that is the end of the last element on the +sub buffer. + RETURN VALUE ------------ The *tep_get_page_size()* function returns size of the memory page, in bytes.
@@ -39,6 +45,9 @@ The *tep_get_page_size()* function returns size of the memory page, in bytes. The *tep_get_sub_buffer_size()* function returns the number of bytes each sub buffer is made up of. +The *tep_get_sub_buffer_commit_offset()* function returns the location on the +sub buffer that contains the index of the last element. + EXAMPLE ------- [source,c]
Documentation/libtraceevent.txt +1 -0
@@ -27,6 +27,7 @@ Management of tep handler data structure and access of its members: int *tep_get_page_size*(struct tep_handle pass:[*]_tep_); void *tep_set_page_size*(struct tep_handle pass:[*]_tep_, int _page_size_); int *tep_get_sub_buffer_size*(struct tep_handle pass:[*]_tep_); + int *tep_get_sub_buffer_commit_offset*(struct tep_handle pass:[*]_tep_); int *tep_get_header_page_size*(struct tep_handle pass:[*]_tep_); int *tep_get_header_timestamp_size*(struct tep_handle pass:[*]_tep_); bool *tep_is_old_format*(struct tep_handle pass:[*]_tep_);
include/traceevent/event-parse.h +1 -0
@@ -588,6 +588,7 @@ int tep_get_long_size(struct tep_handle *tep);void tep_set_long_size (struct tep_handle *tep,int long_size);int tep_get_page_size (struct tep_handle *tep);int tep_get_sub_buffer_size (struct tep_handle *tep); +int tep_get_sub_buffer_commit_offset (struct tep_handle *tep);void tep_set_page_size (struct tep_handle *tep,int _page_size);bool tep_is_file_bigendian (struct tep_handle *tep);void tep_set_file_bigendian (struct tep_handle *tep,enum tep_endian endian);
src/event-parse-api.c +15 -0
@@ -277,6 +277,21 @@ int tep_get_sub_buffer_size(struct tep_handle *tep)return tep->header_page_data_size + tep->header_page_data_offset; } +/** +* tep_get_sub_buffer_commit_offset - return offset of the commit location +* @tep: the handle to the tep_handle +* +* Returns the offset of where to find the "commit" field of the offset. +* Use tep_get_header_page_size() to find the size of the commit field. +*/ +int tep_get_sub_buffer_commit_offset (struct tep_handle *tep) +{ +if (!tep) +return -1 ; + +return tep->header_page_size_offset; +} +/** * tep_is_file_bigendian - return the endian of the file * @tep: a handle to the tep_handle
Signature · 1 line
2.42.0
PATCH 2/6 libtraceevent: Fix tep_kbuffer() to have kbuf assign long_size
In reply to Steven RostedtFrom: "Steven Rostedt (Google)" <[email protected]>
If the tep handle that returns the kbuf from tep_kbuffer() did not have its long_size initialized, neither will the kbuffer it returns. This can cause inconsistent results. Default the long_size to the "commit" size of the header page as that should also be the size of long.
--- src/parse-utils.c | 5 +++++ 1 file changed, 5 insertions(+)
src/parse-utils.c +5 -0
@@ -137,6 +137,11 @@ struct kbuffer *tep_kbuffer(struct tep_handle *tep)int long_size; long_size =tep_get_long_size (tep); + +/* If the long_size is not set, then use the commit size */ +if (!long_size) + long_size =tep_get_header_page_size (tep); +if (long_size ==8 ) long_size =KBUFFER_LSIZE_8 ;else
Signature · 1 line
2.42.0
PATCH 3/6 kbuffer: Add kbuffer_read_buffer()
In reply to Steven RostedtFrom: "Steven Rostedt (Google)" <[email protected]>
The kbuffer_read_buffer() function will fill the given buffer from the kbuf the same way the kernel would do a read system call. That is, if the length len is less than the sub buffer size, or the current index is non-zero, it will start from the next event to read, and create buffer as a new sub buffer (with a timestamp and commit header) with that event that was found and including all events after that can fit within len.
The len must include the size of the sub buffer header as
well as the events to include. That is, len is the allocate size of buffer that can be filled. The return from this function is the index of the end of the last event that was added. If there are no more events then zero is returned, and if the buffer can not copy any events because len was too small, then -1 is returned.
--- Documentation/libtraceevent-kbuffer-read.txt | 19 +- Documentation/libtraceevent.txt | 1 + include/traceevent/kbuffer.h | 1 + src/kbuffer-parse.c | 172 ++++++++++++++++--- 4 files changed, 171 insertions(+), 22 deletions(-)
Documentation/libtraceevent-kbuffer-read.txt +18 -1
@@ -4,7 +4,7 @@ libtraceevent(3) NAME ---- kbuffer_read_event, kbuffer_next_event, kbuffer_missed_events, kbuffer_event_size, kbuffer_curr_size, -kbuffer_curr_offset, kbuffer_curr_index - +kbuffer_curr_offset, kbuffer_curr_index, kbuffer_read_buffer - Functions to read through the kbuffer sub buffer. SYNOPSIS
@@ -21,6 +21,7 @@ int *kbuffer_event_size*(struct kbuffer pass:[*]_kbuf_); int *kbuffer_curr_size*(struct kbuffer pass:[*]_kbuf_); int *kbuffer_curr_offset*(struct kbuffer pass:[*]_kbuf_); int *kbuffer_curr_index*(struct kbuffer pass:[*]_kbuf_); +int *kbuffer_read_buffer*(struct kbuffer pass:[*]_kbuf_, void pass:[*]_buffer_, int _len_); -- DESCRIPTION
@@ -64,6 +65,18 @@ The *kbuffer_curr_index()* function returns the index from the beginning of the portion of the sub-buffer where the current evnet's meta data is located. The first event will likely be zero, but may not be if there's a timestamp attached to it. +The *kbuffer_read_buffer()* function will fill the given _buffer_ from the _kbuf_ the same +way the kernel would do a read system call. That is, if the length _len_ is less than the +sub buffer size, or the kbuffer current index is non-zero, it will start copying from the +_kbuf_ current event and create _buffer_ as a new sub buffer (with a timestamp +and commit header) with that event that was found and including all events after that can +fit within _len_. The _len_ must include the size of the sub buffer header as well as the +events to include. That is, _len_ is the allocate size of _buffer_ that can be filled. +The return from this function is the index of the end of the last event that was added. +If there are no more events then zero is returned, and if the buffer can not +copy any events because _len_ was too small, then -1 is returned. + + RETURN VALUE ------------ *kbuffer_read_event()* returns the event that the _kbuf_ descriptor is currently at,
@@ -92,6 +105,10 @@ sub-buffer. *kbuf_curr_index()* returns the index of the current record from the beginning of the _kbuf_ data section. +*kbuf_read_buffer()* returns the index of the end of the last event that was filled in +_buffer_. If there are no more events to copy from _start_ then 0 is returned. If _len_ +is not big enough to hold any events, then -1 is returned. + EXAMPLE ------- [source,c]
Documentation/libtraceevent.txt +1 -0
@@ -195,6 +195,7 @@ kbuffer parsing: int *kbuffer_curr_size*(struct kbuffer pass:[*]_kbuf_); int *kbuffer_curr_offset*(struct kbuffer pass:[*]_kbuf_); int *kbuffer_curr_index*(struct kbuffer pass:[*]_kbuf_); + int *kbuffer_read_buffer*(struct kbuffer pass:[*]_kbuf_, void pass:[*]_buffer_, int _start_, int _len_); -- DESCRIPTION
include/traceevent/kbuffer.h +1 -0
@@ -42,6 +42,7 @@ unsigned int kbuffer_ptr_delta(struct kbuffer *kbuf, void *ptr);void *kbuffer_translate_data (int swap,void *data,unsigned int *size);void *kbuffer_read_at_offset (struct kbuffer *kbuf,int offset,unsigned long long *ts); +int kbuffer_read_buffer (struct kbuffer *kbuf,void *buffer,int len);int kbuffer_curr_index (struct kbuffer *kbuf);
src/kbuffer-parse.c +151 -21
207 lines not on this page · raw message
Signature · 1 line
2.42.0
PATCH 4/6 kbuffer: Add kbuffer_dup()
In reply to Steven RostedtFrom: "Steven Rostedt (Google)" <[email protected]>
Add the function kbuffer_dup() that will duplicate a current kbuffer structure that can be used separately on the same subbuffer or load a new buffer on it.
--- .../libtraceevent-kbuffer-create.txt | 8 +++++++- Documentation/libtraceevent.txt | 1 + include/traceevent/kbuffer.h | 1 + src/kbuffer-parse.c | 20 +++++++++++++++++++ 4 files changed, 29 insertions(+), 1 deletion(-)
Documentation/libtraceevent-kbuffer-create.txt +7 -1
@@ -3,7 +3,7 @@ libtraceevent(3) NAME ---- -kbuffer_alloc, kbuffer_free, kbuffer_load_subbuffer, kbuffer_subbuffer_size, kbuffer_start_of_data - Creating of kbuffer element to parse +kbuffer_alloc, kbuffer_dup, kbuffer_free, kbuffer_load_subbuffer, kbuffer_subbuffer_size, kbuffer_start_of_data - Creating of kbuffer element to parse the Linux kernel tracing ring buffer SYNOPSIS
@@ -28,6 +28,7 @@ struct kbuffer; struct tep_handle; struct kbuffer pass:[*]*kbuffer_alloc*(enum kbuffer_long_size _size_, enum kbuffer_endian _endian_); +struct kbuffer pass:[*]*kbuffer_dup*(struct kbuffer pass:[*]_kbuf_); void *kbuffer_free*(struct kbuffer pass:[*]_kbuf_); int *kbuffer_load_subbuffer*(struct kbuffer pass:[*]_kbuf_, void pass:[*]_subbuffer_); int *kbuffer_subbuffer_size*(struct kbuffer pass:[*]_kbuf);
@@ -59,6 +60,11 @@ will then perform a *uname(2)* call, and if the _machine_ field has the string " in it, it will be set to 8 byte long size and not 4 byte. This is because the ring buffer long size is dependent on the kernel and not user space. +The *kbuffer_dup()* function will duplicate an existing kbuffer structure with +an allocated new one. It will have all the properties of the passed in _kbuf_, +including pointing to the same subbuffer that was loaded in the _kbuf_. +It must be freed with *kbuffer_free()*. + The *kbuffer_free()* function will free the resources created by *kbuffer_alloc()*. The *kbuffer_load_subbuffer()* will take a _subbuffer_ which is a raw data blob
Documentation/libtraceevent.txt +1 -0
@@ -181,6 +181,7 @@ Trace sequences: kbuffer parsing: #include <kbuffer.h> struct kbuffer pass:[*]*kbuffer_alloc*(enum kbuffer_long_size _size_, enum kbuffer_endian _endian_); + struct kbuffer pass:[*]*kbuffer_dup*(struct kbuffer pass:[*]_kbuf_); void *kbuffer_free*(struct kbuffer pass:[*]_kbuf_); int *kbuffer_load_subbuffer*(struct kbuffer pass:[*]_kbuf_, void pass:[*]_subbuffer_); int *kbuffer_subbuffer_size*(struct kbuffer pass:[*]_kbuf);
include/traceevent/kbuffer.h +1 -0
@@ -31,6 +31,7 @@ enum {struct kbuffer ;struct kbuffer *kbuffer_alloc (enum kbuffer_long_size size,enum kbuffer_endian endian); +struct kbuffer *kbuffer_dup (struct kbuffer *kbuf);void kbuffer_free (struct kbuffer *kbuf);int kbuffer_load_subbuffer (struct kbuffer *kbuf,void *subbuffer);void *kbuffer_read_event (struct kbuffer *kbuf,unsigned long long *ts);
src/kbuffer-parse.c +20 -0
@@ -269,6 +269,26 @@ kbuffer_alloc(enum kbuffer_long_size size, enum kbuffer_endian endian)return kbuf; } +/** +* kbuffer_dup - duplicate a given kbuffer +* @kbuf_orig; The kbuffer to duplicate +* +* Allocates a new kbuffer based off of anothe kbuffer. +* Returns the duplicate on success or NULL on error. +*/ +struct kbuffer *kbuffer_dup (struct kbuffer *kbuf_orig) +{ +struct kbuffer *kbuf; + + kbuf =malloc (sizeof (*kbuf)); +if (!kbuf) +return NULL ; + + *kbuf = *kbuf_orig; + +return kbuf; +} +/** kbuffer_free - free an allocated kbuffer * @kbuf: The kbuffer to free *
Signature · 1 line
2.42.0
PATCH 5/6 kbuffer: Add kbuffer_subbuffer() API
In reply to Steven RostedtFrom: "Steven Rostedt (Google)" <[email protected]>
Add a way to retrieve the last loaded subbuffer to the kbuffer.
The kbuffer_subbuffer() will return a pointer to the last loaded subbuffer or NULL if none was ever loaded.
--- Documentation/libtraceevent-kbuffer-create.txt | 11 ++++++++++- Documentation/libtraceevent.txt | 1 + include/traceevent/kbuffer.h | 1 + src/kbuffer-parse.c | 11 +++++++++++ 4 files changed, 23 insertions(+), 1 deletion(-)
Documentation/libtraceevent-kbuffer-create.txt +10 -1
@@ -3,7 +3,8 @@ libtraceevent(3) NAME ---- -kbuffer_alloc, kbuffer_dup, kbuffer_free, kbuffer_load_subbuffer, kbuffer_subbuffer_size, kbuffer_start_of_data - Creating of kbuffer element to parse +kbuffer_alloc, kbuffer_dup, kbuffer_free, kbuffer_load_subbuffer, kbuffer_subbuffer, +kbuffer_subbuffer_size, kbuffer_start_of_data - Creating of kbuffer element to parse the Linux kernel tracing ring buffer SYNOPSIS
@@ -33,6 +34,7 @@ void *kbuffer_free*(struct kbuffer pass:[*]_kbuf_); int *kbuffer_load_subbuffer*(struct kbuffer pass:[*]_kbuf_, void pass:[*]_subbuffer_); int *kbuffer_subbuffer_size*(struct kbuffer pass:[*]_kbuf); int *kbuffer_start_of_data*(struct kbuffer pass:[*]_kbuf_); +void pass:[*]*kbuffer_subbuffer*(struct kbuffer pass:[*]_kbuf); -- DESCRIPTION
@@ -79,6 +81,10 @@ on the sub-buffer. It does not return the size of the sub-buffer itself. The *kbuffer_start_of_data()* function returns the offset of where the actual data load of the sub-buffer begins. +The *kbuffer_subbuffer()* function returns the pointer to the currently loaded +subbuffer. That is, the last subbuffer that was loaded by *kbuffer_load_subbuffer()*. +If no subbuffer was loaded NULL is returned. + RETURN VALUE ------------ *kbuffer_alloc()* returns an allocated kbuffer descriptor or NULL on error.
@@ -92,6 +98,9 @@ of the last event is located. *kbuffer_start_of_data()* returns the offset of where the data begins on the sub-buffer loaded in _kbuf_. +*kbuffer_subbuffer()* returns the last loaded subbuffer to _kbuf_ that was loaded +by *kbuffer_load_subbuffer()* or NULL if none was loaded. + EXAMPLE ------- [source,c]
Documentation/libtraceevent.txt +1 -0
@@ -185,6 +185,7 @@ kbuffer parsing: void *kbuffer_free*(struct kbuffer pass:[*]_kbuf_); int *kbuffer_load_subbuffer*(struct kbuffer pass:[*]_kbuf_, void pass:[*]_subbuffer_); int *kbuffer_subbuffer_size*(struct kbuffer pass:[*]_kbuf); + void pass:[*]*kbuffer_subbuffer*(struct kbuffer pass:[*]_kbuf); int *kbuffer_start_of_data*(struct kbuffer pass:[*]_kbuf_); unsigned long long *kbuffer_timestamp*(struct kbuffer pass:[*]_kbuf_); unsigned long long *kbuffer_subbuf_timestamp*(struct kbuffer pass:[*]_kbuf_, void pass:[*]_subbuf_);
include/traceevent/kbuffer.h +1 -0
@@ -52,6 +52,7 @@ int kbuffer_curr_size(struct kbuffer *kbuf);int kbuffer_event_size (struct kbuffer *kbuf);int kbuffer_missed_events (struct kbuffer *kbuf);int kbuffer_subbuffer_size (struct kbuffer *kbuf); +void *kbuffer_subbuffer (struct kbuffer *kbuf);void kbuffer_set_old_format (struct kbuffer *kbuf);int kbuffer_start_of_data (struct kbuffer *kbuf);
src/kbuffer-parse.c +11 -0
@@ -747,6 +747,17 @@ int kbuffer_subbuffer_size(struct kbuffer *kbuf)return kbuf->size; } +/** +* kbuffer_subbuffer - the currently loaded subbuffer +* @kbuf: The kbuffer to read from +* +* Returns the currently loaded subbuffer. +*/ +void *kbuffer_subbuffer (struct kbuffer *kbuf) +{ +return kbuf->subbuffer; +} +/** * kbuffer_curr_index - Return the index of the record * @kbuf: The kbuffer to read from
Signature · 1 line
2.42.0
PATCH 6/6 kbuffer: Add kbuffer_refresh() API
In reply to Steven RostedtFrom: "Steven Rostedt (Google)" <[email protected]>
Add a way to refresh the current size of the loaded subbuffer of the kbuffer. This is needed if the loaded subbuffer has a writer on it and it needs to update for new events that have been written.
Note, no memory barriers are used here and that would be required by the application.
--- .../libtraceevent-kbuffer-create.txt | 15 ++++++++++++-- Documentation/libtraceevent.txt | 1 + include/traceevent/kbuffer.h | 1 + src/kbuffer-parse.c | 20 +++++++++++++++++++ 4 files changed, 35 insertions(+), 2 deletions(-)
Documentation/libtraceevent-kbuffer-create.txt +13 -2
@@ -4,7 +4,7 @@ libtraceevent(3) NAME ---- kbuffer_alloc, kbuffer_dup, kbuffer_free, kbuffer_load_subbuffer, kbuffer_subbuffer, -kbuffer_subbuffer_size, kbuffer_start_of_data - Creating of kbuffer element to parse +kbuffer_refresh, kbuffer_subbuffer_size, kbuffer_start_of_data - Creating of kbuffer element to parse the Linux kernel tracing ring buffer SYNOPSIS
@@ -32,7 +32,8 @@ struct kbuffer pass:[*]*kbuffer_alloc*(enum kbuffer_long_size _size_, enum kbuff struct kbuffer pass:[*]*kbuffer_dup*(struct kbuffer pass:[*]_kbuf_); void *kbuffer_free*(struct kbuffer pass:[*]_kbuf_); int *kbuffer_load_subbuffer*(struct kbuffer pass:[*]_kbuf_, void pass:[*]_subbuffer_); -int *kbuffer_subbuffer_size*(struct kbuffer pass:[*]_kbuf); +int *kbuffer_subbuffer_size*(struct kbuffer pass:[*]_kbuf_); +int *kbuffer_refresh*(struct kbuffer pass:[*]_kbuf_); int *kbuffer_start_of_data*(struct kbuffer pass:[*]_kbuf_); void pass:[*]*kbuffer_subbuffer*(struct kbuffer pass:[*]_kbuf); --
@@ -78,6 +79,13 @@ is what kbuffer uses to walk the events. The *kbuffer_subbuffer_size()* returns the location of the end of the last event on the sub-buffer. It does not return the size of the sub-buffer itself. +The *kbuffer_refresh()* is to be used if more writes were done on the loaded kbuffer +where the size of the kbuffer needs to be refreshed to be able to read the new +events that were written since the last *kbuffer_load_subbuffer()* was called on it. + +Note, no memory barriers are implemented with this function and any synchronization +with the writer is the responsibility of the application. + The *kbuffer_start_of_data()* function returns the offset of where the actual data load of the sub-buffer begins.
@@ -101,6 +109,9 @@ sub-buffer loaded in _kbuf_. *kbuffer_subbuffer()* returns the last loaded subbuffer to _kbuf_ that was loaded by *kbuffer_load_subbuffer()* or NULL if none was loaded. +*kbuffer_refresh()* returns 0 on success and -1 if _kbuf_ is NULL or it does not +have a subbuffer loaded via *kbuffer_load_subbuffer()*. + EXAMPLE ------- [source,c]
Documentation/libtraceevent.txt +1 -0
@@ -186,6 +186,7 @@ kbuffer parsing: int *kbuffer_load_subbuffer*(struct kbuffer pass:[*]_kbuf_, void pass:[*]_subbuffer_); int *kbuffer_subbuffer_size*(struct kbuffer pass:[*]_kbuf); void pass:[*]*kbuffer_subbuffer*(struct kbuffer pass:[*]_kbuf); + int *kbuffer_refresh*(struct kbuffer pass:[*]_kbuf_); int *kbuffer_start_of_data*(struct kbuffer pass:[*]_kbuf_); unsigned long long *kbuffer_timestamp*(struct kbuffer pass:[*]_kbuf_); unsigned long long *kbuffer_subbuf_timestamp*(struct kbuffer pass:[*]_kbuf_, void pass:[*]_subbuf_);
include/traceevent/kbuffer.h +1 -0
@@ -34,6 +34,7 @@ struct kbuffer *kbuffer_alloc(enum kbuffer_long_size size, enum kbuffer_endian estruct kbuffer *kbuffer_dup (struct kbuffer *kbuf);void kbuffer_free (struct kbuffer *kbuf);int kbuffer_load_subbuffer (struct kbuffer *kbuf,void *subbuffer); +int kbuffer_refresh (struct kbuffer *kbuf);void *kbuffer_read_event (struct kbuffer *kbuf,unsigned long long *ts);void *kbuffer_next_event (struct kbuffer *kbuf,unsigned long long *ts);unsigned long long kbuffer_timestamp (struct kbuffer *kbuf);
src/kbuffer-parse.c +20 -0
@@ -299,6 +299,26 @@ void kbuffer_free(struct kbuffer *kbuf)free (kbuf); } +/** +* kbuffer_refresh - update the meta data from the subbuffer +* @kbuf; The kbuffer to update +* +* If the loaded subbuffer changed its meta data (the commit) +* then update the pointers for it. +*/ +int kbuffer_refresh (struct kbuffer *kbuf) +{ +unsigned long long flags; + +if (!kbuf || !kbuf->subbuffer) +return -1 ; + + flags =read_long (kbuf, kbuf->subbuffer +8 ); + kbuf->size = (unsigned int )flags &COMMIT_MASK ; + +return 0 ; +} +static unsigned int type4host (struct kbuffer *kbuf,unsigned int type_len_ts) {
Signature · 1 line
2.42.0