Skip to content

Commit

Permalink
gen-dot: Fix for new event files
Browse files Browse the repository at this point in the history
Handle metric and parent correctly.

Fixes #3
  • Loading branch information
Andi Kleen committed Jul 9, 2014
1 parent 166e510 commit 69adddb
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion gen-dot.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,14 @@
class Runner:
def __init__(self):
self.olist = []

def run(self, n):
if n.level <= max_level:
self.olist.append(n)

def metric(self, n):
pass

def finish(self):
for n in self.olist:
if n.parent:
Expand All @@ -29,8 +34,11 @@ def finish(self):

def fix_parents(self):
for obj in self.olist:
if not obj.parent:
if 'parent' not in obj.__dict__:
obj.parent = None
continue
if not obj.parent:
continue
if obj.level == 1:
obj.parent = None
elif obj.parent.level >= obj.level:
Expand Down

0 comments on commit 69adddb

Please sign in to comment.