On 10/03/2016 04:30 PM, Steve wrote:
> I'm not sure what was at fault here but I had excessive CPU use with 
> findutils after switching from EXT4 to BTRFS in Void Linux.
> https://github.com/voidlinux/void-packages/issues/4829
> Is this because find isn't optimised for BTRFS, there's a problem with the 
> BTRFS kernel driver, or something else? I built the latest version of 
> findutils from the stable source package and had the same result. 

I don't see how/why find(1) should do something special for BTRFS;
it's just using standard kernel functions to traverse the file system.

> I resolved my personal requirements by switching to using mlocate and ag 
> instead, but also saw some other small errors
in the source package. Perhaps these other observations might be helpful for 
you?
> 
>  File: README-alpha : Says it's an alpha release when it's the latest stable 
> one.

Fixed with:

  [PATCH 1/3] maint: merge README-alpha into README

>  The entire ChangeLog-2013 content is duplicated in ChangeLog

Fixed with

  [PATCH 2/3] maint: remove ChangeLog-2013 from distribution tarball

>  Typo:  README-hacking: "Dejagnu is in fact optional, but it's strongly 
> recommened,"

Already fixed in:

  http://git.sv.gnu.org/cgit/findutils.git/commit/?id=9333e22e91b6

> Compiles in a standard build, but won't build debug version:
> findutils-4.6.0$ ./configure --enable-debug
> $ make
> 
> ftsfind.c: In function 'main':
> ftsfind.c:705:49: warning: passing argument 1 of 'ctime' from incompatible 
> pointer type
>    fprintf (stderr, "cur_day_start = %s", ctime (&options.cur_day_start));
>                                                  ^
> In file included from ../gl/lib/time.h:41:0,
>                  from ../gl/lib/sys/stat.h:44,
>                  from ftsfind.c:39:
> /usr/include/time.h:264:14: note: expected 'const time_t *' but argument is 
> of type 'struct timespec *'
>  extern char *ctime (const time_t *__timer) __THROW;
>               ^
> 
> Fixed that error:
> 
>  find/ftsfind.c
> 
> #ifdef DEBUG
>   fprintf (stderr, "cur_day_start = %s", ctime (&options.cur_day_start));
> #endif /* DEBUG */
> 
> Changed to:
>   fprintf (stderr, "cur_day_start = %s", ctime ((time_t 
> *)&options.cur_day_start.tv_sec));

Already fixed in

  http://git.sv.gnu.org/cgit/findutils.git/commit/?id=bcbfcb86be6b

... but there was a similar one in oldfind.c - fixed with:

  [PATCH 3/3] oldfind: fix compiler warnings

> But it seems to have an outdated binary which is only called in a debug build:
> mv -f .deps/ftsfind.Tpo .deps/ftsfind.Po
> gcc -std=gnu99  -g -O2   -o find ftsfind.o ./libfindtools.a ../lib/libfind.a 
> ../gl/lib/libgnulib.a       -lm -lm
> ../gl/lib/libgnulib.a(parse-datetime.o): In function `parse_datetime':
> /home/james/source/GNU/findutils/git/gnu/findutils/gl/lib/parse-datetime.y:1452:
>  undefined reference to `rpl_mktime'
> /home/james/source/GNU/findutils/git/gnu/findutils/gl/lib/parse-datetime.y:1484:
>  undefined reference to `rpl_mktime'
> /home/james/source/GNU/findutils/git/gnu/findutils/gl/lib/parse-datetime.y:1497:
>  undefined reference to `rpl_mktime'
> /home/james/source/GNU/findutils/git/gnu/findutils/gl/lib/parse-datetime.y:1519:
>  undefined reference to `rpl_mktime'
> collect2: error: ld returned 1 exit status
> make[3]: *** [Makefile:1810: find] Error 1
> make[3]: Leaving directory 
> '/home/steve/projects/gnu-findutils/2dbg/findutils-4.6.0/find'
> make[2]: *** [Makefile:1898: all-recursive] Error 1
> make[2]: Leaving directory 
> '/home/steve/projects/gnu-findutils/2dbg/findutils-4.6.0/find'
> make[1]: *** [Makefile:1706: all-recursive] Error 1
> make[1]: Leaving directory 
> '/home/steve/projects/gnu-findutils/2dbg/findutils-4.6.0'
> make: *** [Makefile:1646: all] Error 2
> 
> The source is different:
> gl/lib/parse-datetime.y
> 1452      Start = mktime (&tm);
> 1484              Start = mktime (&tm);
> 1497          Start = mktime (&tm);
> 1519          Start = mktime (&tm);
> 
> make only updates what it needs to, probably the stable package didn't get 
> built from a clean source. (Sometimes make clean misses stuff too.)
> Building from git repo would probably fix this, I didn't try that.

oops, I see this too.
However, the --enable-debug option has meanwhile been retired:

  http://git.sv.gnu.org/cgit/findutils.git/commit/?id=995151807658

Thanks & have a nice day,
Berny
>From ccff457af1c993bf80141f26fe6a764657b6223d Mon Sep 17 00:00:00 2001
From: Bernhard Voelker <m...@bernhard-voelker.de>
Date: Tue, 1 Nov 2016 16:23:31 +0100
Subject: [PATCH 1/3] maint: merge README-alpha into README

As of findutils-4.6, this package is stable.

* README-alpha: Remove file, moving the useful content of it to ...
* README: ... here.
* doc/find-maint.texi: Remove README-alpha here, too.

Reported by Steve in
http://lists.gnu.org/archive/html/bug-findutils/2016-10/msg00000.html
---
 README              | 23 +++++++++++++++++++++++
 README-alpha        | 25 -------------------------
 doc/find-maint.texi |  2 --
 3 files changed, 23 insertions(+), 27 deletions(-)
 delete mode 100644 README-alpha

diff --git a/README b/README
index 4671dcc..bfe2d69 100644
--- a/README
+++ b/README
@@ -62,5 +62,28 @@ searching has been moved to a separate program, `locate'; the same
 thing has been done in 4.4BSD.  If you use locate, you should run the
 included `updatedb' script from cron periodically (typically nightly).
 
+The latest full release is available at
+ftp://ftp.gnu.org/gnu/findutils.
+
+The latest test release (if any) is available at
+ftp://alpha.gnu.org/gnu/findutils
+
+Discussion of the findutils package and ways to improve it takes place
+on the "bug-findutils" mailing list, which you can join by sending
+mail to bug-findutils-requ...@gnu.org.  An archive of patches to the
+bug-findutils mailing list is available at
+http://lists.gnu.org/archive/html/bug-findutils/.
+
+Bug reports, suggested patches and enhancement requests for findutils
+should be logged at http://savannah.gnu.org/bugs/?group=findutils.
+
+Changes to the findutils code are sent to the findutils-patches
+mailing list.  To join, please send email to
+findutils-patc...@gnu.org.  You are also welcome to send patches to
+that list, but unless you are a list subscriber, you won't be able to
+follow any resulting discussion.  An archive of posts to the
+findutils-patches mailing list is available at
+http://lists.gnu.org/archive/html/findutils-patches/.
+
 Mail suggestions and bug reports for these programs to
 bug-findutils@gnu.org.
diff --git a/README-alpha b/README-alpha
deleted file mode 100644
index 8717c2b..0000000
--- a/README-alpha
+++ /dev/null
@@ -1,25 +0,0 @@
-This is a test release of GNU findutils.
-
-The latest test release (if any) is available at
-ftp://alpha.gnu.org/gnu/findutils
-
-The latest full release is available at
-ftp://ftp.gnu.org/gnu/findutils.
-
-
-Discussion of the findutils package and ways to improve it takes place
-on the "bug-findutils" mailing list, which you can join by sending
-mail to bug-findutils-requ...@gnu.org.  An archive of patches to the
-bug-findutils mailing list is available at
-http://lists.gnu.org/archive/html/bug-findutils/.
-
-Bug reports, suggested patches and enhancement requests for findutils
-should be logged at http://savannah.gnu.org/bugs/?group=findutils.
-
-Changes to the findutils code are sent to the findutils-patches
-mailing list.  To join, please send email to
-findutils-patc...@gnu.org.  You are also welcome to send patches to
-that list, but unless you are a list subscriber, you won't be able to
-follow any resulting discussion.  An archive of posts to the
-findutils-patches mailing list is available at
-http://lists.gnu.org/archive/html/findutils-patches/.
diff --git a/doc/find-maint.texi b/doc/find-maint.texi
index 3e3a11c..7a174ac 100644
--- a/doc/find-maint.texi
+++ b/doc/find-maint.texi
@@ -610,8 +610,6 @@ version 3.
 Generic installation instructions for installing GNU programs.
 @item README
 Information about how to compile findutils in particular
-@item README-alpha
-A README file which is included with testing releases of findutils.
 @item README-hacking
 Describes how to build findutils from the code in git.
 @item THANKS
-- 
2.1.4

>From 41e8096077bf1b7f9e98084426b20fd063b82812 Mon Sep 17 00:00:00 2001
From: Bernhard Voelker <m...@bernhard-voelker.de>
Date: Tue, 1 Nov 2016 16:34:31 +0100
Subject: [PATCH 2/3] maint: remove ChangeLog-2013 from distribution tarball

* Makefile.am (EXTRA_DIST): Remove ChangeLog-2013, as its content is
shipped in the generated ChangeLog file.

Reported by Steve in
http://lists.gnu.org/archive/html/bug-findutils/2016-10/msg00000.html
---
 Makefile.am | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile.am b/Makefile.am
index 410ee3d..c31e7f0 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -2,7 +2,7 @@ AUTOMAKE_OPTIONS=gnits
 # readme-alpha
 AM_CFLAGS = $(WARN_CFLAGS)
 
-EXTRA_DIST = COPYING ChangeLog ChangeLog-2013 TODO config.h.in stamp-h.in \
+EXTRA_DIST = COPYING ChangeLog TODO config.h.in stamp-h.in \
 		THANKS bootstrap \
 		tool-versions.txt README-hacking
 DISTCLEANFILES = tool-versions.txt
-- 
2.1.4

>From 60fd004576fced709ac351100f96afe10098aa73 Mon Sep 17 00:00:00 2001
From: Bernhard Voelker <m...@bernhard-voelker.de>
Date: Tue, 1 Nov 2016 17:29:44 +0100
Subject: [PATCH 3/3] oldfind: fix compiler warnings
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Avoid the following 2 warnings:

oldfind.c: In function ‘main’:
oldfind.c:228:5: warning: passing argument 1 of ‘ctime’ from incompatible pointer type [enabled by default]
     fprintf (stderr, "cur_day_start = %s", ctime (&options.cur_day_start/*.tv_sec*/));
     ^
In file included from ../gl/lib/time.h:41:0,
                 from ../gl/lib/sys/stat.h:44,
                 from oldfind.c:35:
/usr/include/time.h:264:14: note: expected ‘const time_t *’ but argument is of type ‘struct timespec *’
oldfind.c: In function ‘at_top’:
oldfind.c:1003:12: warning: assignment discards ‘const’ qualifier from pointer target type [enabled by default]
       base = pathname;
            ^

* find/oldfind.c (main): Correct the call to ctime; it takes time_t*,
so don't pass struct timeval*; instead, pass the address of the tv_sec
member.
(at_top): Declare base as const char*.
---
 find/oldfind.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/find/oldfind.c b/find/oldfind.c
index d2641aa..49e1796 100644
--- a/find/oldfind.c
+++ b/find/oldfind.c
@@ -225,7 +225,7 @@ main (int argc, char **argv)
     options.xstat = debug_stat;
 
   if (options.debug_options & DebugTime)
-    fprintf (stderr, "cur_day_start = %s", ctime (&options.cur_day_start));
+    fprintf (stderr, "cur_day_start = %s", ctime (&options.cur_day_start.tv_sec));
 
   /* state.cwd_dir_fd has to be initialized before we call build_expression_tree ()
    * because command-line parsing may lead us to stat some files.
@@ -991,7 +991,7 @@ at_top (const char *pathname,
 {
   int dirchange;
   char *parent_dir = dir_name (pathname);
-  char *base = last_component (pathname);
+  const char *base = last_component (pathname);
 
   state.curdepth = 0;
   state.starting_path_length = strlen (pathname);
-- 
2.1.4

Reply via email to