linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Linux Trace Devel <linux-trace-devel@vger.kernel.org>
Subject: [PATCH] libtracefs: Add script to find functions not listed in main man page
Date: Tue, 22 Feb 2022 13:18:16 -0500	[thread overview]
Message-ID: <20220222131816.0bfdb33e@gandalf.local.home> (raw)

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


                 reply	other threads:[~2022-02-22 18:18 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20220222131816.0bfdb33e@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=linux-trace-devel@vger.kernel.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).