History

perf scripts python: exported-sql-viewer.py: Tidy up Call tree call_time

Record call_time on tree nodes and re-name the misnamed "count" parameter.

Adrian Hunter committed 7 years ago

Commit da4264f1 parent 9a9dae31 file · +8 −7Browse files

Showing the changes to tools/perf/scripts/python (1 of 1 file). Show all

Unified · Split

tools/perf/scripts/python/exported-sql-viewer.py+8−7
@@ -794,15 +794,16 @@ class CallGraphModel(CallGraphModelBase): · 793 unmodified lines
794794
795795 class CallTreeLevelTwoPlusItemBase(CallGraphLevelItemBase):
796796
797− def __init__(self, glb, params, row, comm_id, thread_id, calls_id, time, insn_cnt, cyc_cnt, branch_count, parent_item):
797+ def __init__(self, glb, params, row, comm_id, thread_id, calls_id, call_time, time, insn_cnt, cyc_cnt, branch_count, parent_item):
798798 super(CallTreeLevelTwoPlusItemBase, self).__init__(glb, params, row, parent_item)
799799 self.comm_id = comm_id
800800 self.thread_id = thread_id
801801 self.calls_id = calls_id
802+ self.call_time = call_time
803+ self.time = time
802804 self.insn_cnt = insn_cnt
803805 self.cyc_cnt = cyc_cnt
804806 self.branch_count = branch_count
805− self.time = time
806807
807808 def Select(self):
808809 self.query_done = True
@@ -839,17 +840,17 @@ class CallTreeLevelTwoPlusItemBase(CallGraphLevelItemBase): · 30 unmodified lines
839840
840841 class CallTreeLevelThreeItem(CallTreeLevelTwoPlusItemBase):
841842
842− def __init__(self, glb, params, row, comm_id, thread_id, calls_id, name, dso, count, time, insn_cnt, cyc_cnt, branch_count, parent_item):
843− super(CallTreeLevelThreeItem, self).__init__(glb, params, row, comm_id, thread_id, calls_id, time, insn_cnt, cyc_cnt, branch_count, parent_item)
843+ def __init__(self, glb, params, row, comm_id, thread_id, calls_id, name, dso, call_time, time, insn_cnt, cyc_cnt, branch_count, parent_item):
844+ super(CallTreeLevelThreeItem, self).__init__(glb, params, row, comm_id, thread_id, calls_id, call_time, time, insn_cnt, cyc_cnt, branch_count, parent_item)
844845 dso = dsoname(dso)
845846 if self.params.have_ipc:
846847 insn_pcnt = PercentToOneDP(insn_cnt, parent_item.insn_cnt)
847848 cyc_pcnt = PercentToOneDP(cyc_cnt, parent_item.cyc_cnt)
848849 br_pcnt = PercentToOneDP(branch_count, parent_item.branch_count)
849850 ipc = CalcIPC(cyc_cnt, insn_cnt)
850− self.data = [ name, dso, str(count), str(time), PercentToOneDP(time, parent_item.time), str(insn_cnt), insn_pcnt, str(cyc_cnt), cyc_pcnt, ipc, str(branch_count), br_pcnt ]
851+ self.data = [ name, dso, str(call_time), str(time), PercentToOneDP(time, parent_item.time), str(insn_cnt), insn_pcnt, str(cyc_cnt), cyc_pcnt, ipc, str(branch_count), br_pcnt ]
851852 else:
852− self.data = [ name, dso, str(count), str(time), PercentToOneDP(time, parent_item.time), str(branch_count), PercentToOneDP(branch_count, parent_item.branch_count) ]
853+ self.data = [ name, dso, str(call_time), str(time), PercentToOneDP(time, parent_item.time), str(branch_count), PercentToOneDP(branch_count, parent_item.branch_count) ]
853854 self.dbid = calls_id
854855
855856 # Call tree data model level two item
@@ -857,7 +858,7 @@ class CallTreeLevelThreeItem(CallTreeLevelTwoPlusItemBase): · 1 unmodified line
857858 class CallTreeLevelTwoItem(CallTreeLevelTwoPlusItemBase):
858859
859860 def __init__(self, glb, params, row, comm_id, thread_id, pid, tid, parent_item):
860− super(CallTreeLevelTwoItem, self).__init__(glb, params, row, comm_id, thread_id, 0, 0, 0, 0, 0, parent_item)
861+ super(CallTreeLevelTwoItem, self).__init__(glb, params, row, comm_id, thread_id, 0, 0, 0, 0, 0, 0, parent_item)
861862 if self.params.have_ipc:
862863 self.data = [str(pid) + ":" + str(tid), "", "", "", "", "", "", "", "", "", "", ""]
863864 else: