All of lore.kernel.org
 help / color / mirror / Atom feed
From: james-xen@dingwall.me.uk
To: xen-devel@lists.xenproject.org
Cc: wei.liu2@citrix.com, ian.jackson@eu.citrix.com,
	James Dingwall <james@dingwall.me.uk>
Subject: [Xen-devel] [PATCH 1/4] xenstored logging: introduce -Y / --trace-syslog option
Date: Wed,  4 Dec 2019 09:27:36 +0000	[thread overview]
Message-ID: <20191204092739.18177-2-james-xen@dingwall.me.uk> (raw)
In-Reply-To: <20191204092739.18177-1-james-xen@dingwall.me.uk>

From: James Dingwall <james@dingwall.me.uk>

Add a new command line argument -Y / --trace-syslog which toggles the
boolean tracesyslog variable.
---
 tools/xenstore/xenstored_core.c | 10 ++++++++--
 tools/xenstore/xenstored_core.h |  1 +
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c
index c8e423700d..d0b383becc 100644
--- a/tools/xenstore/xenstored_core.c
+++ b/tools/xenstore/xenstored_core.c
@@ -79,6 +79,7 @@ static bool recovery = true;
 static int reopen_log_pipe[2];
 static int reopen_log_pipe0_pollfd_idx = -1;
 char *tracefile = NULL;
+bool tracesyslog = false;
 TDB_CONTEXT *tdb_ctx = NULL;
 
 static const char *sockmsg_string(enum xsd_sockmsg_type type);
@@ -1871,7 +1872,8 @@ static void usage(void)
 "  -H, --help              to output this message,\n"
 "  -N, --no-fork           to request that the daemon does not fork,\n"
 "  -P, --output-pid        to request that the pid of the daemon is output,\n"
-"  -T, --trace-file <file> giving the file for logging, and\n"
+"  -T, --trace-file <file> giving the file for logging, and/or\n"
+"  -Y, --trace-syslog writing trace message to syslog,\n"
 "  -E, --entry-nb <nb>     limit the number of entries per domain,\n"
 "  -S, --entry-size <size> limit the size of entry per domain, and\n"
 "  -W, --watch-nb <nb>     limit the number of watches per domain,\n"
@@ -1895,6 +1897,7 @@ static struct option options[] = {
 	{ "output-pid", 0, NULL, 'P' },
 	{ "entry-size", 1, NULL, 'S' },
 	{ "trace-file", 1, NULL, 'T' },
+	{ "trace-syslog", 0, NULL, 'Y' },
 	{ "transaction", 1, NULL, 't' },
 	{ "no-recovery", 0, NULL, 'R' },
 	{ "internal-db", 0, NULL, 'I' },
@@ -1918,7 +1921,7 @@ int main(int argc, char *argv[])
 	int timeout;
 
 
-	while ((opt = getopt_long(argc, argv, "DE:F:HNPS:t:T:RVW:", options,
+	while ((opt = getopt_long(argc, argv, "DE:F:HNPS:t:T:RVW:Y", options,
 				  NULL)) != -1) {
 		switch (opt) {
 		case 'D':
@@ -1960,6 +1963,9 @@ int main(int argc, char *argv[])
 		case 'W':
 			quota_nb_watch_per_domain = strtol(optarg, NULL, 10);
 			break;
+		case 'Y':
+			tracesyslog = true;
+			break;
 		case 'e':
 			dom0_event = strtol(optarg, NULL, 10);
 			break;
diff --git a/tools/xenstore/xenstored_core.h b/tools/xenstore/xenstored_core.h
index 3d7eb91254..f5b0d70da4 100644
--- a/tools/xenstore/xenstored_core.h
+++ b/tools/xenstore/xenstored_core.h
@@ -174,6 +174,7 @@ void dtrace_io(const struct connection *conn, const struct buffered_data *data,
 void reopen_log(void);
 void close_log(void);
 
+extern bool tracesyslog;
 extern char *tracefile;
 extern int tracefd;
 
-- 
2.24.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  reply	other threads:[~2019-12-04  9:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-04  9:27 [Xen-devel] [PATCH 0/4] xenstore domain: improve logging capabilities james-xen
2019-12-04  9:27 ` james-xen [this message]
2019-12-04  9:27 ` [Xen-devel] [PATCH 2/4] xenstored logging: add control to dynamically toggle tracesyslog flag james-xen
2019-12-04  9:27 ` [Xen-devel] [PATCH 3/4] xenstored logging: send trace messages to syslog james-xen
2019-12-04  9:27 ` [Xen-devel] [PATCH 4/4] xenstored logging: add minios variant of default_xprintf() james-xen

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=20191204092739.18177-2-james-xen@dingwall.me.uk \
    --to=james-xen@dingwall.me.uk \
    --cc=ian.jackson@eu.citrix.com \
    --cc=james@dingwall.me.uk \
    --cc=wei.liu2@citrix.com \
    --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.