Skip to content

Commit

Permalink
interval-normalize: Preserve order of input events in columns
Browse files Browse the repository at this point in the history
  • Loading branch information
Andi Kleen committed Dec 8, 2016
1 parent a901089 commit 93757ec
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions interval-normalize.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import copy
import argparse
import csv_formats
import collections

ap = argparse.ArgumentParser(description=
'Normalize CSV data from perf or toplev. All values are printed on a single line.')
Expand All @@ -27,7 +28,7 @@
printed_header = False
timestamp = None

events = dict()
events = collections.OrderedDict()
out = []
times = []
cpus = []
Expand Down Expand Up @@ -75,7 +76,7 @@ def resolve(row, ind):
return args.na
return v

keys = sorted(events.keys())
keys = events.keys()
writer.writerow(["Timestamp"] + (["CPU"] if cpu is not None else []) + keys)
for row, ts, cpunum in zip(out, times, cpus):
writer.writerow([ts] +
Expand Down

0 comments on commit 93757ec

Please sign in to comment.