Skip to content

Commit 117ef50

Browse files
committed
print ldd
1 parent 8e923b0 commit 117ef50

File tree

1 file changed

+8
-17
lines changed

1 file changed

+8
-17
lines changed

ddtrace/internal/core/crashtracking.py

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import os
21
from pathlib import Path
3-
import sys
2+
import subprocess
43
from typing import Callable
54

65
from ddtrace import config
@@ -31,23 +30,15 @@ def add_tag(key: str, value: str) -> None:
3130

3231
def start() -> bool:
3332
if not is_available:
34-
native_dir = Path(__file__).parent.parent / "native"
35-
for f in native_dir.iterdir():
36-
if f.is_file():
37-
print(f.name)
38-
39-
# also print the contents of the profiling directory
40-
# ddtrace/internal/datadog/profiling
33+
print(failure_msg)
34+
# Let's check whether crashtracker.so is pointing to the right _native.so
35+
# using ldd
4136
crashtracker_dir = Path(__file__).parent.parent / "datadog" / "profiling" / "crashtracker"
4237
for f in crashtracker_dir.iterdir():
43-
if f.is_file():
44-
print(f.name)
45-
46-
print(failure_msg)
47-
for k, v in os.environ.items():
48-
print(k, v)
49-
print(sys.version)
50-
38+
if f.is_file() and f.name.endswith(".so"):
39+
subprocess.run(["ldd", f.name], cwd=crashtracker_dir, check=True)
40+
# i'd also want to know when it was created
41+
print(f.stat().st_ctime)
5142
return False
5243

5344
import platform

0 commit comments

Comments
 (0)