From: Ian Campbell <ian.campbell@citrix.com>
To: ian.jackson@eu.citrix.com, wei.liu2@citrix.com, xen-devel@lists.xen.org
Cc: Ian Campbell <ian.campbell@citrix.com>
Subject: [PATCH 1/2] tools: gtracestat: Drop unused functions do_cstate and single_cstate helper
Date: Wed, 17 Feb 2016 14:30:37 +0000 [thread overview]
Message-ID: <1455719438-11095-1-git-send-email-ian.campbell@citrix.com> (raw)
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 <ian.campbell@citrix.com>
---
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;
--
2.1.4
next reply other threads:[~2016-02-17 14:30 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-17 14:30 Ian Campbell [this message]
2016-02-17 14:30 ` [PATCH 2/2] tools: gtracestat: make all functions and global data static Ian Campbell
2016-02-19 16:44 ` Ian Jackson
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=1455719438-11095-1-git-send-email-ian.campbell@citrix.com \
--to=ian.campbell@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=wei.liu2@citrix.com \
--cc=xen-devel@lists.xen.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).