Use setproctitle to report progress of zfs send

This allows parsing of zfs send progress by checking the process
title.
Doing so requires some changes to the send code in libzfs_sendrecv.c;
primarily these changes move some of the accounting around, to allow
for the code to be verbose as normal, or set the process title. Unlike
BSD, setproctitle() isn't standard in Linux; thus, borrowed it from
libbsd with slight modifications.

Authored-by: Sean Eric Fagan <sef@FreeBSD.org>
Co-authored-by: Ryan Moeller <ryan@iXsystems.com>
Co-authored-by: Ameer Hamza <ahamza@ixsystems.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Ameer Hamza <ahamza@ixsystems.com>
Closes #14376
This commit is contained in:
Ameer Hamza
2023-01-17 23:17:35 +05:00
committed by Tony Hutter
parent 164d184ed9
commit 777c98ee52
10 changed files with 438 additions and 55 deletions
+13 -11
View File
@@ -29,7 +29,7 @@
.\" Copyright 2018 Nexenta Systems, Inc.
.\" Copyright 2019 Joyent, Inc.
.\"
.Dd April 15, 2021
.Dd January 12, 2023
.Dt ZFS-SEND 8
.Os
.
@@ -39,28 +39,28 @@
.Sh SYNOPSIS
.Nm zfs
.Cm send
.Op Fl DLPRbcehnpsvw
.Op Fl DLPVRbcehnpsvw
.Op Oo Fl I Ns | Ns Fl i Oc Ar snapshot
.Ar snapshot
.Nm zfs
.Cm send
.Op Fl DLPcensvw
.Op Fl DLPVcensvw
.Op Fl i Ar snapshot Ns | Ns Ar bookmark
.Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot
.Nm zfs
.Cm send
.Fl -redact Ar redaction_bookmark
.Op Fl DLPcenpv
.Op Fl DLPVcenpv
.Op Fl i Ar snapshot Ns | Ns Ar bookmark
.Ar snapshot
.Nm zfs
.Cm send
.Op Fl Penv
.Op Fl PVenv
.Fl t
.Ar receive_resume_token
.Nm zfs
.Cm send
.Op Fl Pnv
.Op Fl PVnv
.Fl S Ar filesystem
.Nm zfs
.Cm redact
@@ -72,7 +72,7 @@
.It Xo
.Nm zfs
.Cm send
.Op Fl DLPRbcehnpvw
.Op Fl DLPVRbcehnpvw
.Op Oo Fl I Ns | Ns Fl i Oc Ar snapshot
.Ar snapshot
.Xc
@@ -140,6 +140,8 @@ If the
flag is used to send encrypted datasets, then
.Fl w
must also be specified.
.It Fl V , -proctitle
Set the process title to a per-second report of how much data has been sent.
.It Fl e , -embed
Generate a more compact stream by using
.Sy WRITE_EMBEDDED
@@ -285,7 +287,7 @@ You will be able to receive your streams on future versions of ZFS.
.It Xo
.Nm zfs
.Cm send
.Op Fl DLPcenvw
.Op Fl DLPVcenvw
.Op Fl i Ar snapshot Ns | Ns Ar bookmark
.Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot
.Xc
@@ -417,7 +419,7 @@ This information includes a per-second report of how much data has been sent.
.Nm zfs
.Cm send
.Fl -redact Ar redaction_bookmark
.Op Fl DLPcenpv
.Op Fl DLPVcenpv
.Op Fl i Ar snapshot Ns | Ns Ar bookmark
.Ar snapshot
.Xc
@@ -511,7 +513,7 @@ raw sends and redacted sends cannot be combined at this time.
.It Xo
.Nm zfs
.Cm send
.Op Fl Penv
.Op Fl PVenv
.Fl t
.Ar receive_resume_token
.Xc
@@ -526,7 +528,7 @@ for more details.
.It Xo
.Nm zfs
.Cm send
.Op Fl Pnv
.Op Fl PVnv
.Op Fl i Ar snapshot Ns | Ns Ar bookmark
.Fl S
.Ar filesystem