manual: scripts/documented.sh updated

Message ID CALkY8p_KM-TgC9mYzMvDvcYx4M_QtB6vBR2MQ933TAPwK4pp_w@mail.gmail.com
State Changes Requested, archived
Headers
Series manual: scripts/documented.sh updated |

Checks

Context Check Description
dj/TryBot-apply_patch success Patch applied to master at the time it was sent
dj/TryBot-32bit success Build for i686

Commit Message

Girish Joshi Feb. 24, 2023, 2:34 p.m. UTC
  Hello,
As per the Missing Functions section of master Todo list[1],
scripts/documented.sh needs to be updated.

Could someone please review this patch?
It removes the reference to linuxthreads/*.taxi files from the script
and removes the individual email address from the output.

Thanks!
Girish Joshi
girishjoshi.io

[1]: https://sourceware.org/glibc/wiki/Development_Todo/Master
  

Comments

Florian Weimer Feb. 27, 2023, 5:56 p.m. UTC | #1
* Girish Joshi via Libc-alpha:

> Hello,
> As per the Missing Functions section of master Todo list[1],
> scripts/documented.sh needs to be updated.
>
> Could someone please review this patch?
> It removes the reference to linuxthreads/*.taxi files from the script
> and removes the individual email address from the output.

The script still doesn't seem to work, probably because the symbol names
are not extract properly:

43120 T _dl_mcount_wrapper 	43140 T _dl_mcount_wrapper_c 	43320 W clogf 	43320 W clogf32
435c0 T _dl_find_object 	43740 T realpath 	43770 T quick_exit 	43790 T _IO_vfscanf
437c0 T _pthread_cleanup_pus 	437d0 T _pthread_cleanup_pop 	437d0 W cprojf 	437d0 W cprojf32

_dl_find_object is documented.

_IO_vfscanf should be recognized as an alias of vfscanf, but this is
more of an RFE than a bug fix.

Thanks,
Florian
  
Girish Joshi March 5, 2023, 6:14 a.m. UTC | #2
Hi Florian,
Thanks for the review.
Turns out `diff` was not working with the given input files, this
patch fixes that.
I'm not sure if there is a list of people who volunteered to document
some specific functions.
So that comment from the output html is removed.

Thanks!
Girish Joshi

On Mon, Feb 27, 2023 at 11:26 PM Florian Weimer <fweimer@redhat.com> wrote:
>
> * Girish Joshi via Libc-alpha:
>
> > Hello,
> > As per the Missing Functions section of master Todo list[1],
> > scripts/documented.sh needs to be updated.
> >
> > Could someone please review this patch?
> > It removes the reference to linuxthreads/*.taxi files from the script
> > and removes the individual email address from the output.
>
> The script still doesn't seem to work, probably because the symbol names
> are not extract properly:
>
> 43120 T _dl_mcount_wrapper      43140 T _dl_mcount_wrapper_c    43320 W clogf   43320 W clogf32
> 435c0 T _dl_find_object         43740 T realpath        43770 T quick_exit      43790 T _IO_vfscanf
> 437c0 T _pthread_cleanup_pus    437d0 T _pthread_cleanup_pop    437d0 W cprojf  437d0 W cprojf32
>
> _dl_find_object is documented.
>
> _IO_vfscanf should be recognized as an alias of vfscanf, but this is
> more of an RFE than a bug fix.
>
> Thanks,
> Florian
>
  
Girish Joshi March 5, 2023, 6:55 a.m. UTC | #3
Also,
> On Mon, Feb 27, 2023 at 11:26 PM Florian Weimer <fweimer@redhat.com> wrote:
> _IO_vfscanf should be recognized as an alias of vfscanf, but this is
> more of an RFE than a bug fix.
I'll try to figure out a way to mark such functions as aliases, as of
now the script does not do that.

Thanks,
Girish Joshi


On Sun, Mar 5, 2023 at 11:44 AM Girish Joshi <girish946@gmail.com> wrote:
>
> Hi Florian,
> Thanks for the review.
> Turns out `diff` was not working with the given input files, this
> patch fixes that.
> I'm not sure if there is a list of people who volunteered to document
> some specific functions.
> So that comment from the output html is removed.
>
> Thanks!
> Girish Joshi
>

> >
> > * Girish Joshi via Libc-alpha:
> >
> > > Hello,
> > > As per the Missing Functions section of master Todo list[1],
> > > scripts/documented.sh needs to be updated.
> > >
> > > Could someone please review this patch?
> > > It removes the reference to linuxthreads/*.taxi files from the script
> > > and removes the individual email address from the output.
> >
> > The script still doesn't seem to work, probably because the symbol names
> > are not extract properly:
> >
> > 43120 T _dl_mcount_wrapper      43140 T _dl_mcount_wrapper_c    43320 W clogf   43320 W clogf32
> > 435c0 T _dl_find_object         43740 T realpath        43770 T quick_exit      43790 T _IO_vfscanf
> > 437c0 T _pthread_cleanup_pus    437d0 T _pthread_cleanup_pop    437d0 W cprojf  437d0 W cprojf32
> >
> > _dl_find_object is documented.
> >
> > _IO_vfscanf should be recognized as an alias of vfscanf, but this is
> > more of an RFE than a bug fix.
> >
> > Thanks,
> > Florian
> >
  
Joe Talbott March 11, 2023, 2:48 p.m. UTC | #4
On Sun, Mar 05, 2023 at 11:44:22AM +0530, Girish Joshi via Libc-alpha wrote:
> Hi Florian,
> Thanks for the review.
> Turns out `diff` was not working with the given input files, this
> patch fixes that.
> I'm not sure if there is a list of people who volunteered to document
> some specific functions.
> So that comment from the output html is removed.
> 
> Thanks!
> Girish Joshi
> 
> On Mon, Feb 27, 2023 at 11:26 PM Florian Weimer <fweimer@redhat.com> wrote:
> >
> > * Girish Joshi via Libc-alpha:
> >
> > > Hello,
> > > As per the Missing Functions section of master Todo list[1],
> > > scripts/documented.sh needs to be updated.
> > >
> > > Could someone please review this patch?
> > > It removes the reference to linuxthreads/*.taxi files from the script
> > > and removes the individual email address from the output.
> >
> > The script still doesn't seem to work, probably because the symbol names
> > are not extract properly:
> >
> > 43120 T _dl_mcount_wrapper      43140 T _dl_mcount_wrapper_c    43320 W clogf   43320 W clogf32
> > 435c0 T _dl_find_object         43740 T realpath        43770 T quick_exit      43790 T _IO_vfscanf
> > 437c0 T _pthread_cleanup_pus    437d0 T _pthread_cleanup_pop    437d0 W cprojf  437d0 W cprojf32
> >
> > _dl_find_object is documented.
> >
> > _IO_vfscanf should be recognized as an alias of vfscanf, but this is
> > more of an RFE than a bug fix.
> >
> > Thanks,
> > Florian
> >

> From 5148c65ac07688dc5c3ee79a9b0f054232d64df3 Mon Sep 17 00:00:00 2001
> From: Girish Joshi <girish946@gmail.com>
> Date: Sun, 5 Mar 2023 11:15:00 +0530
> Subject: [PATCH] manual: scripts/documented.sh updated
> 
> References for linuxthreads are removed from scripts/documented.sh.
> Also removed the individual email address from the html output.
> 
> Fixed the steps to retrive undocumented functions
> ---
>  scripts/documented.sh | 44 +++++++++++++++++++++++++++++++------------
>  1 file changed, 32 insertions(+), 12 deletions(-)
>  mode change 100644 => 100755 scripts/documented.sh
> 
> diff --git a/scripts/documented.sh b/scripts/documented.sh
> old mode 100644
> new mode 100755
> index 7d1ffd4a92..dda6a32283
> --- a/scripts/documented.sh
> +++ b/scripts/documented.sh
> @@ -1,9 +1,15 @@
>  #!/bin/sh
>  bindir=$1
>  
> -VERSION=1.0
> +# usage: scripts/documented.sh <path to glibc build directory>
> +# for example:
> +# scripts/documented.sh $HOME/build/glibc
>  
> -grep -E -h @deftypefu?nx? *.texi ../linuxthreads/*.texi |
> +VERSION=1.1
> +
> +# Collect the documented functions from manual/*.texi files.
> +
> +grep -E -h @deftypefu?nx? manual/*.texi |
>  sed -e 's/@deftypefunx*[[:space:]]*\({[^{]*}\|[[:alnum:]_]*\)[[:space:]]*\([[:alnum:]_]*\).*/\2/' -e 's/@deftypefn {[^}]*function}*[[:space:]]*\({[^{]*}\|[[:alnum:]_]*\)[[:space:]]*\([[:alnum:]_]*\).*/\2/' -e '/^@/d' |
>  sed -e '/^obstack_/d' -e '/^\([lf]\|\)stat\(\|64\)$/d' -e '/^mknod$/d' |
>  sed -e '/^signbit$/d' -e '/^sigsetjmp$/d' |
> @@ -12,9 +18,12 @@ sed -e '/^__fwriting$/d' -e '/^__fwritable$/d' -e '/^__fsetlocking$/d' |
>  sed -e '/^__freading$/d' -e '/^__freadable$/d' -e '/^__fpurge$/d' |
>  sed -e '/^__fpending$/d' -e '/^__flbf$/d' -e '/^__fbufsize$/d' |
>  sed -e '/^alloca$/d' |
> +sed -r '/^\s*$/d' |
>  sort -u > DOCUMENTED
>  
> -nm --extern --define $bindir/libc.so $bindir/math/libm.so $bindir/rt/librt.so $bindir/linuxthreads/libpthread.so $bindir/dlfcn/libdl.so $bindir/crypt/libcrypt.so $bindir/login/libutil.so |
> +
> +# extract the exported symbols from the libraries.
> +nm --extern --define $bindir/libc.so $bindir/math/libm.so $bindir/rt/librt.so $bindir/nptl/libpthread.so $bindir/dlfcn/libdl.so $bindir/crypt/libcrypt.so $bindir/login/libutil.so |
>  grep -E " [TW] ([[:alpha:]]|_[[:alpha:]])" |
>  sed 's/\(@.*\)//' |
>  cut -b 12- |

You can change this to 'cut -v 20-' and avoid the extra
AVAILABLE_WITHOUT_OFFSET part.

Thanks,
Joe
> @@ -25,6 +34,9 @@ sed -e '/^_mcleanup$/d' -e '/^_rpc_dtablesize$/d' -e '/^_seterr_reply$/d' |
>  sed -e '/^_nss/d' -e '/^_setjmp$/d' |
>  sort -u > AVAILABLE
>  
> +# remove offset details from nm output
> +cat AVAILABLE | cut -b 9-  | sort -u  > AVAILABLE_WITHOUT_OFFSET
> +
>  cat <<EOF
>  <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
>  <html>
> @@ -39,9 +51,7 @@ cat <<EOF
>      which are not yet documented in the manual.  This list is
>      automatically created and therefore might contain errors.  Please
>      check the latest manual (available from the CVS archive) before
> -    starting to work.  It might also be good to let me know in
> -    advanace on which functions you intend to work to avoid
> -    duplication.</p>
> +    starting to work.</p>
>  
>      <p>A few comments:</p>
>  
> @@ -52,15 +62,23 @@ cat <<EOF
>        <li>Similarly for the LFS functions (those ending in 64).</li>
>      </ul>
>  
> -    <p>The function sombody already volunteered to document are marked
> -    with a reference to the person.</p>
>  
>      <center><table>
>  EOF
>  
>  n=0
> -diff -y --width=60 --suppress-common-lines DOCUMENTED AVAILABLE |
> -expand | cut -b 33- | sed '/^[[:space:]]*$/d' |
> +
> +# get the list of undocumented functions
> +grep -Fvx -f DOCUMENTED AVAILABLE_WITHOUT_OFFSET > UNDOCUMENTED_WITHOUT_OFFSET
> +
> +# get undocumented functions with offset info
> +for func in `cat UNDOCUMENTED_WITHOUT_OFFSET`
> +do
> +  grep " $func$" AVAILABLE >> UNDOCUMENTED
> +done
> +
> +diff -y --width=120 --suppress-common-lines DOCUMENTED UNDOCUMENTED |
> +expand | cut -b 61- | sed '/^[[:space:]]*$/d' |
>  while read name; do
>    line="$line
>  <td><tt>$name</tt></td>"
> @@ -95,8 +113,10 @@ cat <<EOF
>      </table></center>
>  
>      <hr>
> -    <address><a href="mailto:drepper@redhat.com">Ulrich Drepper</a></address>
> -Generated on $(date) with documented.sh version $VERSION
> +    Generated on $(date) with documented.sh version $VERSION
>    </body>
>  </html>
>  EOF
> +
> +# cleanup the files
> +rm -rf UNDOCUMENTED_WITHOUT_OFFSET AVAILABLE_WITHOUT_OFFSET AVAILABLE
> -- 
> 2.39.2
>
  
Girish Joshi March 30, 2024, 6:54 p.m. UTC | #5
Thanks Joe, I've updated the script.
It's just that the output now does not contain the addresses and the
T/W info about the symbol is not present.
Do we need that info about each symbol in the output?

Thanks!
Girish Joshi
girishjoshi.io

On Sat, Mar 11, 2023 at 8:18 PM Joe Simmons-Talbott
<joetalbott@gmail.com> wrote:
>
> On Sun, Mar 05, 2023 at 11:44:22AM +0530, Girish Joshi via Libc-alpha wrote:
> > Hi Florian,
> > Thanks for the review.
> > Turns out `diff` was not working with the given input files, this
> > patch fixes that.
> > I'm not sure if there is a list of people who volunteered to document
> > some specific functions.
> > So that comment from the output html is removed.
> >
> > Thanks!
> > Girish Joshi
> >
> > On Mon, Feb 27, 2023 at 11:26 PM Florian Weimer <fweimer@redhat.com> wrote:
> > >
> > > * Girish Joshi via Libc-alpha:
> > >
> > > > Hello,
> > > > As per the Missing Functions section of master Todo list[1],
> > > > scripts/documented.sh needs to be updated.
> > > >
> > > > Could someone please review this patch?
> > > > It removes the reference to linuxthreads/*.taxi files from the script
> > > > and removes the individual email address from the output.
> > >
> > > The script still doesn't seem to work, probably because the symbol names
> > > are not extract properly:
> > >
> > > 43120 T _dl_mcount_wrapper      43140 T _dl_mcount_wrapper_c    43320 W clogf   43320 W clogf32
> > > 435c0 T _dl_find_object         43740 T realpath        43770 T quick_exit      43790 T _IO_vfscanf
> > > 437c0 T _pthread_cleanup_pus    437d0 T _pthread_cleanup_pop    437d0 W cprojf  437d0 W cprojf32
> > >
> > > _dl_find_object is documented.
> > >
> > > _IO_vfscanf should be recognized as an alias of vfscanf, but this is
> > > more of an RFE than a bug fix.
> > >
> > > Thanks,
> > > Florian
> > >
>
> > From 5148c65ac07688dc5c3ee79a9b0f054232d64df3 Mon Sep 17 00:00:00 2001
> > From: Girish Joshi <girish946@gmail.com>
> > Date: Sun, 5 Mar 2023 11:15:00 +0530
> > Subject: [PATCH] manual: scripts/documented.sh updated
> >
> > References for linuxthreads are removed from scripts/documented.sh.
> > Also removed the individual email address from the html output.
> >
> > Fixed the steps to retrive undocumented functions
> > ---
> >  scripts/documented.sh | 44 +++++++++++++++++++++++++++++++------------
> >  1 file changed, 32 insertions(+), 12 deletions(-)
> >  mode change 100644 => 100755 scripts/documented.sh
> >
> > diff --git a/scripts/documented.sh b/scripts/documented.sh
> > old mode 100644
> > new mode 100755
> > index 7d1ffd4a92..dda6a32283
> > --- a/scripts/documented.sh
> > +++ b/scripts/documented.sh
> > @@ -1,9 +1,15 @@
> >  #!/bin/sh
> >  bindir=$1
> >
> > -VERSION=1.0
> > +# usage: scripts/documented.sh <path to glibc build directory>
> > +# for example:
> > +# scripts/documented.sh $HOME/build/glibc
> >
> > -grep -E -h @deftypefu?nx? *.texi ../linuxthreads/*.texi |
> > +VERSION=1.1
> > +
> > +# Collect the documented functions from manual/*.texi files.
> > +
> > +grep -E -h @deftypefu?nx? manual/*.texi |
> >  sed -e 's/@deftypefunx*[[:space:]]*\({[^{]*}\|[[:alnum:]_]*\)[[:space:]]*\([[:alnum:]_]*\).*/\2/' -e 's/@deftypefn {[^}]*function}*[[:space:]]*\({[^{]*}\|[[:alnum:]_]*\)[[:space:]]*\([[:alnum:]_]*\).*/\2/' -e '/^@/d' |
> >  sed -e '/^obstack_/d' -e '/^\([lf]\|\)stat\(\|64\)$/d' -e '/^mknod$/d' |
> >  sed -e '/^signbit$/d' -e '/^sigsetjmp$/d' |
> > @@ -12,9 +18,12 @@ sed -e '/^__fwriting$/d' -e '/^__fwritable$/d' -e '/^__fsetlocking$/d' |
> >  sed -e '/^__freading$/d' -e '/^__freadable$/d' -e '/^__fpurge$/d' |
> >  sed -e '/^__fpending$/d' -e '/^__flbf$/d' -e '/^__fbufsize$/d' |
> >  sed -e '/^alloca$/d' |
> > +sed -r '/^\s*$/d' |
> >  sort -u > DOCUMENTED
> >
> > -nm --extern --define $bindir/libc.so $bindir/math/libm.so $bindir/rt/librt.so $bindir/linuxthreads/libpthread.so $bindir/dlfcn/libdl.so $bindir/crypt/libcrypt.so $bindir/login/libutil.so |
> > +
> > +# extract the exported symbols from the libraries.
> > +nm --extern --define $bindir/libc.so $bindir/math/libm.so $bindir/rt/librt.so $bindir/nptl/libpthread.so $bindir/dlfcn/libdl.so $bindir/crypt/libcrypt.so $bindir/login/libutil.so |
> >  grep -E " [TW] ([[:alpha:]]|_[[:alpha:]])" |
> >  sed 's/\(@.*\)//' |
> >  cut -b 12- |
>
> You can change this to 'cut -v 20-' and avoid the extra
> AVAILABLE_WITHOUT_OFFSET part.
>
> Thanks,
> Joe
> > @@ -25,6 +34,9 @@ sed -e '/^_mcleanup$/d' -e '/^_rpc_dtablesize$/d' -e '/^_seterr_reply$/d' |
> >  sed -e '/^_nss/d' -e '/^_setjmp$/d' |
> >  sort -u > AVAILABLE
> >
> > +# remove offset details from nm output
> > +cat AVAILABLE | cut -b 9-  | sort -u  > AVAILABLE_WITHOUT_OFFSET
> > +
> >  cat <<EOF
> >  <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
> >  <html>
> > @@ -39,9 +51,7 @@ cat <<EOF
> >      which are not yet documented in the manual.  This list is
> >      automatically created and therefore might contain errors.  Please
> >      check the latest manual (available from the CVS archive) before
> > -    starting to work.  It might also be good to let me know in
> > -    advanace on which functions you intend to work to avoid
> > -    duplication.</p>
> > +    starting to work.</p>
> >
> >      <p>A few comments:</p>
> >
> > @@ -52,15 +62,23 @@ cat <<EOF
> >        <li>Similarly for the LFS functions (those ending in 64).</li>
> >      </ul>
> >
> > -    <p>The function sombody already volunteered to document are marked
> > -    with a reference to the person.</p>
> >
> >      <center><table>
> >  EOF
> >
> >  n=0
> > -diff -y --width=60 --suppress-common-lines DOCUMENTED AVAILABLE |
> > -expand | cut -b 33- | sed '/^[[:space:]]*$/d' |
> > +
> > +# get the list of undocumented functions
> > +grep -Fvx -f DOCUMENTED AVAILABLE_WITHOUT_OFFSET > UNDOCUMENTED_WITHOUT_OFFSET
> > +
> > +# get undocumented functions with offset info
> > +for func in `cat UNDOCUMENTED_WITHOUT_OFFSET`
> > +do
> > +  grep " $func$" AVAILABLE >> UNDOCUMENTED
> > +done
> > +
> > +diff -y --width=120 --suppress-common-lines DOCUMENTED UNDOCUMENTED |
> > +expand | cut -b 61- | sed '/^[[:space:]]*$/d' |
> >  while read name; do
> >    line="$line
> >  <td><tt>$name</tt></td>"
> > @@ -95,8 +113,10 @@ cat <<EOF
> >      </table></center>
> >
> >      <hr>
> > -    <address><a href="mailto:drepper@redhat.com">Ulrich Drepper</a></address>
> > -Generated on $(date) with documented.sh version $VERSION
> > +    Generated on $(date) with documented.sh version $VERSION
> >    </body>
> >  </html>
> >  EOF
> > +
> > +# cleanup the files
> > +rm -rf UNDOCUMENTED_WITHOUT_OFFSET AVAILABLE_WITHOUT_OFFSET AVAILABLE
> > --
> > 2.39.2
> >
>
  
Joe Talbott April 1, 2024, 4:33 p.m. UTC | #6
On Sat, Mar 30, 2024 at 2:54 PM Girish Joshi <girish946@gmail.com> wrote:
>
> Thanks Joe, I've updated the script.
> It's just that the output now does not contain the addresses and the
> T/W info about the symbol is not present.
> Do we need that info about each symbol in the output?

I guess that information is useful.  I'm attaching a patch that
reverts to 'cut -b 12' and does the grep and diff with a copy of
AVAILABLE that does not have the offsets and waits until it builds the
HTML table to get the matching line with the offset.

Thanks,
Joe
>
> Thanks!
> Girish Joshi
> girishjoshi.io
>
> On Sat, Mar 11, 2023 at 8:18 PM Joe Simmons-Talbott
> <joetalbott@gmail.com> wrote:
> >
> > On Sun, Mar 05, 2023 at 11:44:22AM +0530, Girish Joshi via Libc-alpha wrote:
> > > Hi Florian,
> > > Thanks for the review.
> > > Turns out `diff` was not working with the given input files, this
> > > patch fixes that.
> > > I'm not sure if there is a list of people who volunteered to document
> > > some specific functions.
> > > So that comment from the output html is removed.
> > >
> > > Thanks!
> > > Girish Joshi
> > >
> > > On Mon, Feb 27, 2023 at 11:26 PM Florian Weimer <fweimer@redhat.com> wrote:
> > > >
> > > > * Girish Joshi via Libc-alpha:
> > > >
> > > > > Hello,
> > > > > As per the Missing Functions section of master Todo list[1],
> > > > > scripts/documented.sh needs to be updated.
> > > > >
> > > > > Could someone please review this patch?
> > > > > It removes the reference to linuxthreads/*.taxi files from the script
> > > > > and removes the individual email address from the output.
> > > >
> > > > The script still doesn't seem to work, probably because the symbol names
> > > > are not extract properly:
> > > >
> > > > 43120 T _dl_mcount_wrapper      43140 T _dl_mcount_wrapper_c    43320 W clogf   43320 W clogf32
> > > > 435c0 T _dl_find_object         43740 T realpath        43770 T quick_exit      43790 T _IO_vfscanf
> > > > 437c0 T _pthread_cleanup_pus    437d0 T _pthread_cleanup_pop    437d0 W cprojf  437d0 W cprojf32
> > > >
> > > > _dl_find_object is documented.
> > > >
> > > > _IO_vfscanf should be recognized as an alias of vfscanf, but this is
> > > > more of an RFE than a bug fix.
> > > >
> > > > Thanks,
> > > > Florian
> > > >
> >
> > > From 5148c65ac07688dc5c3ee79a9b0f054232d64df3 Mon Sep 17 00:00:00 2001
> > > From: Girish Joshi <girish946@gmail.com>
> > > Date: Sun, 5 Mar 2023 11:15:00 +0530
> > > Subject: [PATCH] manual: scripts/documented.sh updated
> > >
> > > References for linuxthreads are removed from scripts/documented.sh.
> > > Also removed the individual email address from the html output.
> > >
> > > Fixed the steps to retrive undocumented functions
> > > ---
> > >  scripts/documented.sh | 44 +++++++++++++++++++++++++++++++------------
> > >  1 file changed, 32 insertions(+), 12 deletions(-)
> > >  mode change 100644 => 100755 scripts/documented.sh
> > >
> > > diff --git a/scripts/documented.sh b/scripts/documented.sh
> > > old mode 100644
> > > new mode 100755
> > > index 7d1ffd4a92..dda6a32283
> > > --- a/scripts/documented.sh
> > > +++ b/scripts/documented.sh
> > > @@ -1,9 +1,15 @@
> > >  #!/bin/sh
> > >  bindir=$1
> > >
> > > -VERSION=1.0
> > > +# usage: scripts/documented.sh <path to glibc build directory>
> > > +# for example:
> > > +# scripts/documented.sh $HOME/build/glibc
> > >
> > > -grep -E -h @deftypefu?nx? *.texi ../linuxthreads/*.texi |
> > > +VERSION=1.1
> > > +
> > > +# Collect the documented functions from manual/*.texi files.
> > > +
> > > +grep -E -h @deftypefu?nx? manual/*.texi |
> > >  sed -e 's/@deftypefunx*[[:space:]]*\({[^{]*}\|[[:alnum:]_]*\)[[:space:]]*\([[:alnum:]_]*\).*/\2/' -e 's/@deftypefn {[^}]*function}*[[:space:]]*\({[^{]*}\|[[:alnum:]_]*\)[[:space:]]*\([[:alnum:]_]*\).*/\2/' -e '/^@/d' |
> > >  sed -e '/^obstack_/d' -e '/^\([lf]\|\)stat\(\|64\)$/d' -e '/^mknod$/d' |
> > >  sed -e '/^signbit$/d' -e '/^sigsetjmp$/d' |
> > > @@ -12,9 +18,12 @@ sed -e '/^__fwriting$/d' -e '/^__fwritable$/d' -e '/^__fsetlocking$/d' |
> > >  sed -e '/^__freading$/d' -e '/^__freadable$/d' -e '/^__fpurge$/d' |
> > >  sed -e '/^__fpending$/d' -e '/^__flbf$/d' -e '/^__fbufsize$/d' |
> > >  sed -e '/^alloca$/d' |
> > > +sed -r '/^\s*$/d' |
> > >  sort -u > DOCUMENTED
> > >
> > > -nm --extern --define $bindir/libc.so $bindir/math/libm.so $bindir/rt/librt.so $bindir/linuxthreads/libpthread.so $bindir/dlfcn/libdl.so $bindir/crypt/libcrypt.so $bindir/login/libutil.so |
> > > +
> > > +# extract the exported symbols from the libraries.
> > > +nm --extern --define $bindir/libc.so $bindir/math/libm.so $bindir/rt/librt.so $bindir/nptl/libpthread.so $bindir/dlfcn/libdl.so $bindir/crypt/libcrypt.so $bindir/login/libutil.so |
> > >  grep -E " [TW] ([[:alpha:]]|_[[:alpha:]])" |
> > >  sed 's/\(@.*\)//' |
> > >  cut -b 12- |
> >
> > You can change this to 'cut -v 20-' and avoid the extra
> > AVAILABLE_WITHOUT_OFFSET part.
> >
> > Thanks,
> > Joe
> > > @@ -25,6 +34,9 @@ sed -e '/^_mcleanup$/d' -e '/^_rpc_dtablesize$/d' -e '/^_seterr_reply$/d' |
> > >  sed -e '/^_nss/d' -e '/^_setjmp$/d' |
> > >  sort -u > AVAILABLE
> > >
> > > +# remove offset details from nm output
> > > +cat AVAILABLE | cut -b 9-  | sort -u  > AVAILABLE_WITHOUT_OFFSET
> > > +
> > >  cat <<EOF
> > >  <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
> > >  <html>
> > > @@ -39,9 +51,7 @@ cat <<EOF
> > >      which are not yet documented in the manual.  This list is
> > >      automatically created and therefore might contain errors.  Please
> > >      check the latest manual (available from the CVS archive) before
> > > -    starting to work.  It might also be good to let me know in
> > > -    advanace on which functions you intend to work to avoid
> > > -    duplication.</p>
> > > +    starting to work.</p>
> > >
> > >      <p>A few comments:</p>
> > >
> > > @@ -52,15 +62,23 @@ cat <<EOF
> > >        <li>Similarly for the LFS functions (those ending in 64).</li>
> > >      </ul>
> > >
> > > -    <p>The function sombody already volunteered to document are marked
> > > -    with a reference to the person.</p>
> > >
> > >      <center><table>
> > >  EOF
> > >
> > >  n=0
> > > -diff -y --width=60 --suppress-common-lines DOCUMENTED AVAILABLE |
> > > -expand | cut -b 33- | sed '/^[[:space:]]*$/d' |
> > > +
> > > +# get the list of undocumented functions
> > > +grep -Fvx -f DOCUMENTED AVAILABLE_WITHOUT_OFFSET > UNDOCUMENTED_WITHOUT_OFFSET
> > > +
> > > +# get undocumented functions with offset info
> > > +for func in `cat UNDOCUMENTED_WITHOUT_OFFSET`
> > > +do
> > > +  grep " $func$" AVAILABLE >> UNDOCUMENTED
> > > +done
> > > +
> > > +diff -y --width=120 --suppress-common-lines DOCUMENTED UNDOCUMENTED |
> > > +expand | cut -b 61- | sed '/^[[:space:]]*$/d' |
> > >  while read name; do
> > >    line="$line
> > >  <td><tt>$name</tt></td>"
> > > @@ -95,8 +113,10 @@ cat <<EOF
> > >      </table></center>
> > >
> > >      <hr>
> > > -    <address><a href="mailto:drepper@redhat.com">Ulrich Drepper</a></address>
> > > -Generated on $(date) with documented.sh version $VERSION
> > > +    Generated on $(date) with documented.sh version $VERSION
> > >    </body>
> > >  </html>
> > >  EOF
> > > +
> > > +# cleanup the files
> > > +rm -rf UNDOCUMENTED_WITHOUT_OFFSET AVAILABLE_WITHOUT_OFFSET AVAILABLE
> > > --
> > > 2.39.2
> > >
> >
  
Girish Joshi April 2, 2024, 4:01 a.m. UTC | #7
On Mon, Apr 1, 2024 at 10:03 PM Joe Talbott <joetalbott@gmail.com> wrote:
>
> I guess that information is useful.  I'm attaching a patch that
> reverts to 'cut -b 12' and does the grep and diff with a copy of
> AVAILABLE that does not have the offsets and waits until it builds the
> HTML table to get the matching line with the offset.

Thanks Joe,
I Just realized that this patch is archived on the patchwork. So the
latest changes are not reflected there.

Girish Joshi
girishjoshi.io
  
Girish Joshi April 3, 2024, 3:44 p.m. UTC | #8
Hello,
Could someone please review this patch?

Thanks!
Girish Joshi
girishjoshi.io

On Tue, Apr 2, 2024 at 9:31 AM Girish Joshi <girish946@gmail.com> wrote:
>
> On Mon, Apr 1, 2024 at 10:03 PM Joe Talbott <joetalbott@gmail.com> wrote:
> >
> > I guess that information is useful.  I'm attaching a patch that
> > reverts to 'cut -b 12' and does the grep and diff with a copy of
> > AVAILABLE that does not have the offsets and waits until it builds the
> > HTML table to get the matching line with the offset.
>
> Thanks Joe,
> I Just realized that this patch is archived on the patchwork. So the
> latest changes are not reflected there.
>
> Girish Joshi
> girishjoshi.io
  
Adhemerval Zanella Netto April 3, 2024, 5:10 p.m. UTC | #9
On 03/04/24 12:44, Girish Joshi wrote:
> Hello,
> Could someone please review this patch?
> 
> Thanks!
> Girish Joshi
> girishjoshi.io
> 
> On Tue, Apr 2, 2024 at 9:31 AM Girish Joshi <girish946@gmail.com> wrote:
>>
>> On Mon, Apr 1, 2024 at 10:03 PM Joe Talbott <joetalbott@gmail.com> wrote:
>>>
>>> I guess that information is useful.  I'm attaching a patch that
>>> reverts to 'cut -b 12' and does the grep and diff with a copy of
>>> AVAILABLE that does not have the offsets and waits until it builds the
>>> HTML table to get the matching line with the offset.
>>
>> Thanks Joe,
>> I Just realized that this patch is archived on the patchwork. So the
>> latest changes are not reflected there.
>>
>> Girish Joshi
>> girishjoshi.io

I will take a look.
  
Girish Joshi April 4, 2024, 1:58 p.m. UTC | #10
On Wed, Apr 3, 2024 at 10:41 PM Adhemerval Zanella Netto
<adhemerval.zanella@linaro.org> wrote:
>
> I will take a look.
Thanks Adhemerval.

Girish Joshi
girishjoshi.io
  
Girish Joshi April 7, 2024, 8:13 a.m. UTC | #11
Hello Florian,
On Mon, Feb 27, 2023 at 11:26 PM Florian Weimer <fweimer@redhat.com> wrote:
> _IO_vfscanf should be recognized as an alias of vfscanf, but this is
> more of an RFE than a bug fix.

I was able to write a small python script that gets the list of
aliases in the given binaries and the html.
Not sure if this can be a separate script or should it be a part of
the same thing?
Please let me know if it can be a separate script, I'll post a patch for it.

Thanks!
Girish Joshi
girishjoshi.io

On Thu, Apr 4, 2024 at 7:28 PM Girish Joshi <girish946@gmail.com> wrote:
>
> On Wed, Apr 3, 2024 at 10:41 PM Adhemerval Zanella Netto
> <adhemerval.zanella@linaro.org> wrote:
> >
> > I will take a look.
> Thanks Adhemerval.
>
> Girish Joshi
> girishjoshi.io
  
Girish Joshi April 10, 2024, 6:35 p.m. UTC | #12
ping.

Girish Joshi
girishjoshi.io

On Wed, Apr 3, 2024 at 10:41 PM Adhemerval Zanella Netto
<adhemerval.zanella@linaro.org> wrote:
>
>
>
> On 03/04/24 12:44, Girish Joshi wrote:
> > Hello,
> > Could someone please review this patch?
> >
> > Thanks!
> > Girish Joshi
> > girishjoshi.io
> >
> > On Tue, Apr 2, 2024 at 9:31 AM Girish Joshi <girish946@gmail.com> wrote:
> >>
> >> On Mon, Apr 1, 2024 at 10:03 PM Joe Talbott <joetalbott@gmail.com> wrote:
> >>>
> >>> I guess that information is useful.  I'm attaching a patch that
> >>> reverts to 'cut -b 12' and does the grep and diff with a copy of
> >>> AVAILABLE that does not have the offsets and waits until it builds the
> >>> HTML table to get the matching line with the offset.
> >>
> >> Thanks Joe,
> >> I Just realized that this patch is archived on the patchwork. So the
> >> latest changes are not reflected there.
> >>
> >> Girish Joshi
> >> girishjoshi.io
>
> I will take a look.
  
Adhemerval Zanella Netto April 11, 2024, 5:18 p.m. UTC | #13
On 01/04/24 13:33, Joe Talbott wrote:
> On Sat, Mar 30, 2024 at 2:54 PM Girish Joshi <girish946@gmail.com> wrote:
>>
>> Thanks Joe, I've updated the script.
>> It's just that the output now does not contain the addresses and the
>> T/W info about the symbol is not present.
>> Do we need that info about each symbol in the output?
> 
> I guess that information is useful.  I'm attaching a patch that
> reverts to 'cut -b 12' and does the grep and diff with a copy of
> AVAILABLE that does not have the offsets and waits until it builds the
> HTML table to get the matching line with the offset.
> 
> Thanks,
> Joe
>>
>> Thanks!
>> Girish Joshi
>> girishjoshi.io
>>
>> On Sat, Mar 11, 2023 at 8:18 PM Joe Simmons-Talbott
>> <joetalbott@gmail.com> wrote:
>>>
>>> On Sun, Mar 05, 2023 at 11:44:22AM +0530, Girish Joshi via Libc-alpha wrote:
>>>> Hi Florian,
>>>> Thanks for the review.
>>>> Turns out `diff` was not working with the given input files, this
>>>> patch fixes that.
>>>> I'm not sure if there is a list of people who volunteered to document
>>>> some specific functions.
>>>> So that comment from the output html is removed.
>>>>
>>>> Thanks!
>>>> Girish Joshi
>>>>
>>>> On Mon, Feb 27, 2023 at 11:26 PM Florian Weimer <fweimer@redhat.com> wrote:
>>>>>
>>>>> * Girish Joshi via Libc-alpha:
>>>>>
>>>>>> Hello,
>>>>>> As per the Missing Functions section of master Todo list[1],
>>>>>> scripts/documented.sh needs to be updated.
>>>>>>
>>>>>> Could someone please review this patch?
>>>>>> It removes the reference to linuxthreads/*.taxi files from the script
>>>>>> and removes the individual email address from the output.
>>>>>
>>>>> The script still doesn't seem to work, probably because the symbol names
>>>>> are not extract properly:
>>>>>
>>>>> 43120 T _dl_mcount_wrapper      43140 T _dl_mcount_wrapper_c    43320 W clogf   43320 W clogf32
>>>>> 435c0 T _dl_find_object         43740 T realpath        43770 T quick_exit      43790 T _IO_vfscanf
>>>>> 437c0 T _pthread_cleanup_pus    437d0 T _pthread_cleanup_pop    437d0 W cprojf  437d0 W cprojf32
>>>>>
>>>>> _dl_find_object is documented.
>>>>>
>>>>> _IO_vfscanf should be recognized as an alias of vfscanf, but this is
>>>>> more of an RFE than a bug fix.
>>>>>
>>>>> Thanks,
>>>>> Florian
>>>>>
>>>
>>>> From 5148c65ac07688dc5c3ee79a9b0f054232d64df3 Mon Sep 17 00:00:00 2001
>>>> From: Girish Joshi <girish946@gmail.com>
>>>> Date: Sun, 5 Mar 2023 11:15:00 +0530
>>>> Subject: [PATCH] manual: scripts/documented.sh updated
>>>>
>>>> References for linuxthreads are removed from scripts/documented.sh.
>>>> Also removed the individual email address from the html output.
>>>>
>>>> Fixed the steps to retrive undocumented functions
>>>> ---
>>>>  scripts/documented.sh | 44 +++++++++++++++++++++++++++++++------------
>>>>  1 file changed, 32 insertions(+), 12 deletions(-)
>>>>  mode change 100644 => 100755 scripts/documented.sh
>>>>
>>>> diff --git a/scripts/documented.sh b/scripts/documented.sh
>>>> old mode 100644
>>>> new mode 100755
>>>> index 7d1ffd4a92..dda6a32283
>>>> --- a/scripts/documented.sh
>>>> +++ b/scripts/documented.sh
>>>> @@ -1,9 +1,15 @@
>>>>  #!/bin/sh
>>>>  bindir=$1
>>>>
>>>> -VERSION=1.0
>>>> +# usage: scripts/documented.sh <path to glibc build directory>
>>>> +# for example:
>>>> +# scripts/documented.sh $HOME/build/glibc
>>>>
>>>> -grep -E -h @deftypefu?nx? *.texi ../linuxthreads/*.texi |
>>>> +VERSION=1.1
>>>> +
>>>> +# Collect the documented functions from manual/*.texi files.
>>>> +
>>>> +grep -E -h @deftypefu?nx? manual/*.texi |
>>>>  sed -e 's/@deftypefunx*[[:space:]]*\({[^{]*}\|[[:alnum:]_]*\)[[:space:]]*\([[:alnum:]_]*\).*/\2/' -e 's/@deftypefn {[^}]*function}*[[:space:]]*\({[^{]*}\|[[:alnum:]_]*\)[[:space:]]*\([[:alnum:]_]*\).*/\2/' -e '/^@/d' |
>>>>  sed -e '/^obstack_/d' -e '/^\([lf]\|\)stat\(\|64\)$/d' -e '/^mknod$/d' |
>>>>  sed -e '/^signbit$/d' -e '/^sigsetjmp$/d' |
>>>> @@ -12,9 +18,12 @@ sed -e '/^__fwriting$/d' -e '/^__fwritable$/d' -e '/^__fsetlocking$/d' |
>>>>  sed -e '/^__freading$/d' -e '/^__freadable$/d' -e '/^__fpurge$/d' |
>>>>  sed -e '/^__fpending$/d' -e '/^__flbf$/d' -e '/^__fbufsize$/d' |
>>>>  sed -e '/^alloca$/d' |
>>>> +sed -r '/^\s*$/d' |
>>>>  sort -u > DOCUMENTED
>>>>
>>>> -nm --extern --define $bindir/libc.so $bindir/math/libm.so $bindir/rt/librt.so $bindir/linuxthreads/libpthread.so $bindir/dlfcn/libdl.so $bindir/crypt/libcrypt.so $bindir/login/libutil.so |
>>>> +
>>>> +# extract the exported symbols from the libraries.
>>>> +nm --extern --define $bindir/libc.so $bindir/math/libm.so $bindir/rt/librt.so $bindir/nptl/libpthread.so $bindir/dlfcn/libdl.so $bindir/crypt/libcrypt.so $bindir/login/libutil.so |
>>>>  grep -E " [TW] ([[:alpha:]]|_[[:alpha:]])" |
>>>>  sed 's/\(@.*\)//' |
>>>>  cut -b 12- |
>>>
>>> You can change this to 'cut -v 20-' and avoid the extra
>>> AVAILABLE_WITHOUT_OFFSET part.
>>>
>>> Thanks,
>>> Joe
>>>> @@ -25,6 +34,9 @@ sed -e '/^_mcleanup$/d' -e '/^_rpc_dtablesize$/d' -e '/^_seterr_reply$/d' |
>>>>  sed -e '/^_nss/d' -e '/^_setjmp$/d' |
>>>>  sort -u > AVAILABLE
>>>>
>>>> +# remove offset details from nm output
>>>> +cat AVAILABLE | cut -b 9-  | sort -u  > AVAILABLE_WITHOUT_OFFSET
>>>> +
>>>>  cat <<EOF
>>>>  <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
>>>>  <html>
>>>> @@ -39,9 +51,7 @@ cat <<EOF
>>>>      which are not yet documented in the manual.  This list is
>>>>      automatically created and therefore might contain errors.  Please
>>>>      check the latest manual (available from the CVS archive) before
>>>> -    starting to work.  It might also be good to let me know in
>>>> -    advanace on which functions you intend to work to avoid
>>>> -    duplication.</p>
>>>> +    starting to work.</p>
>>>>
>>>>      <p>A few comments:</p>
>>>>
>>>> @@ -52,15 +62,23 @@ cat <<EOF
>>>>        <li>Similarly for the LFS functions (those ending in 64).</li>
>>>>      </ul>
>>>>
>>>> -    <p>The function sombody already volunteered to document are marked
>>>> -    with a reference to the person.</p>
>>>>
>>>>      <center><table>
>>>>  EOF
>>>>
>>>>  n=0
>>>> -diff -y --width=60 --suppress-common-lines DOCUMENTED AVAILABLE |
>>>> -expand | cut -b 33- | sed '/^[[:space:]]*$/d' |
>>>> +
>>>> +# get the list of undocumented functions
>>>> +grep -Fvx -f DOCUMENTED AVAILABLE_WITHOUT_OFFSET > UNDOCUMENTED_WITHOUT_OFFSET
>>>> +
>>>> +# get undocumented functions with offset info
>>>> +for func in `cat UNDOCUMENTED_WITHOUT_OFFSET`
>>>> +do
>>>> +  grep " $func$" AVAILABLE >> UNDOCUMENTED
>>>> +done
>>>> +
>>>> +diff -y --width=120 --suppress-common-lines DOCUMENTED UNDOCUMENTED |
>>>> +expand | cut -b 61- | sed '/^[[:space:]]*$/d' |
>>>>  while read name; do
>>>>    line="$line
>>>>  <td><tt>$name</tt></td>"
>>>> @@ -95,8 +113,10 @@ cat <<EOF
>>>>      </table></center>
>>>>
>>>>      <hr>
>>>> -    <address><a href="mailto:drepper@redhat.com">Ulrich Drepper</a></address>
>>>> -Generated on $(date) with documented.sh version $VERSION
>>>> +    Generated on $(date) with documented.sh version $VERSION
>>>>    </body>
>>>>  </html>
>>>>  EOF
>>>> +
>>>> +# cleanup the files
>>>> +rm -rf UNDOCUMENTED_WITHOUT_OFFSET AVAILABLE_WITHOUT_OFFSET AVAILABLE
>>>> --
>>>> 2.39.2
>>>>
>>>

The issues from previous reviews seems not to be present and the output is
an improvement over the current status. LGTM, thanks.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>

PS: next time please send the patch as inline as well (it is easier to
    comment). Also for newer version send a new message with a vX.
  

Patch

From 8f589f12be85655d5bb5f69b07753ca7aa87bc16 Mon Sep 17 00:00:00 2001
From: Girish Joshi <girish946@gmail.com>
Date: Fri, 24 Feb 2023 19:50:38 +0530
Subject: [PATCH] manual: scripts/documented.sh updated

As mentioned in the master todo list,
References for linuxthreads are removed from scripts/documented.sh.
Also removed the individual email address from the html output.
---
 scripts/documented.sh | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/scripts/documented.sh b/scripts/documented.sh
index 7d1ffd4a92..7d9a044295 100644
--- a/scripts/documented.sh
+++ b/scripts/documented.sh
@@ -1,9 +1,17 @@ 
 #!/bin/sh
+
+# usage: scripts/documented.sh <path to glibc build directory>
+# for example:
+# scripts/documented.sh $HOME/build/glibc
+
+
 bindir=$1
 
 VERSION=1.0
 
-grep -E -h @deftypefu?nx? *.texi ../linuxthreads/*.texi |
+# Collect the documented functions from manual/*.texi files.
+
+grep -E -h @deftypefu?nx? manual/*.texi |
 sed -e 's/@deftypefunx*[[:space:]]*\({[^{]*}\|[[:alnum:]_]*\)[[:space:]]*\([[:alnum:]_]*\).*/\2/' -e 's/@deftypefn {[^}]*function}*[[:space:]]*\({[^{]*}\|[[:alnum:]_]*\)[[:space:]]*\([[:alnum:]_]*\).*/\2/' -e '/^@/d' |
 sed -e '/^obstack_/d' -e '/^\([lf]\|\)stat\(\|64\)$/d' -e '/^mknod$/d' |
 sed -e '/^signbit$/d' -e '/^sigsetjmp$/d' |
@@ -14,7 +22,9 @@  sed -e '/^__fpending$/d' -e '/^__flbf$/d' -e '/^__fbufsize$/d' |
 sed -e '/^alloca$/d' |
 sort -u > DOCUMENTED
 
-nm --extern --define $bindir/libc.so $bindir/math/libm.so $bindir/rt/librt.so $bindir/linuxthreads/libpthread.so $bindir/dlfcn/libdl.so $bindir/crypt/libcrypt.so $bindir/login/libutil.so |
+# Generate the HTML doc
+
+nm --extern --define $bindir/libc.so $bindir/math/libm.so $bindir/rt/librt.so $bindir/nptl/libpthread.so $bindir/dlfcn/libdl.so $bindir/crypt/libcrypt.so $bindir/login/libutil.so |
 grep -E " [TW] ([[:alpha:]]|_[[:alpha:]])" |
 sed 's/\(@.*\)//' |
 cut -b 12- |
@@ -95,7 +105,6 @@  cat <<EOF
     </table></center>
 
     <hr>
-    <address><a href="mailto:drepper@redhat.com">Ulrich Drepper</a></address>
 Generated on $(date) with documented.sh version $VERSION
   </body>
 </html>
-- 
2.39.1