-
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
40 additions
and
35 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__ = "240925" | ||
__revision__ = "240926" | ||
__maintainer__ = "Peace Lee" | ||
__email__ = "[email protected]" | ||
__repository__ = "https://github.com/iipeace/guider" | ||
|
@@ -19102,27 +19102,29 @@ def getTargetList(self, tlist): | |
|
||
for liter in tlist: | ||
m = SysMgr.getTraceItem(liter) | ||
if m: | ||
d = m.groupdict() | ||
if not m: | ||
return threadData | ||
|
||
# Make thread entity # | ||
thread = d["thread"] | ||
try: | ||
threadData[thread]["comm"] = d["comm"] | ||
except: | ||
threadData[thread] = {} | ||
threadData[thread]["comm"] = d["comm"] | ||
d = m.groupdict() | ||
|
||
# Make thread entity # | ||
thread = d["thread"] | ||
try: | ||
threadData[thread]["comm"] = d["comm"] | ||
except: | ||
threadData[thread] = {} | ||
threadData[thread]["comm"] = d["comm"] | ||
|
||
# set tgid # | ||
# set tgid # | ||
try: | ||
tgid = d["tgid"] | ||
except: | ||
try: | ||
tgid = d["tgid"] | ||
tgid = SysMgr.savedProcTree[thread] | ||
except: | ||
try: | ||
tgid = SysMgr.savedProcTree[thread] | ||
except: | ||
continue | ||
continue | ||
|
||
threadData[thread]["tgid"] = tgid | ||
threadData[thread]["tgid"] = tgid | ||
|
||
return threadData | ||
|
||
|
@@ -24698,6 +24700,7 @@ class LogMgr(object): | |
binderStat = {} | ||
atraceStat = {} | ||
threadData = {} | ||
timelineData = [] | ||
|
||
def __init__(self, target="error"): | ||
self.errFd = None | ||
|
@@ -24897,6 +24900,13 @@ def _updateStat(statInfo, pid, diff, tm, point=None): | |
# update point info # | ||
statInfo["point"].setdefault(point, dict(dflStat)) | ||
pointInfo = statInfo["point"][point] | ||
|
||
if "DRAWTIME" in SysMgr.environList: | ||
core = data.get("core") | ||
LogMgr.timelineData.append( | ||
[core, point, core, tm - diff, tm] | ||
) | ||
|
||
pointInfo["count"] += 1 | ||
pointInfo["usage"] += diff | ||
pointInfo["last"] = tm | ||
|
@@ -39936,7 +39946,7 @@ def _getDesc(s, t=0): | |
# {0:1} {1:1} | ||
# {0:1} {1:1} -a | ||
|
||
- {3:1} based on trace.dat | ||
- {3:1} based on the specific file | ||
# {0:1} {1:1} trace.dat | ||
|
||
- {3:1} on a per-process basis | ||
|
@@ -39978,6 +39988,9 @@ def _getDesc(s, t=0): | |
# {0:1} {1:1} -o . -q TRIM::9 | ||
# {0:1} {1:1} -o . -q TRIM:2: | ||
|
||
- {3:1} based on the specific file with atrace logs and draw timeline | ||
# {0:1} {1:1} trace.dat -q ATRACE, DRAWTIME | ||
|
||
- {3:1} {2:1} to guider.out after converting all target inodes to paths from specific directory | ||
# {0:1} {1:1} -o . -q CONVINODE | ||
# {0:1} {1:1} -o . -q CONVINODE:/data | ||
|
@@ -128302,6 +128315,10 @@ def printUsage(self): | |
# print binder usage # | ||
self.printBinderInfo() | ||
|
||
# print atrace info # | ||
if LogMgr.atraceStat: | ||
LogMgr.atraceHandler(0, 0) | ||
|
||
# print kernel messages # | ||
self.printConsoleInfo() | ||
|
||
|
@@ -137208,24 +137225,9 @@ def _printEventWarning(func): | |
|
||
SysMgr.curLine += 1 | ||
|
||
# get items # | ||
m = SysMgr.getTraceItem(string) | ||
if not m: | ||
# handle modified type of event # | ||
m = SysMgr.getTraceItem(string) | ||
if m: | ||
d = m.groupdict() | ||
comm = d["comm"] | ||
core = str(long(d["core"])) | ||
func = d["func"] | ||
etc = d["etc"] | ||
time = d["time"] | ||
|
||
if "tracing_mark_write" in func: | ||
m = re.match(r"^.+EVENT_(?P<event>\S+)", etc) | ||
if m: | ||
d = m.groupdict() | ||
|
||
self.handleUserEvent(d["event"], time) | ||
return | ||
|
||
# get thread info # | ||
|
@@ -140188,7 +140190,10 @@ def _updateBinderStat(binderStat, ctask, code): | |
elif func in ("tracing_mark_write", "0"): | ||
m = re.match(r"^.+EVENT_(?P<event>\S+)", etc) | ||
if not m: | ||
_printEventWarning(func) | ||
if "ATRACE" in SysMgr.environList: | ||
LogMgr.parseAtraceData(d) | ||
else: | ||
_printEventWarning(func) | ||
return time | ||
|
||
d = m.groupdict() | ||
|