]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit - scrub/xfs_scrub.c
xfs_scrub: implement deferred description string rendering
authorDarrick J. Wong <darrick.wong@oracle.com>
Wed, 6 Nov 2019 22:27:02 +0000 (17:27 -0500)
committerEric Sandeen <sandeen@sandeen.net>
Wed, 6 Nov 2019 22:27:02 +0000 (17:27 -0500)
commitb3f76f943479410f328eb599c45a18abdf25f9b4
treec58251d87264e15c751424603670634f558449f8
parent51c940530e315a65a76ac6936893b4449cfbd5c8
xfs_scrub: implement deferred description string rendering

A flamegraph analysis of xfs_scrub runtimes showed that we spend 7-10%
of the program's userspace runtime rendering prefix strings in case we
want to show a message about something we're checking, whether or not
that string ever actually gets used.

For a non-verbose run on a clean filesystem, this work is totally
unnecessary.  We could defer the message catalog lookup and snprintf
call until we actually need that message, so build enough of a function
closure mechanism so that we can capture some location information when
its convenient and push that all the way to the edge of the call graph
and only when we need it.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
[sandeen: make comment change suggested on list]
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
scrub/Makefile
scrub/descr.c [new file with mode: 0644]
scrub/descr.h [new file with mode: 0644]
scrub/scrub.c
scrub/xfs_scrub.c