Skip to content
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

Add configuration file for heaptrace options #36

Open
Bojun-Seo opened this issue Nov 27, 2023 · 0 comments
Open

Add configuration file for heaptrace options #36

Bojun-Seo opened this issue Nov 27, 2023 · 0 comments

Comments

@Bojun-Seo
Copy link
Collaborator

The design of option delivering via environmental variable is good if the number of options to deliver is small. But now, it would be better to use configuration file on delivering options, as heaptrace will add ignore option #28 and signal option #33, and something unknown options in the future.
It could be possible to include the contents of ignore.txt in this configuration file for ignore option implementation.

So I suggest configure file format, default name and location. like followings:

  • File format: JSON
  • Default location: current location
  • Default name: .heaptrace.config

Setting configuration file option should be given or delivered via environmental variable. The usage will be:

$ heaptrace --config="/home/name/my_config" a.out

and

$ LD_PRELOAD=/usr/lib/libheaptrace.so HEAPTRACE_CONFIG=/home/name/my_config a.out

Configuration file example:

$ cat .heaptrace.config
{
  "num_top_backtrace": 20,
  "sort_keys": ["size", "count"],
  "out_file": "/tmp/my.log",
  "flame_graph": false,
  "ignore": ["libfoo", "bar", "fac", "baz"],
  "signals": {
    "size": 40,
    "count": 41,
    "slope": 42,
    "r_square": 43
  }
}

I think this change could help users to set options more conveniently. User only need to set configuration file and locate it on the default location or give the location with --config option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant