From: Steven Rostedt <rostedt@goodmis.org>
To: linux-trace-devel@vger.kernel.org
Cc: "Steven Rostedt (Google)" <rostedt@goodmis.org>
Subject: [PATCH 05/11] libtracefs: Hide tracefs_list_pop() and make it trace_list_pop()
Date: Tue, 22 Feb 2022 19:30:06 -0500 [thread overview]
Message-ID: <20220223003012.1334741-6-rostedt@goodmis.org> (raw)
In-Reply-To: <20220223003012.1334741-1-rostedt@goodmis.org>
From: "Steven Rostedt (Google)" <rostedt@goodmis.org>
The tracefs_list_pop() is not ready to be exposed as an API. Make it
hidden and rename it to trace_list_pop().
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
---
include/tracefs-local.h | 1 +
include/tracefs.h | 1 -
src/tracefs-hist.c | 10 +++++-----
src/tracefs-utils.c | 6 +++---
4 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/include/tracefs-local.h b/include/tracefs-local.h
index bf157e11aaea..926fd02c3d1e 100644
--- a/include/tracefs-local.h
+++ b/include/tracefs-local.h
@@ -71,6 +71,7 @@ struct tracefs_options_mask *
enabled_opts_mask(struct tracefs_instance *instance);
char **trace_list_create_empty(void);
+int trace_list_pop(char **list);
char *append_string(char *str, const char *delim, const char *add);
int trace_test_state(int state);
diff --git a/include/tracefs.h b/include/tracefs.h
index 1848ad0aa668..301f1b155ba1 100644
--- a/include/tracefs.h
+++ b/include/tracefs.h
@@ -75,7 +75,6 @@ int tracefs_error_clear(struct tracefs_instance *instance);
void tracefs_list_free(char **list);
char **tracefs_list_add(char **list, const char *string);
int tracefs_list_size(char **list);
-int tracefs_list_pop(char **list);
/**
* tracefs_trace_on_get_fd - Get a file descriptor of "tracing_on" in given instance
diff --git a/src/tracefs-hist.c b/src/tracefs-hist.c
index aec61ad52e72..5a89be2876d2 100644
--- a/src/tracefs-hist.c
+++ b/src/tracefs-hist.c
@@ -1096,14 +1096,14 @@ static int add_synth_fields(struct tracefs_synth *synth,
ret = asprintf(&str, "$%s", name);
if (ret < 0) {
- tracefs_list_pop(synth->synthetic_fields);
+ trace_list_pop(synth->synthetic_fields);
return -1;
}
list = tracefs_list_add(synth->synthetic_args, str);
free(str);
if (!list) {
- tracefs_list_pop(synth->synthetic_fields);
+ trace_list_pop(synth->synthetic_fields);
return -1;
}
@@ -1156,7 +1156,7 @@ int tracefs_synth_add_match_field(struct tracefs_synth *synth,
list = tracefs_list_add(synth->end_keys, end_match_field);
if (!list) {
- tracefs_list_pop(synth->start_keys);
+ trace_list_pop(synth->start_keys);
return -1;
}
synth->end_keys = list;
@@ -1176,8 +1176,8 @@ int tracefs_synth_add_match_field(struct tracefs_synth *synth,
return 0;
pop_lists:
- tracefs_list_pop(synth->start_keys);
- tracefs_list_pop(synth->end_keys);
+ trace_list_pop(synth->start_keys);
+ trace_list_pop(synth->end_keys);
return -1;
}
diff --git a/src/tracefs-utils.c b/src/tracefs-utils.c
index a502c2dec736..0ad9a35e7819 100644
--- a/src/tracefs-utils.c
+++ b/src/tracefs-utils.c
@@ -448,14 +448,14 @@ char **tracefs_list_add(char **list, const char *string)
return list;
}
-/**
- * tracefs_list_pop - Removes the last string added
+/*
+ * trace_list_pop - Removes the last string added
* @list: The list to remove the last event from
*
* Returns 0 on success, -1 on error.
* Returns 1 if the list is empty or NULL.
*/
-int tracefs_list_pop(char **list)
+__hidden int trace_list_pop(char **list)
{
unsigned long size;
--
2.34.1
next prev parent reply other threads:[~2022-02-23 0:30 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-23 0:30 [PATCH 00/11] libtracefs: Add man page checks and upate man pages Steven Rostedt
2022-02-23 0:30 ` [PATCH 01/11] libtracefs: Update main man page for all functions Steven Rostedt
2022-02-23 0:30 ` [PATCH 02/11] libtracefs: Do not check libtracefs-options.txt man page Steven Rostedt
2022-02-23 0:30 ` [PATCH 03/11] libtracefs: Have check-manpages.sh check tracefs.h as well Steven Rostedt
2022-02-23 0:30 ` [PATCH 04/11] libtracefs: Add documentation for tracefs_instances() Steven Rostedt
2022-02-23 0:30 ` Steven Rostedt [this message]
2022-02-23 0:30 ` [PATCH 06/11] libtracefs: Add documentation for tracefs_list_add/size() Steven Rostedt
2022-02-23 0:30 ` [PATCH 07/11] libtracefs: Add documentation for tracefs_iterate_stop() Steven Rostedt
2022-02-23 0:30 ` [PATCH 08/11] libtracefs: Add documentation for tracefs_option_id() Steven Rostedt
2022-02-23 0:30 ` [PATCH 09/11] libtracefs: Add man pages for tracefs_event_file_*() functions Steven Rostedt
2022-02-23 0:30 ` [PATCH 10/11] libtracefs: Do not check for deprecated functions Steven Rostedt
2022-02-23 0:30 ` [PATCH 11/11] libtracefs: Run the check-manpages.sh on building of docs Steven Rostedt
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=20220223003012.1334741-6-rostedt@goodmis.org \
--to=rostedt@goodmis.org \
--cc=linux-trace-devel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).