-
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
20 additions
and
4 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__ = "240915" | ||
__revision__ = "240916" | ||
__maintainer__ = "Peace Lee" | ||
__email__ = "[email protected]" | ||
__repository__ = "https://github.com/iipeace/guider" | ||
|
@@ -25572,7 +25572,7 @@ def printTrace(console=False, targets=None, cb=None, parser=None): | |
SysMgr.clearFilters(targets) | ||
|
||
# apply filters # | ||
SysMgr.applyEventFilters() | ||
SysMgr.applyEventFilters(targets) | ||
|
||
# set trace option # | ||
SysMgr.setTraceOpt() | ||
|
@@ -43175,6 +43175,9 @@ def _getDesc(s, t=0): | |
- {2:1} only having specific words | ||
# {0:1} {1:1} "*" -g test, kworker | ||
|
||
- {2:1} except for things about me | ||
# {0:1} {1:1} "*" -q EXCEPTME | ||
|
||
- {2:1} after applying filters | ||
# {0:1} {1:1} "*" -q TPFILTER:"sched:common_pid==895" | ||
|
||
|
@@ -77774,11 +77777,21 @@ def clearFilters(targets=["*"]): | |
SysMgr.printInfo("[done]", prefix=False, title=False) | ||
|
||
@staticmethod | ||
def applyEventFilters(): | ||
def applyEventFilters(targets=[]): | ||
# add filter for EXCEPTME # | ||
addExceptMe = True | ||
exceptMe = "EXCEPTME" in SysMgr.environList | ||
filters = SysMgr.environList.get("TPFILTER", []) | ||
if not filters: | ||
return | ||
if exceptMe: | ||
filters = [ | ||
t + ":common_pid != %s" % SysMgr.pid for t in targets | ||
] | ||
addExceptMe = False | ||
else: | ||
return | ||
|
||
# apply filters # | ||
for f in filters: | ||
fitem = f.split(":", 1) | ||
if len(fitem) == 1: | ||
|
@@ -77788,6 +77801,9 @@ def applyEventFilters(): | |
filters = fitem[0].split("|") | ||
value = fitem[1] | ||
|
||
if exceptMe and addExceptMe: | ||
value += " && common_pid != %s" % SysMgr.pid | ||
|
||
SysMgr.printInfo( | ||
r"apply trace filter [%s] for '%s'... " | ||
% (value, ", ".join(filters)), | ||
|