mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 18:40:43 +03:00
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:
@@ -693,6 +693,9 @@ typedef struct sendflags {
|
||||
/* show progress (ie. -v) */
|
||||
boolean_t progress;
|
||||
|
||||
/* show progress as process title (ie. -V) */
|
||||
boolean_t progressastitle;
|
||||
|
||||
/* large blocks (>128K) are permitted */
|
||||
boolean_t largeblock;
|
||||
|
||||
|
||||
@@ -167,6 +167,14 @@ void color_start(const char *color);
|
||||
void color_end(void);
|
||||
int printf_color(const char *color, char *format, ...);
|
||||
|
||||
#ifdef __linux__
|
||||
_LIBZUTIL_H void zfs_setproctitle_init(int argc, char *argv[], char *envp[]);
|
||||
_LIBZUTIL_H void zfs_setproctitle(const char *fmt, ...);
|
||||
#else
|
||||
#define zfs_setproctitle(fmt, ...) setproctitle(fmt, ##__VA_ARGS__)
|
||||
#define zfs_setproctitle_init(x, y, z) ((void)0)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* These functions are used by the ZFS libraries and cmd/zpool code, but are
|
||||
* not exported in the ABI.
|
||||
|
||||
Reference in New Issue
Block a user