aboutsummaryrefslogtreecommitdiffstats
path: root/library/python/cores
diff options
context:
space:
mode:
authorarcadia-devtools <arcadia-devtools@yandex-team.ru>2022-03-04 14:18:12 +0300
committerarcadia-devtools <arcadia-devtools@yandex-team.ru>2022-03-04 14:18:12 +0300
commit334dcbe6ee68b8a12e4914f6f1ac6f0332a2752a (patch)
treef7680cb5b5ce23fb271e5d4db72d2e5efa23cd05 /library/python/cores
parentdde32cec87a38e03e73ba702f1e424a234eb68cd (diff)
downloadydb-334dcbe6ee68b8a12e4914f6f1ac6f0332a2752a.tar.gz
intermediate changes
ref:2a778101b5c1b72fe97b6485437fc7bbd1713dce
Diffstat (limited to 'library/python/cores')
-rw-r--r--library/python/cores/__init__.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/library/python/cores/__init__.py b/library/python/cores/__init__.py
index fdb1f82a46..e3eea6ab5d 100644
--- a/library/python/cores/__init__.py
+++ b/library/python/cores/__init__.py
@@ -21,8 +21,7 @@ def _read_file(filename):
return afile.read().strip("\n")
-def recover_core_dump_file(binary_path, cwd, pid):
-
+def recover_core_dump_file(binary_path, cwd, pid, core_pattern=None):
class CoreFilePattern(object):
def __init__(self, path, mask):
self.path = path
@@ -36,7 +35,8 @@ def recover_core_dump_file(binary_path, cwd, pid):
logger.debug("hostname = '%s'", socket.gethostname())
logger.debug("rlimit_core = '%s'", str(resource.getrlimit(resource.RLIMIT_CORE)))
- core_pattern = _read_file("/proc/sys/kernel/core_pattern")
+ if core_pattern is None:
+ core_pattern = _read_file("/proc/sys/kernel/core_pattern")
logger.debug("core_pattern = '%s'", core_pattern)
if core_pattern.startswith("/"):
default_pattern = CoreFilePattern(os.path.dirname(core_pattern), '*')