All of lore.kernel.org
 help / color / mirror / Atom feed
From: Olaf Hering <olaf@aepfle.de>
To: xen-devel@lists.xenproject.org
Cc: Olaf Hering <olaf@aepfle.de>, Ian Jackson <iwj@xenproject.org>,
	Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>
Subject: [PATCH v20210111 07/39] xl: optionally print timestamps during xl migrate
Date: Mon, 11 Jan 2021 18:41:52 +0100	[thread overview]
Message-ID: <20210111174224.24714-8-olaf@aepfle.de> (raw)
In-Reply-To: <20210111174224.24714-1-olaf@aepfle.de>

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 <olaf@aepfle.de>
---
 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 df98adc9e4..494a84ee13 100644
--- a/docs/man/xl.1.pod.in
+++ b/docs/man/xl.1.pod.in
@@ -475,6 +475,10 @@ domain. See the corresponding option of the I<create> subcommand.
 Send the specified <config> file instead of the file used on creation of the
 domain.
 
+=item B<-T>
+
+Include timestamps in output.
+
 =item B<--debug>
 
 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 37710880d3..da0473ddfb 100644
--- a/tools/xl/xl_cmdtable.c
+++ b/tools/xl/xl_cmdtable.c
@@ -167,6 +167,7 @@ struct cmd_spec cmd_table[] = {
       "                migrate-receive [-d -e]\n"
       "-e              Do not wait in the background (on <host>) for the death\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 @@
 
 #ifndef LIBXL_HAVE_NO_SUSPEND_RESUME
 
+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 = LIBXL_SUSPEND_LIVE;
+    unsigned xtl_flags = XTL_STDIOSTREAM_HIDE_PROGRESS;
 
     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);
 
-    xtl_stdiostream_adjust_flags(logger, XTL_STDIOSTREAM_HIDE_PROGRESS, 0);
+    if (timestamps)
+        xtl_flags |= XTL_STDIOSTREAM_SHOW_DATE | XTL_STDIOSTREAM_SHOW_PID;
+    xtl_stdiostream_adjust_flags(logger, xtl_flags, 0);
 
     if (debug)
         flags |= 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 = 0;
+
+    if (timestamps)
+        xtl_flags |= XTL_STDIOSTREAM_SHOW_DATE | XTL_STDIOSTREAM_SHOW_PID;
+    xtl_stdiostream_adjust_flags(logger, xtl_flags, 0);
 
     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
     };
 
-    SWITCH_FOREACH_OPT(opt, "Fedrp", opts, "migrate-receive", 0) {
+    SWITCH_FOREACH_OPT(opt, "FedrpT", opts, "migrate-receive", 0) {
     case 'F':
         daemonize = 0;
         break;
@@ -517,6 +527,9 @@ int main_migrate_receive(int argc, char **argv)
     case 'p':
         pause_after_migration = 1;
         break;
+    case 'T':
+        timestamps = 1;
+        break;
     }
 
     if (argc-optind != 0) {
@@ -545,7 +558,7 @@ int main_migrate(int argc, char **argv)
         COMMON_LONG_OPTS
     };
 
-    SWITCH_FOREACH_OPT(opt, "FC:s:epD", opts, "migrate", 2) {
+    SWITCH_FOREACH_OPT(opt, "FC:s:eTpD", opts, "migrate", 2) {
     case 'C':
         config_filename = optarg;
         break;
@@ -559,6 +572,9 @@ int main_migrate(int argc, char **argv)
         daemonize = 0;
         monitor = 0;
         break;
+    case 'T':
+        timestamps = 1;
+        break;
     case 'p':
         pause_after_migration = 1;
         break;
@@ -592,11 +608,12 @@ int main_migrate(int argc, char **argv)
         } else {
             verbose_len = (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" : "");
     }


  parent reply	other threads:[~2021-01-11 17:43 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-11 17:41 [PATCH v20210111 00/39] leftover from 2020 Olaf Hering
2021-01-11 17:41 ` [PATCH v20210111 01/39] stubdom: fix tpm_version Olaf Hering
2021-01-11 18:06   ` Samuel Thibault
2021-01-11 17:41 ` [PATCH v20210111 02/39] xl: use proper name for bash_completion file Olaf Hering
2021-02-08 15:48   ` Ian Jackson
2021-01-11 17:41 ` [PATCH v20210111 03/39] docs: remove stale create example from xl.1 Olaf Hering
2021-02-08 15:41   ` Ian Jackson
2021-02-08 15:42   ` Ian Jackson
2021-01-11 17:41 ` [PATCH v20210111 04/39] docs: substitute XEN_CONFIG_DIR in xl.conf.5 Olaf Hering
2021-02-08 15:45   ` Ian Jackson
2021-01-11 17:41 ` [PATCH v20210111 05/39] tools: add with-xen-scriptdir configure option Olaf Hering
2021-02-08 16:03   ` Ian Jackson
2021-02-08 17:23     ` Olaf Hering
2021-02-08 17:48       ` Ian Jackson
2021-02-08 17:54         ` Olaf Hering
2021-02-08 17:55           ` Ian Jackson
2021-01-11 17:41 ` [PATCH v20210111 06/39] Use XEN_SCRIPT_DIR to refer to /etc/xen/scripts Olaf Hering
2021-02-08 16:04   ` Ian Jackson
2021-02-08 16:23     ` Ian Jackson
2021-01-11 17:41 ` Olaf Hering [this message]
2021-02-08 16:22   ` [PATCH v20210111 07/39] xl: optionally print timestamps during xl migrate Ian Jackson
2021-02-08 17:30     ` Olaf Hering
2021-02-08 17:47       ` Ian Jackson
2021-02-08 18:53     ` Olaf Hering
2021-01-11 17:41 ` [PATCH v20210111 08/39] xl: fix description of migrate --debug Olaf Hering
2021-02-08 16:25   ` Ian Jackson
2021-02-08 16:39     ` Andrew Cooper
2021-02-09 12:42       ` Olaf Hering
2021-01-11 17:41 ` [PATCH v20210111 09/39] tools: add readv_exact to libxenctrl Olaf Hering
2021-01-11 17:41 ` [PATCH v20210111 10/39] tools: add xc_is_known_page_type " Olaf Hering
2021-01-11 17:41 ` [PATCH v20210111 11/39] tools: use xc_is_known_page_type Olaf Hering
2021-01-11 17:41 ` [PATCH v20210111 12/39] tools: unify type checking for data pfns in migration stream Olaf Hering
2021-01-11 17:41 ` [PATCH v20210111 13/39] tools: show migration transfer rate in send_dirty_pages Olaf Hering
2021-01-11 17:41 ` [PATCH v20210111 14/39] tools/guest: prepare to allocate arrays once Olaf Hering
2021-01-11 17:42 ` [PATCH v20210111 15/39] tools/guest: save: move batch_pfns Olaf Hering
2021-02-08 17:46   ` Ian Jackson
2021-01-11 17:42 ` [PATCH v20210111 16/39] tools/guest: save: move mfns array Olaf Hering
2021-01-11 17:42 ` [PATCH v20210111 17/39] tools/guest: save: move types array Olaf Hering
2021-01-11 17:42 ` [PATCH v20210111 18/39] tools/guest: save: move errors array Olaf Hering
2021-01-11 17:42 ` [PATCH v20210111 19/39] tools/guest: save: move iov array Olaf Hering
2021-01-11 17:42 ` [PATCH v20210111 20/39] tools/guest: save: move rec_pfns array Olaf Hering
2021-01-11 17:42 ` [PATCH v20210111 21/39] tools/guest: save: move guest_data array Olaf Hering
2021-01-11 17:42 ` [PATCH v20210111 22/39] tools/guest: save: move local_pages array Olaf Hering
2021-01-11 17:42 ` [PATCH v20210111 23/39] tools/guest: restore: move pfns array Olaf Hering
2021-01-11 17:42 ` [PATCH v20210111 24/39] tools/guest: restore: move types array Olaf Hering
2021-01-11 17:42 ` [PATCH v20210111 25/39] tools/guest: restore: move mfns array Olaf Hering
2021-01-11 17:42 ` [PATCH v20210111 26/39] tools/guest: restore: move map_errs array Olaf Hering
2021-01-11 17:42 ` [PATCH v20210111 27/39] tools/guest: restore: move mfns array in populate_pfns Olaf Hering
2021-01-11 17:42 ` [PATCH v20210111 28/39] tools/guest: restore: move pfns " Olaf Hering
2021-01-11 17:42 ` [PATCH v20210111 29/39] tools/guest: restore: split record processing Olaf Hering
2021-01-11 17:42 ` [PATCH v20210111 30/39] tools/guest: restore: split handle_page_data Olaf Hering
2021-01-11 17:42 ` [PATCH v20210111 31/39] tools/guest: restore: write data directly into guest Olaf Hering
2021-01-11 17:42 ` [PATCH v20210111 32/39] tools: remove tabs from code produced by libxl_save_msgs_gen.pl Olaf Hering
2021-02-08 16:28   ` Ian Jackson
2021-01-11 17:42 ` [PATCH v20210111 33/39] tools: recognize LIBXL_API_VERSION for 4.15 Olaf Hering
2021-01-11 17:42 ` [PATCH v20210111 34/39] tools: adjust libxl_domain_suspend to receive a struct props Olaf Hering
2021-01-12  9:17   ` Christian Lindig
2021-01-11 17:42 ` [PATCH v20210111 35/39] tools: change struct precopy_stats to precopy_stats_t Olaf Hering
2021-01-11 17:42 ` [PATCH v20210111 36/39] tools: add callback to libxl for precopy_policy and precopy_stats_t Olaf Hering
2021-01-11 17:42 ` [PATCH v20210111 37/39] tools: add --max_iters to libxl_domain_suspend Olaf Hering
2021-01-11 17:42 ` [PATCH v20210111 38/39] tools: add --min_remaining " Olaf Hering
2021-01-11 17:42 ` [PATCH v20210111 39/39] tools: add --abort_if_busy " Olaf Hering

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210111174224.24714-8-olaf@aepfle.de \
    --to=olaf@aepfle.de \
    --cc=anthony.perard@citrix.com \
    --cc=iwj@xenproject.org \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.