* [PATCH] libtracefs: Add script to find functions not listed in main man page
@ 2022-02-22 18:18 Steven Rostedt
  0 siblings, 0 replies; only message in thread
From: Steven Rostedt @ 2022-02-22 18:18 UTC (permalink / raw)
  To: Linux Trace Devel
From: "Steven Rostedt (Google)" <rostedt@goodmis.org>
This checks all the man pages for any function that is not in the main man
page of libtracefs.txt.
The current run when this script was created produced:
$ ./check-manpages.sh Documentation/
Missing functions from libtracefs.txt that are in libtracefs-dynevents.txt
   tracefs_dynevent_get
   tracefs_dynevent_get_event
Missing functions from libtracefs.txt that are in libtracefs-events-tep.txt
   tracefs_load_cmdlines
Missing functions from libtracefs.txt that are in libtracefs-events.txt
   tracefs_event_enable
   tracefs_event_disable
Missing functions from libtracefs.txt that are in libtracefs-instances-affinity.txt
   tracefs_set_affinity_raw
   tracefs_get_affinity_raw
Missing functions from libtracefs.txt that are in libtracefs-instances-file-manip.txt
   tracefs_instance_file_append
   tracefs_instance_file_clear
Missing functions from libtracefs.txt that are in libtracefs-instances-manage.txt
   tracefs_instance_alloc
Missing functions from libtracefs.txt that are in libtracefs-instances-utils.txt
   tracefs_instance_get_trace_dir
Missing functions from libtracefs.txt that are in libtracefs-options.txt
   tracefs_options
Missing functions from libtracefs.txt that are in libtracefs-stream.txt
   tracefs_trace_pipe_stream
   tracefs_trace_pipe_print
   tracefs_trace_pipe_stop
Missing functions from libtracefs.txt that are in libtracefs-synth-info.txt
   tracefs_synth_get_event
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
---
 check-manpages.sh | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)
 create mode 100755 check-manpages.sh
diff --git a/check-manpages.sh b/check-manpages.sh
new file mode 100755
index 000000000000..a52281198f6e
--- /dev/null
+++ b/check-manpages.sh
@@ -0,0 +1,32 @@
+#!/bin/bash
+# SPDX-License-Identifier: LGPL-2.1
+# Copyright (C) 2022, Google Inc, Steven Rostedt <rostedt@goodmis.org>
+#
+# This checks if any function is listed in a man page that is not listed
+# in the main man page.
+
+if [ $# -lt 1 ]; then
+	echo "usage: check-manpages man-page-path"
+	exit 1
+fi
+
+cd $1
+
+MAIN=libtracefs
+MAIN_FILE=${MAIN}.txt
+
+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
+		if ! grep -q '\*'${a}'\*' $MAIN_FILE; then
+			if [ "$last" == "" ]; then
+				echo
+			fi
+			if [ "$last" != "$man" ]; then
+				echo "Missing functions from $MAIN_FILE that are in $man"
+				last=$man
+			fi
+			echo "   ${a}"
+		fi
+	done
+done
-- 
2.34.1
^ permalink raw reply related	[flat|nested] only message in thread
only message in thread, other threads:[~2022-02-22 18:18 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-22 18:18 [PATCH] libtracefs: Add script to find functions not listed in main man page 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).