@@ -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]
@@ -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_);
@@ -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);
@@ -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