diff mbox series

[02/12] libtracefs: Rename tracefs_get_kprobes API

Message ID 20211028120907.101847-3-tz.stoyanov@gmail.com (mailing list archive)
State Superseded
Headers show
Series libtracefs dynamic events support | expand

Commit Message

Tzvetomir Stoyanov (VMware) Oct. 28, 2021, 12:08 p.m. UTC
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 mbox series

Patch

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);