Skip to content

Commit da4264f

Browse files
ahunter6acmel
authored andcommitted
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. Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Cc: Jiri Olsa <jolsa@redhat.com> Link: http://lore.kernel.org/lkml/20190821083216.1340-5-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
1 parent 9a9dae3 commit da4264f

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

‎tools/perf/scripts/python/exported-sql-viewer.py‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -794,15 +794,16 @@ def FindPath(self, query):
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,25 +840,25 @@ def Select(self):
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
856857

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:

0 commit comments

Comments
 (0)