From nobody Tue May 7 05:24:19 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1603190675; cv=none; d=zohomail.com; s=zohoarc; b=CS+LB8HTaJgEvXJz2SVZxsfgMwSBNRIOhQ+ORv1FAVB7a1bPqVzP3tlO/a5yU6UM1k0rPXIt4W0OMaR/kJQsS553XcaAtE3hzGR7x7Bd6A32ZKUtWLz/jkimOiv9mG6y4zbnkuYGiISPgHDu253TIZij02KPbQMOM16foFhchk8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1603190675; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=BeKfgTRL0Ve2EEdsp0Vygx0an64RH8IwvMCvdkEBUoY=; b=OE9anF9wirPbeCfoGvSvXvTr/pjEkyaqKULC4VY3MA060blW9Dv8YDphQJ7rVhGS4DdHVPT2zht1eW1BO2scquRVWFgNSpGAghkStWHbcWHwAbaDFGStsNfKnwyKZjuyfgzf0kYzJ5XQVjmp88RWoiyDgQ2y3lk/TUy3D0IMAG8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1603190675192744.2025737540582; Tue, 20 Oct 2020 03:44:35 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.9082.24416 (Exim 4.92) (envelope-from ) id 1kUp7h-0007Wm-Hm; Tue, 20 Oct 2020 10:44:09 +0000 Received: by outflank-mailman (output) from mailman id 9082.24416; Tue, 20 Oct 2020 10:44:09 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kUp7h-0007Wf-EP; Tue, 20 Oct 2020 10:44:09 +0000 Received: by outflank-mailman (input) for mailman id 9082; Tue, 20 Oct 2020 10:44:08 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kUp7g-0007Vw-CT for xen-devel@lists.xenproject.org; Tue, 20 Oct 2020 10:44:08 +0000 Received: from mo4-p00-ob.smtp.rzone.de (unknown [81.169.146.219]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id e1eabbd5-69bf-4743-bda4-65d4484bed17; Tue, 20 Oct 2020 10:44:06 +0000 (UTC) Received: from sender by smtp.strato.de (RZmta 47.2.1 DYNA|AUTH) with ESMTPSA id e003b5w9KAhuBan (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256 bits)) (Client did not present a certificate); Tue, 20 Oct 2020 12:43:56 +0200 (CEST) Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kUp7g-0007Vw-CT for xen-devel@lists.xenproject.org; Tue, 20 Oct 2020 10:44:08 +0000 Received: from mo4-p00-ob.smtp.rzone.de (unknown [81.169.146.219]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id e1eabbd5-69bf-4743-bda4-65d4484bed17; Tue, 20 Oct 2020 10:44:06 +0000 (UTC) Received: from sender by smtp.strato.de (RZmta 47.2.1 DYNA|AUTH) with ESMTPSA id e003b5w9KAhuBan (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256 bits)) (Client did not present a certificate); Tue, 20 Oct 2020 12:43:56 +0200 (CEST) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: e1eabbd5-69bf-4743-bda4-65d4484bed17 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1603190645; s=strato-dkim-0002; d=aepfle.de; h=Message-Id:Date:Subject:Cc:To:From:X-RZG-CLASS-ID:X-RZG-AUTH:From: Subject:Sender; bh=BeKfgTRL0Ve2EEdsp0Vygx0an64RH8IwvMCvdkEBUoY=; b=kmJfs6ro+FNdeSpJoN+Nn4osjKExM+WW54RKpRn8Al3mBfaZupSGlfsMS0ds9gPFng OF7kIVE2tRosj/knsnnFpa+LIjRNPZ76SeACypioaIec1oRZRxJzaE3lwY+CUk5JJrG8 CskaUYwY7xe84ajK0KUHgTkihX1mIU9TxOI0U+3S+0og0I96IRrw5pATcocHLmj7fcLQ uMKFgerb6Qx6484VxxkCfZRyGvkKUKkRp++ZKgkIpaSonwgBseZGwmlDROGjswzBFCxc u+UKJhmdS06adYwAcJa1mEWrMoHUL33FHCA1BmuJ2K1zZ0ts8IfKH6KYFm1UtVBalRJD R0IA== X-RZG-AUTH: ":P2EQZWCpfu+qG7CngxMFH1J+3q8wa/QXkBR9MXjAuzBW/OdlBZQ4AHSS3G1Jjw==" X-RZG-CLASS-ID: mo00 From: Olaf Hering To: xen-devel@lists.xenproject.org Cc: Olaf Hering , Ian Jackson , Wei Liu , Anthony PERARD Subject: [PATCH v1] xl: optionally print timestamps during xl migrate Date: Tue, 20 Oct 2020 12:43:53 +0200 Message-Id: <20201020104353.13425-1-olaf@aepfle.de> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" During 'xl -v.. migrate domU host' a large amount of debug is generated. It is difficult to map each line to the sending and receiving side. Also the time spent for migration is not reported. With 'xl migrate -T domU host' both sides will print timestamps and also the pid of the invoked xl process to make it more obvious which side produced a given log line. Signed-off-by: Olaf Hering --- docs/man/xl.1.pod.in | 4 ++++ tools/xl/xl_cmdtable.c | 1 + tools/xl/xl_migrate.c | 25 +++++++++++++++++++++---- 3 files changed, 26 insertions(+), 4 deletions(-) diff --git a/docs/man/xl.1.pod.in b/docs/man/xl.1.pod.in index 5f7d3a7134..4bde0672fa 100644 --- a/docs/man/xl.1.pod.in +++ b/docs/man/xl.1.pod.in @@ -482,6 +482,10 @@ domain. See the corresponding option of the I = subcommand. Send the specified file instead of the file used on creation of t= he domain. =20 +=3Ditem B<-T> + +Include timestamps in output. + =3Ditem B<--debug> =20 Display huge (!) amount of debug information during the migration process. diff --git a/tools/xl/xl_cmdtable.c b/tools/xl/xl_cmdtable.c index 7da6c1b927..fd2dc0aef2 100644 --- a/tools/xl/xl_cmdtable.c +++ b/tools/xl/xl_cmdtable.c @@ -167,6 +167,7 @@ struct cmd_spec cmd_table[] =3D { " migrate-receive [-d -e]\n" "-e Do not wait in the background (on ) for the d= eath\n" " of the domain.\n" + "-T Show timestamps during the migration process.\n" "--debug Print huge (!) amount of debug during the migration= process.\n" "-p Do not unpause domain after migrating it.\n" "-D Preserve the domain id" diff --git a/tools/xl/xl_migrate.c b/tools/xl/xl_migrate.c index 0813beb801..856a6e2be1 100644 --- a/tools/xl/xl_migrate.c +++ b/tools/xl/xl_migrate.c @@ -32,6 +32,8 @@ =20 #ifndef LIBXL_HAVE_NO_SUSPEND_RESUME =20 +static bool timestamps; + static pid_t create_migration_child(const char *rune, int *send_fd, int *recv_fd) { @@ -187,6 +189,7 @@ static void migrate_domain(uint32_t domid, int preserve= _domid, char rc_buf; uint8_t *config_data; int config_len, flags =3D LIBXL_SUSPEND_LIVE; + unsigned xtl_flags =3D XTL_STDIOSTREAM_HIDE_PROGRESS; =20 save_domain_core_begin(domid, preserve_domid, override_config_file, &config_data, &config_len); @@ -202,7 +205,9 @@ static void migrate_domain(uint32_t domid, int preserve= _domid, migrate_do_preamble(send_fd, recv_fd, child, config_data, config_len, rune); =20 - xtl_stdiostream_adjust_flags(logger, XTL_STDIOSTREAM_HIDE_PROGRESS, 0); + if (timestamps) + xtl_flags |=3D XTL_STDIOSTREAM_SHOW_DATE | XTL_STDIOSTREAM_SHOW_PI= D; + xtl_stdiostream_adjust_flags(logger, xtl_flags, 0); =20 if (debug) flags |=3D LIBXL_SUSPEND_DEBUG; @@ -328,6 +333,11 @@ static void migrate_receive(int debug, int daemonize, = int monitor, char rc_buf; char *migration_domname; struct domain_create dom_info; + unsigned xtl_flags =3D 0; + + if (timestamps) + xtl_flags |=3D XTL_STDIOSTREAM_SHOW_DATE | XTL_STDIOSTREAM_SHOW_PI= D; + xtl_stdiostream_adjust_flags(logger, xtl_flags, 0); =20 signal(SIGPIPE, SIG_IGN); /* if we get SIGPIPE we'd rather just have it as an error */ @@ -491,7 +501,7 @@ int main_migrate_receive(int argc, char **argv) COMMON_LONG_OPTS }; =20 - SWITCH_FOREACH_OPT(opt, "Fedrp", opts, "migrate-receive", 0) { + SWITCH_FOREACH_OPT(opt, "FedrpT", opts, "migrate-receive", 0) { case 'F': daemonize =3D 0; break; @@ -517,6 +527,9 @@ int main_migrate_receive(int argc, char **argv) case 'p': pause_after_migration =3D 1; break; + case 'T': + timestamps =3D 1; + break; } =20 if (argc-optind !=3D 0) { @@ -545,7 +558,7 @@ int main_migrate(int argc, char **argv) COMMON_LONG_OPTS }; =20 - SWITCH_FOREACH_OPT(opt, "FC:s:epD", opts, "migrate", 2) { + SWITCH_FOREACH_OPT(opt, "FC:s:eTpD", opts, "migrate", 2) { case 'C': config_filename =3D optarg; break; @@ -559,6 +572,9 @@ int main_migrate(int argc, char **argv) daemonize =3D 0; monitor =3D 0; break; + case 'T': + timestamps =3D 1; + break; case 'p': pause_after_migration =3D 1; break; @@ -592,11 +608,12 @@ int main_migrate(int argc, char **argv) } else { verbose_len =3D (minmsglevel_default - minmsglevel) + 2; } - xasprintf(&rune, "exec %s %s xl%s%.*s migrate-receive%s%s%s", + xasprintf(&rune, "exec %s %s xl%s%.*s migrate-receive%s%s%s%s", ssh_command, host, pass_tty_arg ? " -t" : "", verbose_len, verbose_buf, daemonize ? "" : " -e", + timestamps ? " -T" : "", debug ? " -d" : "", pause_after_migration ? " -p" : ""); }