Created attachment 194964 [details] Patch against CURRENT This adds a simple single-line per-second progress report to dd, mirroring similar functionality in GNU dd: -% ./dd status=progress if=/dev/zero of=/dev/null 4506408960 bytes transferred in 6 secs (750235686 bytes/sec) load: 0.72 cmd: dd 91308 [running] 6.90r 0.86u 5.95s 52% 1772k 10116733+0 records in 10116733+0 records out 5179767296 bytes transferred in 6.904121 secs (750242848 bytes/sec) 9006898688 bytes transferred in 12 secs (750133815 bytes/sec)^C 19004509+0 records in 19004508+0 records out 9730308096 bytes transferred in 12.972017 secs (750099839 bytes/sec) I hit ^T at 6.9 seconds, to demonstrate it behaves well with the SIGINFO handler. Included are patches against 11-STABLE, and an untested patch against CURRENT (doesn't build on my 11.1 machine due to missing capsicum header).
Created attachment 194965 [details] Patch against STABLE
This got 13 likes and 7 retweets on Twitter, that's enough for a review and commit, right? :P
A commit references this bug: Author: kevans Date: Wed Aug 8 21:37:03 UTC 2018 New revision: 337505 URL: https://svnweb.freebsd.org/changeset/base/337505 Log: dd: add status=progress support This reports the current status on a single line every second, mirroring similar functionality in GNU dd, and carefully interacts with SIGINFO. PR: 229615 Submitted by: Thomas Hurst <tom@hur.st> (modified for style(9) nits by me) MFC after: 1 week Changes: head/bin/dd/args.c head/bin/dd/dd.1 head/bin/dd/dd.c head/bin/dd/dd.h head/bin/dd/extern.h head/bin/dd/misc.c
Committed, thanks!
A commit references this bug: Author: kevans Date: Wed Aug 29 02:18:15 UTC 2018 New revision: 338364 URL: https://svnweb.freebsd.org/changeset/base/338364 Log: MFC r337505, r337865, r337869: dd status=progress r337505: dd: add status=progress support This reports the current status on a single line every second, mirroring similar functionality in GNU dd, and carefully interacts with SIGINFO. PR: 229615 r337865: dd: Incorporate some changes from imp for status=progress Notable changes from what landed in r337505: - sigalarm handler isn't setup unless we're actually using it - Humanized versions of the amount of data transferred in the progress update r337869: dd(1): Kill off duplicate progress definition following r337865 Changes: _U stable/11/ stable/11/bin/dd/Makefile stable/11/bin/dd/args.c stable/11/bin/dd/dd.1 stable/11/bin/dd/dd.c stable/11/bin/dd/dd.h stable/11/bin/dd/extern.h stable/11/bin/dd/misc.c stable/11/bin/dd/position.c