Index: cddl/contrib/opensolaris/cmd/zfs/zfs.8 =================================================================== --- cddl/contrib/opensolaris/cmd/zfs/zfs.8 +++ cddl/contrib/opensolaris/cmd/zfs/zfs.8 @@ -184,7 +184,7 @@ .Ar bookmark .Nm .Cm send -.Op Fl DLPRcenpv +.Op Fl DLPRVcenpv .Op Fl i Ar snapshot | Fl I Ar snapshot .Ar snapshot .Nm @@ -194,7 +194,7 @@ .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot .Nm .Cm send -.Op Fl Penv +.Op Fl PVenv .Fl t Ar receive_resume_token .Nm .Cm receive Ns | Ns Cm recv @@ -2607,7 +2607,7 @@ .It Xo .Nm .Cm send -.Op Fl DLPRcenpv +.Op Fl DLPRVcenpv .Op Fl i Ar snapshot | Fl I Ar snapshot .Ar snapshot .Xc @@ -2753,6 +2753,8 @@ .It Fl v, -verbose Print verbose information about the stream package generated. This information includes a per-second report of how much data has been sent. +.It Fl V +Set the process title to a per-second report of how much data has been sent. .El .Pp The format of the stream is committed. You will be able to receive your streams Index: cddl/contrib/opensolaris/cmd/zfs/zfs_main.c =================================================================== --- cddl/contrib/opensolaris/cmd/zfs/zfs_main.c +++ cddl/contrib/opensolaris/cmd/zfs/zfs_main.c @@ -3813,7 +3813,7 @@ }; /* check options */ - while ((c = getopt_long(argc, argv, ":i:I:RbDpvnPLet:c", long_options, + while ((c = getopt_long(argc, argv, ":i:I:RbDpVvnPLet:c", long_options, NULL)) != -1) { switch (c) { case 'i': @@ -3837,6 +3837,10 @@ flags.parsable = B_TRUE; flags.verbose = B_TRUE; break; + case 'V': + flags.progress = B_TRUE; + flags.progressastitle = B_TRUE; + break; case 'v': if (flags.verbose) extraverbose = B_TRUE; Index: cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h =================================================================== --- cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h +++ cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h @@ -651,6 +651,9 @@ /* compressed WRITE records are permitted */ boolean_t compress; + + /* show progress as process title(ie. -V) */ + boolean_t progressastitle; } sendflags_t; typedef boolean_t (snapfilter_cb_t)(zfs_handle_t *, void *); Index: cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c =================================================================== --- cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c +++ cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c @@ -85,6 +85,8 @@ zfs_handle_t *pa_zhp; int pa_fd; boolean_t pa_parsable; + boolean_t pa_astitle; + uint64_t pa_size; } progress_arg_t; typedef struct dataref { @@ -930,6 +932,7 @@ uint64_t prevsnap_obj; boolean_t seenfrom, seento, replicate, doall, fromorigin; boolean_t verbose, dryrun, parsable, progress, embed_data, std_out; + boolean_t progressastitle; boolean_t large_block, compress; int outfd; boolean_t err; @@ -1110,14 +1113,14 @@ zfs_cmd_t zc = { 0 }; zfs_handle_t *zhp = pa->pa_zhp; libzfs_handle_t *hdl = zhp->zfs_hdl; - unsigned long long bytes; + unsigned long long bytes, total; char buf[16]; time_t t; struct tm *tm; (void) strlcpy(zc.zc_name, zhp->zfs_name, sizeof (zc.zc_name)); - if (!pa->pa_parsable) + if (!pa->pa_parsable && !pa->pa_astitle) (void) fprintf(stderr, "TIME SENT SNAPSHOT\n"); /* @@ -1134,7 +1137,16 @@ tm = localtime(&t); bytes = zc.zc_cookie; - if (pa->pa_parsable) { + if (pa->pa_astitle) { + int pct; + if (pa->pa_size > bytes) + pct = 100 * bytes / pa->pa_size; + else + pct = 100; + + setproctitle("sending %s (%d%%: %llu/%llu)", + zhp->zfs_name, pct, bytes, pa->pa_size); + } else if (pa->pa_parsable) { (void) fprintf(stderr, "%02d:%02d:%02d\t%llu\t%s\n", tm->tm_hour, tm->tm_min, tm->tm_sec, bytes, zhp->zfs_name); @@ -1298,6 +1310,8 @@ pa.pa_zhp = zhp; pa.pa_fd = sdd->outfd; pa.pa_parsable = sdd->parsable; + pa.pa_size = sdd->size; + pa.pa_astitle = sdd->progressastitle; if ((err = pthread_create(&tid, NULL, send_progress_thread, &pa)) != 0) { @@ -1669,6 +1683,7 @@ pa.pa_zhp = zhp; pa.pa_fd = outfd; pa.pa_parsable = flags->parsable; + pa.pa_astitle = flags->progressastitle; error = pthread_create(&tid, NULL, send_progress_thread, &pa); @@ -1878,6 +1893,7 @@ sdd.verbose = flags->verbose; sdd.parsable = flags->parsable; sdd.progress = flags->progress; + sdd.progressastitle = flags->progressastitle; sdd.dryrun = flags->dryrun; sdd.large_block = flags->largeblock; sdd.embed_data = flags->embed_data; @@ -1914,7 +1930,7 @@ sdd.cleanup_fd = -1; sdd.snapholds = NULL; } - if (flags->verbose || sdd.snapholds != NULL) { + if (flags->progress || sdd.snapholds != NULL) { /* * Do a verbose no-op dry run to get all the verbose output * or to gather snapshot hold's before generating any data,