-
Notifications
You must be signed in to change notification settings - Fork 70
profilers/python_ebpf.py: specifying newly TMPDIR on each instance of PyPerf #921
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
e6c443b
4a27c69
a8b61ca
b120c6e
a3a312f
9ed9433
35ebabd
14e0252
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -127,7 +127,11 @@ def wrapper() -> Any: | |
|
|
||
|
|
||
| def start_process( | ||
| cmd: Union[str, List[str]], via_staticx: bool = False, term_on_parent_death: bool = True, **kwargs: Any | ||
| cmd: Union[str, List[str]], | ||
| via_staticx: bool = False, | ||
| term_on_parent_death: bool = True, | ||
| tmpdir: Optional[Path] = None, | ||
| **kwargs: Any, | ||
| ) -> Popen: | ||
| if isinstance(cmd, str): | ||
| cmd = [cmd] | ||
|
|
@@ -147,9 +151,13 @@ def start_process( | |
| cmd = [f"{staticx_dir}/.staticx.interp", "--library-path", staticx_dir] + cmd | ||
| else: | ||
| env = env if env is not None else os.environ.copy() | ||
roi-granulate marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| # ensure `TMPDIR` env is propagated to the child processes (used by staticx) | ||
| if "TMPDIR" not in env and "TMPDIR" in os.environ: | ||
| if tmpdir is not None: | ||
| tmpdir.mkdir(exist_ok=True) | ||
| env["TMPDIR"] = tmpdir.as_posix() | ||
| elif "TMPDIR" not in env and "TMPDIR" in os.environ: | ||
| # ensure `TMPDIR` env is propagated to the child processes (used by staticx) | ||
|
Comment on lines
-150
to
+158
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I’m not sure this is the right approach
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there a practical difference? Doesn't the current flow always create the tmpdir passed to this function under $TMPDIR?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @d3dave current approach:
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, but the tmpdir arg, whenever it is passed it is always
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. there’s no practical differences… I raised this to discuss what’s the better approach |
||
| env["TMPDIR"] = os.environ["TMPDIR"] | ||
|
|
||
| # explicitly remove our directory from LD_LIBRARY_PATH | ||
| env["LD_LIBRARY_PATH"] = "" | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.