-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: iipeace <[email protected]>
- Loading branch information
Showing
1 changed file
with
45 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ | |
__credits__ = "Peace Lee" | ||
__license__ = "GPLv2" | ||
__version__ = "3.9.8" | ||
__revision__ = "240924" | ||
__revision__ = "240925" | ||
__maintainer__ = "Peace Lee" | ||
__email__ = "[email protected]" | ||
__repository__ = "https://github.com/iipeace/guider" | ||
|
@@ -25327,10 +25327,11 @@ def _printer(a, newline=1, force=False): | |
values["usage"], values["min"], values["max"], callAvg | ||
) | ||
callStatStr = "{0:>6}({1:3})".format(convNum(callCnt), callPer) | ||
callStr = "{0:>32} | {1:>11} | {2:>30} |\n".format( | ||
callStr = "{0:>32} | {1:>11} | {2:>30} | {3:1}\n".format( | ||
taskInfo, | ||
callStatStr, | ||
callStat, | ||
"<TOTAL>", | ||
) | ||
|
||
# print stats # | ||
|
@@ -25421,6 +25422,7 @@ def _printer(a, newline=1, force=False): | |
# set stats # | ||
totalCnt = float(sum([v["count"] for v in LogMgr.binderStat.values()])) | ||
cliBasis = False if "SERVER" in SysMgr.environList else True | ||
taskType = "PROCESS" if SysMgr.processEnable else "THREAD" | ||
opposite = "server" if cliBasis else "cli" | ||
jsonItem = jsonSubItem = {} | ||
jsonStat = { | ||
|
@@ -25461,18 +25463,14 @@ def _printer(a, newline=1, force=False): | |
"{4:>7} {5:>7} {6:>7} | {7:>38} | {8:>6} | " | ||
"{9:>10}({10:>4}) \n{11:1}\n" | ||
).format( | ||
"%s(%s)" | ||
% ( | ||
"CLIENT" if cliBasis else "SERVER", | ||
"PROCESS" if SysMgr.processEnable else "THREAD", | ||
), | ||
"%s(%s)" % ("CLIENT" if cliBasis else "SERVER", taskType), | ||
"CALL", | ||
"%", | ||
"TOTAL", | ||
"MIN", | ||
"MAX", | ||
"AVG", | ||
"SERVER" if cliBasis else "CLIENT", | ||
"%s(%s)" % ("SERVER" if cliBasis else "CLIENT", taskType), | ||
"CODE", | ||
"COUNT", | ||
"%", | ||
|
@@ -25516,7 +25514,7 @@ def _printer(a, newline=1, force=False): | |
key=lambda x: x[1].get(sortRes, 0), | ||
reverse=True, | ||
): | ||
if quitLoop or (not force and SysMgr.checkCutCond()): | ||
if quitLoop or (not force and SysMgr.checkCutCond(1)): | ||
break | ||
|
||
# get comm # | ||
|
@@ -40830,6 +40828,9 @@ def _getDesc(s, t=0): | |
- {2:1} with interval stats | ||
# {0:1} {1:1} {3:1} -q PRINTSTAT | ||
|
||
- {2:1} except for things about me | ||
# {0:1} {1:1} {3:1} -q EXCEPTME | ||
|
||
- {2:1} after applying filters | ||
# {0:1} {1:1} {3:1} -q TPFILTER:"sched:common_pid==895" | ||
# {0:1} {1:1} {3:1} -q TPFILTER:"sched/sched_switch:prev_comm==\\"yes\\"" | ||
|
@@ -100726,7 +100727,7 @@ def printBpContext(self, sym, addr, fname, checkArg, origPC): | |
self.addSample(sym, fname, realtime=True, bt=backtrace) | ||
|
||
# add timeline segment # | ||
self.addTimelineInt(sym, self.btStr) | ||
self.addTimeline(True, sym, self.btStr) | ||
|
||
return isRetBp | ||
|
||
|
@@ -100857,7 +100858,9 @@ def printBpContext(self, sym, addr, fname, checkArg, origPC): | |
|
||
# add timeline segment # | ||
numElapsed = float(origElapsed) | ||
self.addTimelineRet(origSym, numElapsed, btstr) | ||
self.addTimeline( | ||
False, origSym, btstr, diff=numElapsed | ||
) | ||
|
||
# build JSON output # | ||
elif SysMgr.jsonEnable: | ||
|
@@ -100939,7 +100942,7 @@ def printBpContext(self, sym, addr, fname, checkArg, origPC): | |
) | ||
|
||
# add timeline segment # | ||
self.addTimelineInt(sym, btstr) | ||
self.addTimeline(True, sym, btstr) | ||
|
||
# check filter result # | ||
if not filterRes: | ||
|
@@ -101451,7 +101454,7 @@ def handleSignal(self, sig, warn=False, taskinfo=False): | |
SysMgr.printPipe(callString) | ||
|
||
# add timeline segment # | ||
self.addTimelineInt(name, callString) | ||
self.addTimeline(True, name, callString) | ||
|
||
# print backtrace # | ||
if not self.isRealtime and SysMgr.funcDepth: | ||
|
@@ -102161,7 +102164,7 @@ def handlePyTrap(self, sym, fname, addr): | |
): | ||
pySym = "%s[%s]" % (self.prevPySym, self.prevPyFile) | ||
pyBtStr = self.getBtStr(self.prevPyBt) | ||
self.addTimelineRet(pySym, etime, pyBtStr) | ||
self.addTimeline(False, pySym, pyBtStr, diff=etime) | ||
|
||
# initialize previous symbol # | ||
call = self.prevPySym | ||
|
@@ -102211,7 +102214,7 @@ def handlePyTrap(self, sym, fname, addr): | |
) | ||
|
||
# add timeline item # | ||
self.addTimelineInt(call, btstr) | ||
self.addTimeline(True, call, btstr) | ||
|
||
# add backtrace # | ||
if btstr: | ||
|
@@ -102354,7 +102357,7 @@ def handlePycall(self, retbt=False, cur=False): | |
# add timeline segment # | ||
if Debugger.envFlags["TIMELINE"] and Debugger.envFlags["INTERCALL"]: | ||
pyBtStr = self.getBtStr(bt) | ||
self.addTimelineInt(lastName, pyBtStr) | ||
self.addTimeline(True, lastName, pyBtStr) | ||
|
||
self.addSample(lastName, lastFile, realtime=True, bt=bt) | ||
|
||
|
@@ -102604,44 +102607,7 @@ def isDeferCall(self, name): | |
def isDeferRetCall(self, name): | ||
return name in ConfigMgr.SYSCALL_DEFFERABLE_RET | ||
|
||
def addTimelineRet(self, sym, diff, bts, gid=-1, sid=-1): | ||
if not Debugger.envFlags["TIMELINE"] or Debugger.envFlags["INTERCALL"]: | ||
return | ||
|
||
# get symbol id # | ||
if sid == -1: | ||
if not sym in self.timelineIdx: | ||
self.timelineIdx[sym] = str(len(self.timelineIdx)) | ||
symidx = self.timelineIdx[sym] | ||
else: | ||
symidx = sid | ||
|
||
# get group id # | ||
if gid == -1: | ||
grpidx = symidx | ||
else: | ||
grpidx = gid | ||
|
||
# convert time unit to us # | ||
startTime = self.vdiff - diff | ||
endTime = self.vdiff | ||
endTime *= 1000000 | ||
startTime *= 1000000 | ||
|
||
# add timeline data # | ||
self.timelineData["segments"].append( | ||
{ | ||
"group": grpidx, | ||
"text": sym, | ||
"id": symidx, | ||
"state": "S", | ||
"time_start": startTime, | ||
"time_end": endTime, | ||
"info": bts.strip() if bts else "", | ||
} | ||
) | ||
|
||
def addTimelineInt(self, sym, bts, gid=-1, sid=-1): | ||
def addTimeline(self, isIntval, sym, bts, gid=-1, sid=-1, diff=0): | ||
# add timeline segment # | ||
if ( | ||
not Debugger.envFlags["TIMELINE"] | ||
|
@@ -102664,7 +102630,14 @@ def addTimelineInt(self, sym, bts, gid=-1, sid=-1): | |
grpidx = gid | ||
|
||
# convert time unit to us # | ||
startTime = self.vdiff * 1000000 | ||
if isIntval: | ||
startTime = self.vdiff * 1000000 | ||
endTime = startTime + self.timeDuration | ||
else: | ||
startTime = self.vdiff - diff | ||
endTime = self.vdiff | ||
endTime *= 1000000 | ||
startTime *= 1000000 | ||
|
||
# add timeline data # | ||
self.timelineData["segments"].append( | ||
|
@@ -102674,7 +102647,7 @@ def addTimelineInt(self, sym, bts, gid=-1, sid=-1): | |
"id": symidx, | ||
"state": "S", | ||
"time_start": startTime, | ||
"time_end": startTime + self.timeDuration, | ||
"time_end": endTime, | ||
"info": bts.strip() if bts else "", | ||
} | ||
) | ||
|
@@ -102718,7 +102691,7 @@ def handleSyscallOutput(self, args, defer=False, ignored=False): | |
bts = "" | ||
|
||
# add timeline item # | ||
self.addTimelineInt(self.syscall, bts) | ||
self.addTimeline(True, self.syscall, bts) | ||
|
||
# set filter flag # | ||
if Debugger.envFlags["ONLYOK"] or Debugger.envFlags["ONLYFAIL"]: | ||
|
@@ -103234,7 +103207,7 @@ def _getDict(size, name): | |
retstr = convColor(retstr, "WARNING") | ||
|
||
# add timeline segment # | ||
self.addTimelineRet(name, diff, self.prevBtStr) | ||
self.addTimeline(False, name, self.prevBtStr, diff=diff) | ||
|
||
# update stats # | ||
if self.isRealtime: | ||
|
@@ -118822,15 +118795,8 @@ def __init__(self, fpath=None, onlyInstance=False): | |
stop_delta = long((float(self.finishTime) - stime) * 1000000) | ||
|
||
# add timeline data # | ||
self.timelineData["segments"].append( | ||
{ | ||
"group": nrCore, | ||
"text": "OFF", | ||
"id": nrCore, | ||
"state": "OFF", | ||
"time_start": start_delta, | ||
"time_end": stop_delta, | ||
} | ||
self.addTimelineData( | ||
nrCore, "OFF", nrCore, "OFF", start_delta, stop_delta | ||
) | ||
|
||
elif self.threadData[coreId]["lastOff"] > 0: | ||
|
@@ -118844,15 +118810,8 @@ def __init__(self, fpath=None, onlyInstance=False): | |
stop_delta = long((float(self.finishTime) - stime) * 1000000) | ||
|
||
# add timeline data # | ||
self.timelineData["segments"].append( | ||
{ | ||
"group": nrCore, | ||
"text": "OFF", | ||
"id": nrCore, | ||
"state": "OFF", | ||
"time_start": start_delta, | ||
"time_end": stop_delta, | ||
} | ||
self.addTimelineData( | ||
nrCore, "OFF", nrCore, "OFF", start_delta, stop_delta | ||
) | ||
|
||
if self.threadData[val]["lastStatus"] == "S": | ||
|
@@ -118976,7 +118935,14 @@ def __init__(self, fpath=None, onlyInstance=False): | |
continue | ||
|
||
# add segment # | ||
self.timelineData["segments"].append(item) | ||
self.addTimelineData( | ||
item["group"], | ||
item["text"], | ||
item["id"], | ||
item["state"], | ||
item["time_start"], | ||
item["time_end"], | ||
) | ||
|
||
# filter thread data # | ||
for key in list(self.threadData): | ||
|
@@ -118998,16 +118964,7 @@ def __init__(self, fpath=None, onlyInstance=False): | |
|
||
# add empty timeline data for drawing cores # | ||
for nrCore in SysMgr.perCoreDrawList: | ||
self.timelineData["segments"].append( | ||
{ | ||
"group": nrCore, | ||
"text": "OFF", | ||
"id": nrCore, | ||
"state": "OFF", | ||
"time_start": 0, | ||
"time_end": 0, | ||
} | ||
) | ||
self.addTimelineData(nrCore, "OFF", nrCore, "OFF", 0, 0) | ||
|
||
def __del__(self): | ||
pass | ||
|
@@ -137230,6 +137187,7 @@ def addTimelineData(self, group, text, task, state, start, end): | |
group = self.timelineIdx[task] | ||
|
||
# add timeline data # | ||
self.timelineData.setdefault("segments", []) | ||
self.timelineData["segments"].append( | ||
{ | ||
"group": group, | ||
|