We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 61dca1f commit 07f2b60Copy full SHA for 07f2b60
gprofiler/utils.py
@@ -487,7 +487,7 @@ def random_prefix() -> str:
487
488
489
def process_comm(process: Process) -> str:
490
- comm = Path(f"/proc/{process.pid}/comm").read_text()
491
- # the kernel always adds \n
492
- assert comm.endswith('\n'), f"unexpected comm: {comm!r}"
493
- return comm[:-1]
+ status = Path(f"/proc/{process.pid}/status").read_text()
+ name_line = status.splitlines()[0]
+ assert name_line.startswith("Name:\t")
+ return name_line.split("\t", 1)[1]
0 commit comments