diff --git a/tl_output.py b/tl_output.py index ec0083d2..eec616f7 100644 --- a/tl_output.py +++ b/tl_output.py @@ -425,7 +425,7 @@ def __init__(self, logfile, sep, args, version, cpu): self.args = args self.printed_headers = set() - def print_header(self, timestamp, title): + def print_header_csv(self, timestamp, title): if self.no_header: return if self.curname_nologf not in self.printed_headers: @@ -440,7 +440,7 @@ def print_header(self, timestamp, title): self.printed_headers.add(self.curname_nologf) def show(self, timestamp, title, area, hdr, val, unit, desc, sample, bn, below, idle): - self.print_header(timestamp, title) + self.print_header_csv(timestamp, title) if self.args.no_desc: desc = "" desc = re.sub(r"\s+", " ", desc) diff --git a/toplev.py b/toplev.py index 0222a408..26ca92a2 100755 --- a/toplev.py +++ b/toplev.py @@ -1070,9 +1070,11 @@ def gen_cpu_name(cpu): cpu = "spr" for j in known_cpus: if cpu == j[0]: - if isinstance(j[1][0], tuple): + if len(j[1]) > 0 and isinstance(j[1][0], tuple): return "GenuineIntel-6-%02X-%d" % j[1][0] else: + if len(j[1]) == 0: + sys.exit("Cannot generate cpu name for %s" % cpu) if j[1][0] in eventlist_alias: return eventlist_alias[j[1][0]] # type: ignore return "GenuineIntel-6-%02X" % j[1][0] # type: ignore