* [PATCH 0/2] libtraceevent: Remove duplicate man page functions
@ 2023-01-04 17:26 Steven Rostedt
  2023-01-04 17:26 ` [PATCH 1/2] libtraceevent: Add check for duplicate functions in man pages Steven Rostedt
  2023-01-04 17:26 ` [PATCH 2/2] libtraceevent: Remove tep_find_function{_address}() from libtraceevent-func_apis.txt Steven Rostedt
  0 siblings, 2 replies; 3+ messages in thread
From: Steven Rostedt @ 2023-01-04 17:26 UTC (permalink / raw)
  To: linux-trace-devel; +Cc: Daniel Wagner, Steven Rostedt (Google)
From: "Steven Rostedt (Google)" <rostedt@goodmis.org>
When Daniel Wagner was working on converting the Makefiles over to meson, he
found that there were two functions that were duplicated in the man pages.
This causes issues with meson in the build process.
Not only remove the duplicate functions, but also update the check-manpages.sh
script to catch duplicates in the future.
Steven Rostedt (Google) (2):
  libtraceevent: Add check for duplicate functions in man pages
  libtraceevent: Remove tep_find_function{_address}() from
    libtraceevent-func_apis.txt
 Documentation/libtraceevent-func_apis.txt | 26 ++++-------------------
 check-manpages.sh                         |  9 +++++++-
 2 files changed, 12 insertions(+), 23 deletions(-)
-- 
2.35.1
^ permalink raw reply	[flat|nested] 3+ messages in thread
* [PATCH 1/2] libtraceevent: Add check for duplicate functions in man pages
  2023-01-04 17:26 [PATCH 0/2] libtraceevent: Remove duplicate man page functions Steven Rostedt
@ 2023-01-04 17:26 ` Steven Rostedt
  2023-01-04 17:26 ` [PATCH 2/2] libtraceevent: Remove tep_find_function{_address}() from libtraceevent-func_apis.txt Steven Rostedt
  1 sibling, 0 replies; 3+ messages in thread
From: Steven Rostedt @ 2023-01-04 17:26 UTC (permalink / raw)
  To: linux-trace-devel; +Cc: Daniel Wagner, Steven Rostedt (Google)
From: "Steven Rostedt (Google)" <rostedt@goodmis.org>
Update the check-manpages.sh script to make sure that there are no
functions that are described in more than one man page.
The output will look like this:
  Found tep_find_function in libtraceevent-func_find.txt and in libtraceevent-func_apis.txt
  Found tep_find_function_address in libtraceevent-func_find.txt and in libtraceevent-func_apis.txt
Link: https://lore.kernel.org/linux-trace-devel/20221224153225.ojre2c3fxktfxtj2@carbon.lan/
Reported-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
---
 check-manpages.sh | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/check-manpages.sh b/check-manpages.sh
index 85b3b7406864..4e9850f18c3d 100755
--- a/check-manpages.sh
+++ b/check-manpages.sh
@@ -15,12 +15,19 @@ cd $1
 MAIN=libtraceevent
 MAIN_FILE=${MAIN}.txt
 
+PROCESSED=""
+
 # Ignore man pages that do not contain functions
 IGNORE=""
 
 for man in ${MAIN}-*.txt; do
 
-	sed -ne '/^NAME/,/^SYNOP/{/^[a-z]/{s/, *$//;s/,/\n/g;s/ //g;s/-.*$/-/;/-/{s/-//p;q};p}}' $man | while read a; do
+	for a in `sed -ne '/^NAME/,/^SYNOP/{/^[a-z]/{s/, *$//;s/,/\n/g;s/ //g;s/-.*$/-/;/-/{s/-//p;q};p}}' $man`; do
+		if [ "${PROCESSED/:${a} /}" != "${PROCESSED}" ]; then
+			P="${PROCESSED/:${a} */}"
+			echo "Found ${a} in ${man} and in ${P/* /}"
+		fi
+		PROCESSED="${man}:${a} ${PROCESSED}"
 		if [ "${IGNORE/$man/}" != "${IGNORE}" ]; then
 			continue
 		fi
-- 
2.35.1
^ permalink raw reply related	[flat|nested] 3+ messages in thread
* [PATCH 2/2] libtraceevent: Remove tep_find_function{_address}() from libtraceevent-func_apis.txt
  2023-01-04 17:26 [PATCH 0/2] libtraceevent: Remove duplicate man page functions Steven Rostedt
  2023-01-04 17:26 ` [PATCH 1/2] libtraceevent: Add check for duplicate functions in man pages Steven Rostedt
@ 2023-01-04 17:26 ` Steven Rostedt
  1 sibling, 0 replies; 3+ messages in thread
From: Steven Rostedt @ 2023-01-04 17:26 UTC (permalink / raw)
  To: linux-trace-devel; +Cc: Daniel Wagner, Steven Rostedt (Google)
From: "Steven Rostedt (Google)" <rostedt@goodmis.org>
When a man page has more than 9 APIs described in it, asciidoc starts to
complain. As there were more functions being added to the function tep
interface, the man page that described the function interface was split to
have the "find" functions in a separate man page. But two functions were
left behind in the old libtraceevent-func_apis.txt man page:
  tep_find_function()
  tep_find_function_address()
This causes issue because it becomes ambiguous to which man page to read,
and one may become out of date. Remove the description from the
libtraceevent-func_apis.txt as they are described in
libtraceevent-func_find.txt man page.
Link: https://lore.kernel.org/linux-trace-devel/20221224153225.ojre2c3fxktfxtj2@carbon.lan/
Fixes: dd8094ac7252 ("tools lib traceevent: Man pages for function related libtraceevent APIs")
Reported-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
---
 Documentation/libtraceevent-func_apis.txt | 26 ++++-------------------
 1 file changed, 4 insertions(+), 22 deletions(-)
diff --git a/Documentation/libtraceevent-func_apis.txt b/Documentation/libtraceevent-func_apis.txt
index a465d63ff5b5..1b836a12e5ce 100644
--- a/Documentation/libtraceevent-func_apis.txt
+++ b/Documentation/libtraceevent-func_apis.txt
@@ -3,10 +3,8 @@ libtraceevent(3)
 
 NAME
 ----
-tep_find_function, tep_find_function_address, tep_set_function_resolver,
-tep_reset_function_resolver, tep_register_function, tep_register_print_string,
-tep_get_function_count -
-function related tep APIs
+tep_set_function_resolver, tep_reset_function_resolver, tep_register_function, tep_register_print_string,
+tep_get_function_count - function related tep APIs
 
 SYNOPSIS
 --------
@@ -17,8 +15,6 @@ SYNOPSIS
 typedef char pass:[*](*tep_func_resolver_t*)(void pass:[*]_priv_, unsigned long long pass:[*]_addrp_, char pass:[**]_modp_);
 int *tep_set_function_resolver*(struct tep_handle pass:[*]_tep_, tep_func_resolver_t pass:[*]_func_, void pass:[*]_priv_);
 void *tep_reset_function_resolver*(struct tep_handle pass:[*]_tep_);
-const char pass:[*]*tep_find_function*(struct tep_handle pass:[*]_tep_, unsigned long long _addr_);
-unsigned long long *tep_find_function_address*(struct tep_handle pass:[*]_tep_, unsigned long long _addr_);
 int *tep_register_function*(struct tep_handle pass:[*]_tep_, char pass:[*]_name_, unsigned long long _addr_, char pass:[*]_mod_);
 int *tep_register_print_string*(struct tep_handle pass:[*]_tep_, const char pass:[*]_fmt_, unsigned long long _addr_);
 int *tep_get_function_count*(struct tep_handle *_tep_)
@@ -38,8 +34,8 @@ the name of the function and its module (if any) in _modp_.
 The *tep_set_function_resolver()* function registers _func_ as an alternative
 kernel functions resolver. The _tep_ argument is trace event parser context.
 The _priv_ argument is a custom context of the _func_ function. The function
-resolver is used by the APIs *tep_find_function()*,
-*tep_find_function_address()*, and *tep_print_func_field()* to resolve
+resolver is used by the APIs *tep_find_function*(3),
+*tep_find_function_address*(3), and *tep_print_func_field()* to resolve
 a function address to a function name.
 
 The *tep_reset_function_resolver()* function resets the kernel functions
@@ -51,14 +47,6 @@ These APIs can be used to find function name and start address, by given
 address. The given address does not have to be exact, it will select
 the function that would contain it.
 
-The *tep_find_function()* function returns the function name, which contains the
-given address _addr_. The _tep_ argument is the trace event parser context.
-
-The *tep_find_function_address()* function returns the function start address,
-by given address _addr_. The _addr_ does not have to be exact, it will select
-the function that would contain it. The _tep_ argument is the trace event
-parser context.
-
 The *tep_register_function()* function registers a function name mapped to an
 address and (optional) module. This mapping is used in case the function tracer
 or events have "%pS" parameter in its format string. It is common to pass in
@@ -84,12 +72,6 @@ RETURN VALUE
 The *tep_set_function_resolver()* function returns 0 in case of success, or -1
 in case of an error.
 
-The *tep_find_function()* function returns the function name, or NULL in case
-it cannot be found.
-
-The *tep_find_function_address()* function returns the function start address,
-or 0 in case it cannot be found.
-
 The *tep_register_function()* function returns 0 in case of success. In case of
 an error -1 is returned, and errno is set to the appropriate error number.
 
-- 
2.35.1
^ permalink raw reply related	[flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-01-04 17:27 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-04 17:26 [PATCH 0/2] libtraceevent: Remove duplicate man page functions Steven Rostedt
2023-01-04 17:26 ` [PATCH 1/2] libtraceevent: Add check for duplicate functions in man pages Steven Rostedt
2023-01-04 17:26 ` [PATCH 2/2] libtraceevent: Remove tep_find_function{_address}() from libtraceevent-func_apis.txt Steven Rostedt
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).