From: "Tzvetomir Stoyanov (VMware)" <tz.stoyanov@gmail.com>
To: rostedt@goodmis.org
Cc: linux-trace-devel@vger.kernel.org
Subject: [PATCH v4 8/8] libtracefs: Hide non API functions
Date: Tue, 17 Nov 2020 09:45:57 +0200 [thread overview]
Message-ID: <20201117074557.180602-9-tz.stoyanov@gmail.com> (raw)
In-Reply-To: <20201117074557.180602-1-tz.stoyanov@gmail.com>
There are internal library functions, which are not declared as a static.
They are used inside the library from different files. Hide them from
the library users, as they are not part of the API:
trace_append_file()
str_read_file()
Signed-off-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com>
---
lib/tracefs/include/tracefs-local.h | 2 ++
lib/tracefs/tracefs-events.c | 2 +-
lib/tracefs/tracefs-utils.c | 3 ++-
3 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/lib/tracefs/include/tracefs-local.h b/lib/tracefs/include/tracefs-local.h
index 08b67fa9..9cc371b4 100644
--- a/lib/tracefs/include/tracefs-local.h
+++ b/lib/tracefs/include/tracefs-local.h
@@ -6,6 +6,8 @@
#ifndef _TRACE_FS_LOCAL_H
#define _TRACE_FS_LOCAL_H
+#define __hidden __attribute__((visibility ("hidden")))
+
/* Can be overridden */
void warning(const char *fmt, ...);
int str_read_file(const char *file, char **buffer);
diff --git a/lib/tracefs/tracefs-events.c b/lib/tracefs/tracefs-events.c
index f2c6046c..80a25ee5 100644
--- a/lib/tracefs/tracefs-events.c
+++ b/lib/tracefs/tracefs-events.c
@@ -210,7 +210,7 @@ static char **add_list_string(char **list, const char *name, int len)
return list;
}
-char *trace_append_file(const char *dir, const char *name)
+__hidden char *trace_append_file(const char *dir, const char *name)
{
char *file;
int ret;
diff --git a/lib/tracefs/tracefs-utils.c b/lib/tracefs/tracefs-utils.c
index 227990a9..326b4559 100644
--- a/lib/tracefs/tracefs-utils.c
+++ b/lib/tracefs/tracefs-utils.c
@@ -15,6 +15,7 @@
#include <unistd.h>
#include "tracefs.h"
+#include "tracefs-local.h"
#define TRACEFS_PATH "/sys/kernel/tracing"
#define DEBUGFS_PATH "/sys/kernel/debug"
@@ -188,7 +189,7 @@ void tracefs_put_tracing_file(char *name)
free(name);
}
-int str_read_file(const char *file, char **buffer)
+__hidden int str_read_file(const char *file, char **buffer)
{
char stbuf[BUFSIZ];
char *buf = NULL;
--
2.28.0
prev parent reply other threads:[~2020-11-17 7:46 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-17 7:45 [PATCH v4 0/8] libtracefs fixes and improvements Tzvetomir Stoyanov (VMware)
2020-11-17 7:45 ` [PATCH v4 1/8] trace-cmd: Change tracefs.h include path Tzvetomir Stoyanov (VMware)
2020-11-17 7:45 ` [PATCH v4 2/8] libtracefs: Change get name API to return constant string Tzvetomir Stoyanov (VMware)
2020-11-17 7:45 ` [PATCH v4 3/8] libtracefs: Use tracefs_list_free() API Tzvetomir Stoyanov (VMware)
2020-11-17 7:45 ` [PATCH v4 4/8] libtracefs: Add new API to check if instance exists Tzvetomir Stoyanov (VMware)
2020-11-17 7:45 ` [PATCH v4 5/8] libtracefs: Combine allocate and create APIs into one Tzvetomir Stoyanov (VMware)
2020-11-18 21:44 ` Steven Rostedt
2020-11-18 21:46 ` [PATCH v4.1 - 5.1/8] libtracefs: Use the permissions of the instances directory for instances Steven Rostedt
2020-11-19 15:07 ` Tzvetomir Stoyanov
2020-11-18 21:46 ` [PATCH v4.1 5.2/8] libtracefs: Combine allocate and create APIs into one Steven Rostedt
2020-11-17 7:45 ` [PATCH v4 6/8] libtracefs: Add new tracefs API tracefs_instances_walk() Tzvetomir Stoyanov (VMware)
2020-11-17 7:45 ` [PATCH v4 7/8] trace-cmd: Add new libtrasefs API to get the current trace clock Tzvetomir Stoyanov (VMware)
2020-11-17 7:45 ` 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=20201117074557.180602-9-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 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).