From: "Tzvetomir Stoyanov (VMware)" <tz.stoyanov@gmail.com>
To: rostedt@goodmis.org
Cc: linux-trace-devel@vger.kernel.org
Subject: [PATCH 02/12] libtracefs: Rename tracefs_get_kprobes API
Date: Thu, 28 Oct 2021 15:08:57 +0300 [thread overview]
Message-ID: <20211028120907.101847-3-tz.stoyanov@gmail.com> (raw)
In-Reply-To: <20211028120907.101847-1-tz.stoyanov@gmail.com>
The names of tracefs API should follow the same pattern:
tracefs_XXX_<action>
Rename tracefs_get_kprobes() to tracefs_kprobes_get() to be
consistent with that pattern.
Signed-off-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com>
---
Documentation/libtracefs-kprobes.txt | 8 ++++----
include/tracefs.h | 2 +-
src/tracefs-kprobes.c | 6 +++---
utest/tracefs-utest.c | 10 +++++-----
4 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/Documentation/libtracefs-kprobes.txt b/Documentation/libtracefs-kprobes.txt
index c10576e..ca48fa9 100644
--- a/Documentation/libtracefs-kprobes.txt
+++ b/Documentation/libtracefs-kprobes.txt
@@ -3,7 +3,7 @@ libtracefs(3)
NAME
----
-tracefs_kprobe_raw, tracefs_kretprobe_raw, tracefs_get_kprobes, tracefs_kprobe_info, tracefs_kprobe_clear_all, tracefs_kprobe_clear_probe - Create, list, and destroy kprobes
+tracefs_kprobe_raw, tracefs_kretprobe_raw, tracefs_kprobes_get, tracefs_kprobe_info, tracefs_kprobe_clear_all, tracefs_kprobe_clear_probe - Create, list, and destroy kprobes
SYNOPSIS
--------
@@ -13,7 +13,7 @@ SYNOPSIS
int tracefs_kprobe_raw(const char pass:[*]system, const char pass:[*]event, const char pass:[*]addr, const char pass:[*]format);
int tracefs_kretprobe_raw(const char pass:[*]system, const char pass:[*]event, const char pass:[*]addr, const char pass:[*]format);
-char pass:[*]pass:[*]tracefs_get_kprobes(enum tracefs_kprobe_type type);
+char pass:[*]pass:[*]tracefs_kprobes_get(enum tracefs_kprobe_type type);
enum tracefs_kprobe_type tracefs_kprobe_info(const char pass:[*]group, const char pass:[*]event,
char pass:[*]pass:[*]type, char pass:[*]pass:[*]addr, char pass:[*]pass:[*]format);
enum tracefs_kprobe_type tracefs_kprobe_type(const char pass:[*]group, const char pass:[*]event)
@@ -36,7 +36,7 @@ document.
creates a kretprobe instead of a kprobe. The difference is also described
in the Linux kernel source in the Documentation/trace/kprobetrace.rst file.
-*tracefs_get_kprobes*() returns an array of strings (char pass:[*]) that contain
+*tracefs_kprobes_get*() returns an array of strings (char pass:[*]) that contain
the registered kprobes and kretprobes depending on the given _type_. If _type_ is
TRACEFS_ALL_KPROBES, then all kprobes found are returned. If _type_ is
TRACEFS_KPROBE, then only normal kprobes are returned. If _type_ is
@@ -76,7 +76,7 @@ If a parsing error occurs on *tracefs_kprobe_raw*() or *tracefs_kretprobe_raw*()
then *tracefs_error_last*(3) may be used to retrieve the error message explaining
the parsing issue.
-*tracefs_get_kprobes*() returns an allocate string list of allocated strings
+*tracefs_kprobes_get*() returns an allocate string list of allocated strings
on success that must be freed with *tracefs_list_free*(3) and returns
NULL on error.
diff --git a/include/tracefs.h b/include/tracefs.h
index 4020551..0240aef 100644
--- a/include/tracefs.h
+++ b/include/tracefs.h
@@ -251,7 +251,7 @@ int tracefs_kprobe_raw(const char *system, const char *event,
const char *addr, const char *format);
int tracefs_kretprobe_raw(const char *system, const char *event,
const char *addr, const char *format);
-char **tracefs_get_kprobes(enum tracefs_kprobe_type type);
+char **tracefs_kprobes_get(enum tracefs_kprobe_type type);
enum tracefs_kprobe_type tracefs_kprobe_info(const char *group, const char *event,
char **type, char **addr, char **format);
int tracefs_kprobe_clear_all(bool force);
diff --git a/src/tracefs-kprobes.c b/src/tracefs-kprobes.c
index 6fdd8f9..d4c5f9e 100644
--- a/src/tracefs-kprobes.c
+++ b/src/tracefs-kprobes.c
@@ -158,7 +158,7 @@ static int parse_kprobe(char *content, char **saveptr,
}
/**
- * tracefs_get_kprobes - return a list kprobes (by group/event name)
+ * tracefs_kprobes_get - return a list kprobes (by group/event name)
* @type: The type of kprobes to return.
*
* If @type is TRACEFS_ALL_KPROBES all kprobes in the kprobe_events
@@ -174,7 +174,7 @@ static int parse_kprobe(char *content, char **saveptr,
* only a NULL pointer.
* On error, NULL is returned.
*/
-char **tracefs_get_kprobes(enum tracefs_kprobe_type type)
+char **tracefs_kprobes_get(enum tracefs_kprobe_type type)
{
char **list = NULL;
char *content;
@@ -357,7 +357,7 @@ static int kprobe_clear_probes(const char *group, bool force)
int ret;
int i;
- kprobe_list = tracefs_get_kprobes(TRACEFS_ALL_KPROBES);
+ kprobe_list = tracefs_kprobes_get(TRACEFS_ALL_KPROBES);
if (!kprobe_list)
return -1;
diff --git a/utest/tracefs-utest.c b/utest/tracefs-utest.c
index 09bb8f2..7c1a84e 100644
--- a/utest/tracefs-utest.c
+++ b/utest/tracefs-utest.c
@@ -583,7 +583,7 @@ static void test_instance_file(void)
free(kaddr);
free(kformat);
- kprobes = tracefs_get_kprobes(TRACEFS_ALL_KPROBES);
+ kprobes = tracefs_kprobes_get(TRACEFS_ALL_KPROBES);
CU_TEST(kprobes != NULL);
for (i = 0; kprobes[i]; i++) {
@@ -612,7 +612,7 @@ static void test_instance_file(void)
tracefs_list_free(kprobes);
CU_TEST(i == 3);
- kprobes = tracefs_get_kprobes(TRACEFS_KPROBE);
+ kprobes = tracefs_kprobes_get(TRACEFS_KPROBE);
CU_TEST(kprobes != NULL);
for (i = 0; kprobes[i]; i++) {
@@ -631,7 +631,7 @@ static void test_instance_file(void)
tracefs_list_free(kprobes);
CU_TEST(i == 2);
- kprobes = tracefs_get_kprobes(TRACEFS_KRETPROBE);
+ kprobes = tracefs_kprobes_get(TRACEFS_KRETPROBE);
CU_TEST(kprobes != NULL);
for (i = 0; kprobes[i]; i++) {
@@ -663,7 +663,7 @@ static void test_instance_file(void)
ret = tracefs_kprobe_clear_probe(KPROBE_2_GROUP, NULL, true);
CU_TEST(ret == 0);
- kprobes = tracefs_get_kprobes(TRACEFS_ALL_KPROBES);
+ kprobes = tracefs_kprobes_get(TRACEFS_ALL_KPROBES);
CU_TEST(kprobes != NULL);
for (i = 0; kprobes[i]; i++) {
@@ -682,7 +682,7 @@ static void test_instance_file(void)
ret = tracefs_kprobe_clear_all(true);
CU_TEST(ret == 0);
- kprobes = tracefs_get_kprobes(TRACEFS_ALL_KPROBES);
+ kprobes = tracefs_kprobes_get(TRACEFS_ALL_KPROBES);
CU_TEST(kprobes != NULL);
CU_TEST(kprobes[0] == NULL);
--
2.31.1
next prev parent reply other threads:[~2021-10-28 12:09 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-28 12:08 [PATCH 00/12] libtracefs dynamic events support Tzvetomir Stoyanov (VMware)
2021-10-28 12:08 ` [PATCH 01/12] libtracefs: Add new internal APIs for dynamic events Tzvetomir Stoyanov (VMware)
2021-10-28 21:41 ` Steven Rostedt
2021-10-29 2:46 ` Tzvetomir Stoyanov
2021-10-29 3:09 ` Steven Rostedt
2021-10-28 12:08 ` Tzvetomir Stoyanov (VMware) [this message]
2021-10-28 12:08 ` [PATCH 03/12] libtracefs: New kprobes APIs Tzvetomir Stoyanov (VMware)
2021-10-29 2:55 ` Steven Rostedt
2021-10-28 12:08 ` [PATCH 04/12] libtracefs: Remove redundant " Tzvetomir Stoyanov (VMware)
2021-10-28 12:09 ` [PATCH 05/12] libtracefs: Reimplement tracefs_kprobes_get API Tzvetomir Stoyanov (VMware)
2021-10-29 3:01 ` Steven Rostedt
2021-10-28 12:09 ` [PATCH 06/12] libtracefs: Change tracefs_kprobe_info API Tzvetomir Stoyanov (VMware)
2021-10-28 12:09 ` [PATCH 07/12] libtracefs: Reimplement kprobe raw APIs Tzvetomir Stoyanov (VMware)
2021-10-28 12:09 ` [PATCH 08/12] libtracefs: Extend kprobes unit test Tzvetomir Stoyanov (VMware)
2021-10-28 12:09 ` [PATCH 09/12] libtracefs: Update kprobes man pages Tzvetomir Stoyanov (VMware)
2021-10-28 12:09 ` [PATCH 10/12] libtracefs: Rename tracefs_synth_init API Tzvetomir Stoyanov (VMware)
2021-10-28 12:09 ` [PATCH 11/12] libtracefs: Use the internal dynamic events API when creating synthetic events Tzvetomir Stoyanov (VMware)
2021-10-28 12:09 ` [PATCH 12/12] libtracefs: Document tracefs_dynevent_list_free() API Tzvetomir Stoyanov (VMware)
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=20211028120907.101847-3-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).