Skip to contentSkip to conversation

trace-cmd: Add check for duplicate functions in man pages

PATCH New Steven Rostedt 1 participant 1 message Jan 4, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 trace-cmd: Add check for duplicate functions in man pages

From: "Steven Rostedt (Google)" <[email protected]>

Update the check-manpages.sh script to make sure that there are no functions that are described in more than one man page.

---
 check-manpages.sh | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
check-manpages.sh +8 -1
index 1166bbe82cad..f73a6c573f6c 100755
@@ -15,12 +15,19 @@ cd $1
 MAIN=libtracecmd
 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
Signature · 1 line
2.35.1