Skip to content

Commit 19177cc

Browse files
author
Andi Kleen
committed
toplev: Fix --columns output
Print remark correctly. Avoid bogus : header Some other improvements.
1 parent 2fe21c0 commit 19177cc

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

tl_output.py

+8-6
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,12 @@ def set_cpus(self, cpus):
7979
self.titlelen = max(map(len, cpus)) + 1
8080

8181
def print_desc(self, desc, sample):
82-
if desc and not self.args.no_desc:
82+
if self.args.no_desc:
83+
return
84+
if desc:
8385
print >>self.logf, "\t" + desc
84-
if desc and sample and not self.args.no_desc:
85-
print >>self.logf, "\t" + "Sampling events: ", sample
86+
if sample:
87+
print >>self.logf, "\t" + "Sampling events: ", sample
8688

8789
def print_timestamp(self, timestamp):
8890
if timestamp:
@@ -93,7 +95,7 @@ def print_timestamp(self, timestamp):
9395

9496
def print_header(self, area, hdr):
9597
hdr = "%-14s %s" % (area, hdr)
96-
self.logf.write("%-*s " % (self.hdrlen, hdr + ":"))
98+
self.logf.write("%-*s " % (self.hdrlen, (hdr + ":") if hdr.strip() else " "))
9799

98100
# timestamp Timestamp in interval mode
99101
# title CPU
@@ -182,7 +184,7 @@ def flush(self):
182184
for cpuname in cpunames:
183185
if cpuname in node:
184186
cpu = node[cpuname]
185-
uval, desc, sample, remark, bn = cpu
187+
uval, remark, desc, sample, bn = cpu
186188
v = uval.format_value()
187189
if bn:
188190
v += "*"
@@ -194,7 +196,7 @@ def flush(self):
194196
write("%*s " % (VALCOL_LEN, ""))
195197
if remark:
196198
cval = combine_uval(vlist)
197-
vs = cval.format_uncertainty() + " " + cval.format_mux()
199+
vs = "+- " + cval.format_uncertainty() + " " + cval.format_mux()
198200
write(" %-*s %s" % (self.unitlen, remark, vs))
199201
write("\n")
200202
self.print_desc(desc, sample)

tl_uval.py

-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ def update(self, other):
111111
self.value = res.value
112112
self.stddev = res.stddev
113113
self.multiplex = UVal._merge_mux(self, other)
114-
log.warning("updated {} with {} => {}".format(strbefore, other, self))
115114

116115
######################
117116
# operators

0 commit comments

Comments
 (0)