Granulate / gprofiler

gProfiler is a system-wide profiler, combining multiple sampling profilers to produce unified visualization of what your CPU is spending time on.
https://profiler.granulate.io
Apache License 2.0
743 stars 54 forks source link

Gracefully handle various errors as NoSuchProcess #803

Closed mpozniak95 closed 1 year ago

mpozniak95 commented 1 year ago

Description

This PR converts CalledProcessError during java profiling and FileNotFoundError during ruby profiling to NoSuchProcess exception.

Related Issue

https://github.com/Granulate/gprofiler/issues/797

mpozniak95 commented 1 year ago

Third point from https://github.com/Granulate/gprofiler/issues/797.

Traceback (most recent call last):
File gprofiler/metadata/application_metadata.py, line 52, in get_metadata
File gprofiler/profilers/java.py, line 316, in make_application_metadata
File granulate_utils/linux/process.py, line 75, in get_mapped_dso_elf_id
File granulate_utils/linux/elf.py, line 42, in inner
File granulate_utils/linux/elf.py, line 28, in inner
File granulate_utils/linux/elf.py, line 98, in get_elf_id
File contextlib.py, line 135, in __enter__
File granulate_utils/linux/elf.py, line 62, in open_elf
FileNotFoundError: [Errno 2] No such file or directory: '/proc/12460/root//usr/lib/jvm/java-1.8.0-amazon-corretto.x86_64/jre/lib/amd64/server/libjvm.so'

Will be resolved in separate PR to granulate-utils

mpozniak95 commented 1 year ago

Merged master and build-executable passed.