perf scripts python: exported-sql-viewer.py: Add tree level
authorAdrian Hunter <adrian.hunter@intel.com>
Fri, 3 May 2019 12:08:25 +0000 (15:08 +0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 15 May 2019 19:36:47 +0000 (16:36 -0300)
As preparation for adding support for copying to clipboard, keep track of
what level each item is in tree items.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Link: http://lkml.kernel.org/r/20190503120828.25326-4-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/scripts/python/exported-sql-viewer.py

index fd073e4af8da91729b8e9b75c3c649ae24dc01ee..48953257a1f053f977e4992fd2ae8743a977a2c1 100755 (executable)
@@ -456,6 +456,10 @@ class CallGraphLevelItemBase(object):
                self.query_done = False;
                self.child_count = 0
                self.child_items = []
+               if parent_item:
+                       self.level = parent_item.level + 1
+               else:
+                       self.level = 0
 
        def getChildItem(self, row):
                return self.child_items[row]