flamegraph
flamegraph copied to clipboard
problem with envionment variables
My program work with envionment variables, but it's seems like it cann't find them when I run flamegraph.
so how can i pass all the envionment variables to my program? And I'm working with MacOS.
I'm experiencing the same issue.
This happens with --root only, since sudo doesn't pass through environment variables by default. I'm not sure if doing that by default is a good idea though (it's not the default for a reason).
This happens with
--rootonly, sincesudodoesn't pass through environment variables by default. I'm not sure if doing that by default is a good idea though (it's not the default for a reason).
root is required to run the command.
Is that possible to add an option to allow passing envionment variables explicitly.
Are maintainers open to a PR?
Do people prefer:
- an extra flag to pass?
- always passing with
--root?
Yes, I'm open to reviewing a PR. I think it should be explicit, would be nice if you can research what other existing tools use for the name of such an option. Looks like sudo calls it --preserve-env, so that might be a reasonable option?
The question I have is: how to pass through environment variables at all?
I am using env-logger and cannot get my logs without hardcoding a logging level.
The question I have is: how to pass through environment variables at all? I am using
env-loggerand cannot get my logs without hardcoding a logging level.
Okay. Running with sudo --preserve-env=… without --root works.