From patchwork Tue Feb 21 12:00:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?SsO8cmdlbiBHcm/Dnw==?= X-Patchwork-Id: 9584337 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9B5B1600C1 for ; Tue, 21 Feb 2017 12:03:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 69AE7285FB for ; Tue, 21 Feb 2017 12:03:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5DE3C287D2; Tue, 21 Feb 2017 12:03:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id DBA20285FB for ; Tue, 21 Feb 2017 12:03:33 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cg980-00072i-FF; Tue, 21 Feb 2017 12:01:08 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cg97z-00071n-6B for xen-devel@lists.xenproject.org; Tue, 21 Feb 2017 12:01:07 +0000 Received: from [85.158.143.35] by server-6.bemta-6.messagelabs.com id 45/46-15112-20C2CA85; Tue, 21 Feb 2017 12:01:06 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrELMWRWlGSWpSXmKPExsVyuP0Ovy6jzpo Ig+67Ohbft0xmcmD0OPzhCksAYxRrZl5SfkUCa8bdSb/ZCqZLVpxb+4WxgXG2SBcjJ4eEgJHE 24n/mLoYuTiEBBYySiz70s4KkmATUJXYcP0UmC0ioCRxb9VkJhCbWSBU4uS7e8wgtrCAh8SUu cfZQGwWoPrX57aBxXkFTCSWtvQyQiyQl1h4/ghYL6eAqcSZxn1gM4WAak7e+8MygZF7ASPDKk aN4tSistQiXSMTvaSizPSMktzEzBxdQwMzvdzU4uLE9NScxKRiveT83E2MQP8yAMEOxpXrAg8 xSnIwKYnyHmVeFiHEl5SfUpmRWJwRX1Sak1p8iFGGg0NJgveBNVBOsCg1PbUiLTMHGGgwaQkO HiURXn0boDRvcUFibnFmOkTqFKMux6kbp18yCbHk5eelSonzyoAUCYAUZZTmwY2ABf0lRlkpY V5GoKOEeApSi3IzS1DlXzGKczAqCfOeA7mEJzOvBG7TK6AjmICO6IxYCnJESSJCSqqBMaX7tr Z/OLOPaUqlqUPTxqlv0kq8HA7/DBeq2aPRv4+Pnd/URKF/+s8Y3wTTtPtvJPy9PEVUvkf4cfo zvRauk76xOWx/XJ3VY34du1U8D5R/OfdOLFwUdflrVulEVdZu5Tlv3s389O783aL5r1MjP3C/ 5y5tmjOd/bCQ3O6z/xz1nY4uXnlAiaU4I9FQi7moOBEAtryhj3UCAAA= X-Env-Sender: jgross@suse.com X-Msg-Ref: server-2.tower-21.messagelabs.com!1487678465!44835793!1 X-Originating-IP: [195.135.220.15] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.2.3; banners=-,-,- X-VirusChecked: Checked Received: (qmail 17955 invoked from network); 21 Feb 2017 12:01:05 -0000 Received: from mx2.suse.de (HELO mx2.suse.de) (195.135.220.15) by server-2.tower-21.messagelabs.com with DHE-RSA-CAMELLIA256-SHA encrypted SMTP; 21 Feb 2017 12:01:05 -0000 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 8377BACB0; Tue, 21 Feb 2017 12:01:03 +0000 (UTC) From: Juergen Gross To: xen-devel@lists.xenproject.org Date: Tue, 21 Feb 2017 13:00:59 +0100 Message-Id: <20170221120059.15627-5-jgross@suse.com> X-Mailer: git-send-email 2.10.2 In-Reply-To: <20170221120059.15627-1-jgross@suse.com> References: <20170221120059.15627-1-jgross@suse.com> Cc: Juergen Gross , wei.liu2@citrix.com, ian.jackson@eu.citrix.com Subject: [Xen-devel] [PATCH 4/4] xenstore: remove memory report command line support X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP As a memory report can now be triggered via XS_DEBUG support via command line and signal handler is no longer needed. Remove it. Signed-off-by: Juergen Gross --- tools/xenstore/xenstored_core.c | 35 ++--------------------------------- 1 file changed, 2 insertions(+), 33 deletions(-) diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c index ae7681f..72880da 100644 --- a/tools/xenstore/xenstored_core.c +++ b/tools/xenstore/xenstored_core.c @@ -82,7 +82,6 @@ static int reopen_log_pipe[2]; static int reopen_log_pipe0_pollfd_idx = -1; char *tracefile = NULL; static TDB_CONTEXT *tdb_ctx = NULL; -static bool trigger_talloc_report = false; static void corrupt(struct connection *conn, const char *fmt, ...); static const char *sockmsg_string(enum xsd_sockmsg_type type); @@ -1792,10 +1791,6 @@ static void init_sockets(int **psock, int **pro_sock) static int minus_one = -1; *psock = *pro_sock = &minus_one; } - -static void do_talloc_report(int sig) -{ -} #else static int destroy_fd(void *_fd) { @@ -1855,11 +1850,6 @@ static void init_sockets(int **psock, int **pro_sock) } - -static void do_talloc_report(int sig) -{ - trigger_talloc_report = true; -} #endif static void usage(void) @@ -1884,7 +1874,6 @@ static void usage(void) " -R, --no-recovery to request that no recovery should be attempted when\n" " the store is corrupted (debug only),\n" " -I, --internal-db store database in memory, not on disk\n" -" -M, --memory-debug support memory debugging to file,\n" " -V, --verbose to request verbose execution.\n"); } @@ -1906,7 +1895,6 @@ static struct option options[] = { { "internal-db", 0, NULL, 'I' }, { "verbose", 0, NULL, 'V' }, { "watch-nb", 1, NULL, 'W' }, - { "memory-debug", 1, NULL, 'M' }, { NULL, 0, NULL, 0 } }; extern void dump_conn(struct connection *conn); @@ -1922,11 +1910,10 @@ int main(int argc, char *argv[]) bool outputpid = false; bool no_domain_init = false; const char *pidfile = NULL; - const char *memfile = NULL; int timeout; - while ((opt = getopt_long(argc, argv, "DE:F:HNPS:t:T:RVW:M:", options, + while ((opt = getopt_long(argc, argv, "DE:F:HNPS:t:T:RVW:", options, NULL)) != -1) { switch (opt) { case 'D': @@ -1977,9 +1964,6 @@ int main(int argc, char *argv[]) case 'p': priv_domid = strtol(optarg, NULL, 10); break; - case 'M': - memfile = optarg; - break; } } if (optind != argc) @@ -2006,10 +1990,7 @@ int main(int argc, char *argv[]) /* Don't kill us with SIGPIPE. */ signal(SIGPIPE, SIG_IGN); - if (memfile) { - talloc_enable_null_tracking(); - signal(SIGUSR1, do_talloc_report); - } + talloc_enable_null_tracking(); init_sockets(&sock, &ro_sock); @@ -2054,18 +2035,6 @@ int main(int argc, char *argv[]) for (;;) { struct connection *conn, *next; - if (trigger_talloc_report) { - FILE *out; - - assert(memfile); - trigger_talloc_report = false; - out = fopen(memfile, "a"); - if (out) { - talloc_report_full(NULL, out); - fclose(out); - } - } - if (poll(fds, nr_fds, timeout) < 0) { if (errno == EINTR) continue;