-
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.
ctop: Add NOREP options to remove useless info
Signed-off-by: iipeace <[email protected]>
- Loading branch information
Showing
1 changed file
with
25 additions
and
17 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__ = "231122" | ||
__revision__ = "231123" | ||
__maintainer__ = "Peace Lee" | ||
__email__ = "[email protected]" | ||
__repository__ = "https://github.com/iipeace/guider" | ||
|
@@ -31062,7 +31062,7 @@ def _checkPerm(item): | |
|
||
# set report table # | ||
SysMgr.reportEnable = True | ||
if SysMgr.findOption("j"): | ||
if SysMgr.findOption("j") and not SysMgr.environList.get("NOPROCRANK"): | ||
SysMgr.rankProcEnable = True | ||
else: | ||
SysMgr.rankProcEnable = False | ||
|
@@ -36604,8 +36604,8 @@ def _getDesc(s, t=0): | |
|
||
- {2:1} {3:1} and report in JSON format every interval | ||
# {0:1} {1:1} -j -Q -q TEXTREPORT | ||
# {0:1} {1:1} -j -o /tmp -q TEXTREPORT | ||
# {0:1} {1:1} -C /tmp/guider.conf -j -o /tmp -q TEXTREPORT | ||
# {0:1} {1:1} -j -o /tmp -q TEXTREPORT, NOPROCRANK | ||
# {0:1} {1:1} -j -o /tmp -q TEXTREPORT -C /tmp/guider.conf | ||
|
||
- {2:1} {3:1} and report in JSON format with contents of specific files or directories every interval | ||
# {0:1} {1:1} -j -Q -q TEXTREPORT, RECFILE:/tmp/setting1, RECFILE:/tmp/setting2 | ||
|
@@ -36685,6 +36685,12 @@ def _getDesc(s, t=0): | |
- {2:1} without socket profiling | ||
# {0:1} {1:1} -q NOSOCKPROF | ||
|
||
- {2:1} without specific file report contents | ||
# {0:1} {1:1} -J -q NOSTORAGEREP, NOGPUMEMREP | ||
|
||
- {2:1} with optimized options | ||
# {0:1} {1:1} -j /tmp/perf.report -i 3 -o /data -q TEXTREPORT, NOSOCKPROF, LIMITREPDIR:100M, LIMITDIRCNT:/data/mini:1, NOPROCRANK, NOSTORAGEREP, NOGPUMEMREP -b 3M -e dC | ||
|
||
See the top COMMAND help for more examples. | ||
""".format( | ||
cmd, | ||
|
@@ -137962,18 +137968,14 @@ def _setDefaultInfo(data, pid, comm, runtime=None): | |
self.reportData["gpumem"] = {"total": total, "procs": procs} | ||
|
||
# remove not-mounted storage status # | ||
if "storage" in self.reportData: | ||
for item in list(self.reportData["storage"]): | ||
try: | ||
if ( | ||
self.reportData["storage"][item]["mount"]["path"] | ||
== "-" | ||
): | ||
self.reportData["storage"].pop(item, None) | ||
except SystemExit: | ||
sys.exit(0) | ||
except: | ||
pass | ||
for item, val in self.reportData["storage"].items(): | ||
try: | ||
if val["mount"]["path"] == "-": | ||
self.reportData["storage"].pop(item, None) | ||
except SystemExit: | ||
sys.exit(0) | ||
except: | ||
pass | ||
|
||
# add task status # | ||
if "task" in self.reportData: | ||
|
@@ -138070,7 +138072,7 @@ def _setDefaultInfo(data, pid, comm, runtime=None): | |
|
||
# make output path # | ||
filePath = os.path.dirname(SysMgr.inputFile) + "/guider" | ||
for event in list(self.reportData["event"]): | ||
for event in self.reportData["event"]: | ||
filePath = "%s_%s" % (filePath, event) | ||
filePath = "%s_%s.out" % (filePath, str(long(SysMgr.uptime))) | ||
|
||
|
@@ -138096,6 +138098,12 @@ def _setDefaultInfo(data, pid, comm, runtime=None): | |
"failed to rename %s to %s" % SysMgr.inputFile, filePath | ||
) | ||
|
||
# remove useless info for file report # | ||
if "NOSTORAGEREP" in SysMgr.environList: | ||
self.reportData.pop("storage") | ||
if "NOGPUMEMREP" in SysMgr.environList: | ||
self.reportData.pop("gpumem") | ||
|
||
# convert dict data to JSON string # | ||
pretty = not SysMgr.streamEnable | ||
jsonStr = UtilMgr.convDict2Str( | ||
|