summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorGiampaolo Rodola <g.rodola@gmail.com>2020-12-14 20:27:47 +0100
committerGitHub <noreply@github.com>2020-12-14 20:27:47 +0100
commitb6699b41e2c4873deac532e925561686bdb827d5 (patch)
tree919b2d0f72053ee430a122d914658ae49879b568 /scripts
parent6ea12c3c0a93b1370a1db2670cda60eadbf618dd (diff)
downloadpsutil-b6699b41e2c4873deac532e925561686bdb827d5.tar.gz
[Windows] #1877: turn OpenProcess -> ERROR_SUCCESS into AD or NSP (#1887)
Signed-off-by: Giampaolo Rodola <g.rodola@gmail.com>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/procsmem.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/scripts/procsmem.py b/scripts/procsmem.py
index 259d79d4..1074c4c2 100755
--- a/scripts/procsmem.py
+++ b/scripts/procsmem.py
@@ -80,18 +80,19 @@ def main():
procs.append(p)
procs.sort(key=lambda p: p._uss)
- templ = "%-7s %-7s %-30s %7s %7s %7s %7s"
- print(templ % ("PID", "User", "Cmdline", "USS", "PSS", "Swap", "RSS"))
+ templ = "%-7s %-7s %7s %7s %7s %7s %7s"
+ print(templ % ("PID", "User", "USS", "PSS", "Swap", "RSS", "Cmdline"))
print("=" * 78)
for p in procs[:86]:
+ cmd = " ".join(p._info["cmdline"])[:50] if p._info["cmdline"] else ""
line = templ % (
p.pid,
p._info["username"][:7] if p._info["username"] else "",
- " ".join(p._info["cmdline"])[:30],
convert_bytes(p._uss),
convert_bytes(p._pss) if p._pss != "" else "",
convert_bytes(p._swap) if p._swap != "" else "",
convert_bytes(p._rss),
+ cmd,
)
print(line)
if ad_pids: