libtracefs: Add script to find functions not listed in main man page
PATCH 1/1 libtracefs: Add script to find functions not listed in main man page
From: "Steven Rostedt (Google)" <[email protected]>
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
--- check-manpages.sh | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100755 check-manpages.sh
check-manpages.sh new file +32 -0
@@ -0,0 +1,32 @@ +#!/bin/bash +# SPDX-License-Identifier: LGPL-2.1 +# Copyright (C) 2022, Google Inc, Steven Rostedt <[email protected]> +# +# 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
Signature · 1 line
2.34.1