All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Tzvetomir Stoyanov (VMware)" <tz.stoyanov@gmail.com>
To: rostedt@goodmis.org
Cc: linux-trace-devel@vger.kernel.org
Subject: [PATCH 5/5] trace-cmd library: Make tracecmd_output_write_init static
Date: Thu,  2 Dec 2021 14:19:49 +0200	[thread overview]
Message-ID: <20211202121949.43084-6-tz.stoyanov@gmail.com> (raw)
In-Reply-To: <20211202121949.43084-1-tz.stoyanov@gmail.com>

That function is used only inside the library, it should not be exposed
as library API:
 tracecmd_output_write_init()

Signed-off-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com>
---
 .../include/private/trace-cmd-private.h          |  1 -
 lib/trace-cmd/trace-output.c                     | 16 ++++++++--------
 2 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/lib/trace-cmd/include/private/trace-cmd-private.h b/lib/trace-cmd/include/private/trace-cmd-private.h
index 069283c7..a26076de 100644
--- a/lib/trace-cmd/include/private/trace-cmd-private.h
+++ b/lib/trace-cmd/include/private/trace-cmd-private.h
@@ -274,7 +274,6 @@ int tracecmd_output_set_msg(struct tracecmd_output *handle,
 int tracecmd_output_set_trace_dir(struct tracecmd_output *handle, const char *tracing_dir);
 int tracecmd_output_set_kallsyms(struct tracecmd_output *handle, const char *kallsyms);
 int tracecmd_output_set_from_input(struct tracecmd_output *handle, struct tracecmd_input *ihandle);
-int tracecmd_output_write_init(struct tracecmd_output *handle);
 int tracecmd_output_write_headers(struct tracecmd_output *handle,
 				  struct tracecmd_event_list *list);
 
diff --git a/lib/trace-cmd/trace-output.c b/lib/trace-cmd/trace-output.c
index a20e42df..f5e2574c 100644
--- a/lib/trace-cmd/trace-output.c
+++ b/lib/trace-cmd/trace-output.c
@@ -942,7 +942,7 @@ struct tracecmd_output *tracecmd_output_create_fd(int fd)
  * instead of writing to a file.
  *
  * This must be called after the handle file version is set and before calling
- * tracecmd_output_write_init().
+ * tracecmd_output_write_headers().
  *
  * Returns 0 on success, or -1 if the output file handle is not allocated or not
  * in the expected state.
@@ -966,7 +966,7 @@ int tracecmd_output_set_msg(struct tracecmd_output *handle, struct tracecmd_msg_
  * (@tracing_dir), to be used when creating the trace file instead of using the
  * system default tracig directory.
  *
- * Must be called before tracecmd_output_write_init().
+ * Must be called before tracecmd_output_write_headers().
  *
  * Returns 0 on success, or -1 if the output file handle is not allocated or not
  * in the expected state.
@@ -995,7 +995,7 @@ int tracecmd_output_set_trace_dir(struct tracecmd_output *handle, const char *tr
  * Have the output file handle (@handle) use a custom kernel symbols file instead
  * of the default /proc/kallsyms.
  *
- * Must be called before tracecmd_output_write_init().
+ * Must be called before tracecmd_output_write_headers().
  *
  * Returns 0 on success, or -1 if the output file handle is not allocated or
  * not in the expected state.
@@ -1031,7 +1031,7 @@ int tracecmd_output_set_kallsyms(struct tracecmd_output *handle, const char *kal
  *  - file version
  *  - file compression protocol
  *
- * Must be called before tracecmd_output_write_init().
+ * Must be called before tracecmd_output_write_headers().
  *
  * Returns 0 on success, or -1 if the output file handle is not allocated or
  * not in expected state.
@@ -1053,7 +1053,7 @@ int tracecmd_output_set_from_input(struct tracecmd_output *handle, struct tracec
 }
 
 /**
- * tracecmd_output_write_init - Write the initial data into the trace file
+ * output_write_init - Write the initial data into the trace file
  * @handle: output handle to a trace file.
  *
  * Must be called after tracecmd_output_set_*() functions and before writing
@@ -1070,7 +1070,7 @@ int tracecmd_output_set_from_input(struct tracecmd_output *handle, struct tracec
  * Returns 0 on success, or -1 if the output file handle is not allocated or
  * not in the expected state.
  */
-int tracecmd_output_write_init(struct tracecmd_output *handle)
+static int output_write_init(struct tracecmd_output *handle)
 {
 	char buf[BUFSIZ];
 	int endian4;
@@ -1131,7 +1131,7 @@ int tracecmd_output_write_headers(struct tracecmd_output *handle,
 		return -1;
 
 	/* Write init data, if not written yet */
-	if (handle->file_state < TRACECMD_FILE_INIT && tracecmd_output_write_init(handle))
+	if (handle->file_state < TRACECMD_FILE_INIT && output_write_init(handle))
 		return -1;
 	if (read_header_files(handle))
 		return -1;
@@ -1848,7 +1848,7 @@ struct tracecmd_output *tracecmd_copy(struct tracecmd_input *ihandle,
 
 	if (tracecmd_output_set_from_input(handle, ihandle))
 		goto out_free;
-	tracecmd_output_write_init(handle);
+	output_write_init(handle);
 
 	if (tracecmd_copy_headers(ihandle, handle->fd, 0, 0) < 0)
 		goto out_free;
-- 
2.33.1


      parent reply	other threads:[~2021-12-02 12:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-02 12:19 [PATCH 0/5] Cleanups of tracecmd_output_ APIs Tzvetomir Stoyanov (VMware)
2021-12-02 12:19 ` [PATCH 1/5] trace-cmd library: Fix typo in tracecmd_output_set_msg() Tzvetomir Stoyanov (VMware)
2021-12-02 12:19 ` [PATCH 2/5] trace-cmd library: New API for creating an output trace handle Tzvetomir Stoyanov (VMware)
2021-12-02 12:19 ` [PATCH 3/5] trace-cmd library: Rename tracecmd_output_allocate() Tzvetomir Stoyanov (VMware)
2021-12-02 12:19 ` [PATCH 4/5] trace-cmd library: Remove APIs for create and init output handle Tzvetomir Stoyanov (VMware)
2021-12-02 12:19 ` Tzvetomir Stoyanov (VMware) [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211202121949.43084-6-tz.stoyanov@gmail.com \
    --to=tz.stoyanov@gmail.com \
    --cc=linux-trace-devel@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.