Skip to content

Commit

Permalink
Add topdown CSV conversion tool
Browse files Browse the repository at this point in the history
  • Loading branch information
Andi Kleen committed Sep 10, 2024
1 parent 6765a32 commit 9f405fc
Show file tree
Hide file tree
Showing 2 changed files with 1,236 additions and 0 deletions.
34 changes: 34 additions & 0 deletions topdown-csv/mock.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/usr/bin/env python3
# Do basic python sanity check of translation output
import sys
sys.path.append(".")
import t
l = []
m = []

def pev(e):
print("\t",e)
return 1

class R:
def run(self, p):
#print p
l.append(p)
def metric(self, p):
m.append(p)

t.Setup(R())
for p in l:
p.thresh = True
for p in l:
print(p.name)
p.compute(lambda e, level: pev(e))
if p.sample:
print(" Sample:", " ".join(p.sample))
if p.sibling:
print(" Siblings:", " ".join([o.name for o in p.sibling]))

for p in m:
print(p.name)
p.compute(lambda e, level: pev(e))

Loading

0 comments on commit 9f405fc

Please sign in to comment.