diff mbox series

[v4,27/29] trace-cmd library: New internal API to set file state of output handler

Message ID 20210520031959.346165-28-tz.stoyanov@gmail.com (mailing list archive)
State Superseded
Headers show
Series Add trace file compression | expand

Commit Message

Tzvetomir Stoyanov (VMware) May 20, 2021, 3:19 a.m. UTC
Added a new library internal API to set the state of an output file
handler:
 set_out_file_state()
This new API will be used internaly in library for split and convert
functionality.

Signed-off-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com>
---
 lib/trace-cmd/include/trace-cmd-local.h | 3 +++
 lib/trace-cmd/trace-output.c            | 5 +++++
 2 files changed, 8 insertions(+)
diff mbox series

Patch

diff --git a/lib/trace-cmd/include/trace-cmd-local.h b/lib/trace-cmd/include/trace-cmd-local.h
index 48a01d43..830bbb1a 100644
--- a/lib/trace-cmd/include/trace-cmd-local.h
+++ b/lib/trace-cmd/include/trace-cmd-local.h
@@ -51,4 +51,7 @@  void out_compression_reset(struct tracecmd_output *handle);
 void in_uncompress_reset(struct tracecmd_input *handle);
 int in_uncompress_block(struct tracecmd_input *handle);
 
+void set_out_file_state(struct tracecmd_output *handle, int new_state);
+
+
 #endif /* _TRACE_CMD_LOCAL_H */
diff --git a/lib/trace-cmd/trace-output.c b/lib/trace-cmd/trace-output.c
index e7370798..24c260c4 100644
--- a/lib/trace-cmd/trace-output.c
+++ b/lib/trace-cmd/trace-output.c
@@ -1951,6 +1951,11 @@  out_free:
 	return NULL;
 }
 
+__hidden void set_out_file_state(struct tracecmd_output *handle, int new_state)
+{
+	handle->file_state = new_state;
+}
+
 __hidden bool check_out_state(struct tracecmd_output *handle, int new_state)
 {
 	return check_file_state(handle->file_version, handle->file_state, new_state);