From patchwork Wed Feb 17 14:30:37 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Campbell X-Patchwork-Id: 8339561 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id E7998C0553 for ; Wed, 17 Feb 2016 14:33:15 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id ADF66203B6 for ; Wed, 17 Feb 2016 14:33:14 +0000 (UTC) Received: from lists.xen.org (lists.xenproject.org [50.57.142.19]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5A315203A4 for ; Wed, 17 Feb 2016 14:33:13 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aW37u-0004RE-RL; Wed, 17 Feb 2016 14:30:46 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aW37t-0004R3-6k for xen-devel@lists.xen.org; Wed, 17 Feb 2016 14:30:45 +0000 Received: from [85.158.137.68] by server-17.bemta-3.messagelabs.com id E0/FB-09062-31484C65; Wed, 17 Feb 2016 14:30:43 +0000 X-Env-Sender: prvs=848fde4e6=Ian.Campbell@citrix.com X-Msg-Ref: server-8.tower-31.messagelabs.com!1455719441!23228010!1 X-Originating-IP: [66.165.176.63] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAzMDYwNDg=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 7.35.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 65063 invoked from network); 17 Feb 2016 14:30:42 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-8.tower-31.messagelabs.com with RC4-SHA encrypted SMTP; 17 Feb 2016 14:30:42 -0000 X-IronPort-AV: E=Sophos;i="5.22,460,1449532800"; d="scan'208";a="338859111" From: Ian Campbell To: , , Date: Wed, 17 Feb 2016 14:30:37 +0000 Message-ID: <1455719438-11095-1-git-send-email-ian.campbell@citrix.com> X-Mailer: git-send-email 2.1.4 MIME-Version: 1.0 X-DLP: MIA2 Cc: Ian Campbell Subject: [Xen-devel] [PATCH 1/2] tools: gtracestat: Drop unused functions do_cstate and single_cstate helper X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP These have always been dead code since the code was added AFAICT. This eliminates the code containing CID 10567079, 10567080, 10567081 and 10567082 (all apparently some confusion between max_cx_num vs MAX_CX_NR, but given the lack of callers its hard to tell what was intended) Signed-off-by: Ian Campbell --- tools/misc/gtracestat.c | 93 ------------------------------------------------- 1 file changed, 93 deletions(-) diff --git a/tools/misc/gtracestat.c b/tools/misc/gtracestat.c index 5164397..b54eeb8 100644 --- a/tools/misc/gtracestat.c +++ b/tools/misc/gtracestat.c @@ -58,7 +58,6 @@ void do_count(void); void do_px_count(void); void do_maxmin(void); void do_average(void); -void do_cstate(uint64_t start, uint64_t end); void do_exp_ratio(void); void do_exp_pred(void); @@ -974,98 +973,6 @@ void do_breakevents(void) } } -void single_cstate(int c, uint64_t t, uint64_t e, - uint64_t *a, - uint64_t *max_res, - uint64_t *min_res, - uint64_t *num); -void do_cstate(uint64_t start, uint64_t end) -{ - uint64_t cxtime[MAX_CX_NR]; - uint64_t max_res[MAX_CX_NR]; - uint64_t min_res[MAX_CX_NR]; - uint64_t num[MAX_CX_NR]; - int i, j; - - width = 20; - printf(" "); - for (i = 0; i < max_cx_num; i++) { - int l = printf("C%d", i); - nr_putchar(width-l, ' '); - } - printf("\n"); - - for (i = 0; i < max_cpu_num; i++) { - uint64_t sum = 0; - single_cstate(i, start, end, cxtime, max_res, min_res, num); - printf("CPU%2d ", i); - for (j = 0; j < max_cx_num; j++) - sum += cxtime[i]; - for (j = 0; j < max_cx_num; j++) { - int l = printf("%.1f%%, %"PRIu64".%d, %"PRIu64".%d, %"PRIu64, - 100.0 * cxtime[j]/sum, - max_res[j]/tsc2ms, - (unsigned int)(max_res[j]/(tsc2ms/10))%10, - min_res[j]/tsc2ms, - (unsigned int)(min_res[j]/(tsc2ms/10))%10, - cxtime[j]/num[j]/tsc2ms); - nr_putchar(width - l, ' '); - } - } -} - -void single_cstate(int c, uint64_t t, uint64_t e, - uint64_t *a, - uint64_t *max_res, - uint64_t *min_res, - uint64_t *num) -{ - int cx; - int i; - int first = 1; - - for (i = 0; i < max_cx_num; i++) { - a[i] = 0; - max_res[i] = 0; - min_res[i] = (uint64_t) -1; - num[i] = 0; - } - - cx = determine_cx(c, t); - i = 0; - while (i < evt_len[c] && evt[c][i].tsc <= t) - i++; - for (; i+1 < evt_len[c] && evt[c][i].tsc <= e; i++) { - int cxidx = evt[c][i].cx; - uint64_t delta; - - if (first && cx >= 0) { - /* Partial Cx, only once */ - first = 0; - - cxidx = cx; - delta = evt[c][i].tsc - max(evt[c][i-1].tsc, t); - a[cxidx] += delta; - num[cxidx]++; - - /* update min and max residency */ - if (delta > max_res[cxidx]) - max_res[cxidx] = delta; - if (delta < min_res[cxidx]) - min_res[cxidx] = delta; - } - delta = evt[c][i+1].tsc - evt[c][i].tsc; - a[cxidx] += delta; - num[cxidx]++; - - /* update min and max residency */ - if (delta > max_res[cxidx]) - max_res[cxidx] = delta; - if (delta < min_res[cxidx]) - min_res[cxidx] = delta; - } -} - void do_average_per_cpu(int c) { int i;