-
Notifications
You must be signed in to change notification settings - Fork 0
ESD-1836: added additional massif options #59
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
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 |
|---|---|---|
|
|
@@ -92,7 +92,8 @@ | |
| # | ||
| ### MEMCHECK SPECIFIC OPTIONS: | ||
| # | ||
| # LEAK_CHECK searches for memory leaks when the application finishes. | ||
| # LEAK_CHECK=<no|summary|yes|full> [default: summary], searches for memory leaks | ||
| # when the application finishes. | ||
| # | ||
| # * If set to `summary`, it says how many leaks occurred. | ||
| # * If set to `full` or `yes`, each individual leak will be shown in detail | ||
|
|
@@ -109,22 +110,36 @@ | |
| # | ||
| ### MASSIF SPECIFIC OPTIONS: | ||
| # | ||
| # DEPTH=<number> [default: 30], maximum depth of the allocation trees recorded | ||
| # for detailed snapshots. | ||
| # | ||
| # DETAILED_FREQUENCY=<number> [default: 10], frequency of detailed snapshots. | ||
| # With value of `1`, every snapshot is detailed. | ||
| # | ||
|
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. Same comment as above, can I use decimal numbers as argument?
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. ✔️, marked it as
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. If you prefer
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. No, I prefer float :P looks good 👍 |
||
| # MAX_SNAPSHOTS=<number> [default: 100], the maximum number of snapshots | ||
| # recorded. | ||
| # | ||
| # PEAK_INACCURACY=<float> [default: 1.0], Massif does not necessarily record | ||
| # the actual global memory allocation peak; by default it records a peak only | ||
| # when the global memory allocation size exceeds the previous peak by at least | ||
| # 1.0%. Setting this value to `0.0` gives the true value of the peak. | ||
| # | ||
| # STACKS specifies whether stack profiling should be done. This option slows | ||
| # Massif down greatly. | ||
| # | ||
| # PAGES_AS_HEAP tells Massif to profile memory at the page level rather than at | ||
| # the malloc'd block level. | ||
| # | ||
| # TIME_UNIT offers three settings: | ||
| # TIME_UNIT=<i|ms|B>, offers three settings: | ||
| # | ||
| # * Instructions executed `i`, which is good for most cases. | ||
| # * Time `ms`, which is sometimes useful. | ||
| # * Bytes allocated/deallocated on the heap and/or stack `B`, which is useful | ||
| # for very short-run programs and for testing purposes. | ||
| # | ||
| # THRESHOLD the significance threshold for heap allocations, as a percentage of | ||
| # total memory size. Allocation tree entries that account for less than this | ||
| # will be aggregated. | ||
| # THRESHOLD=<float> [default: 1.0], the significance threshold for heap | ||
| # allocations, as a percentage of total memory size. Allocation tree entries | ||
| # that account for less than this will be aggregated. | ||
| # | ||
| ### NOTES | ||
| # | ||
|
|
@@ -284,7 +299,7 @@ endfunction() | |
|
|
||
| function(swift_add_valgrind_massif target) | ||
| set(argOption STACKS PAGES_AS_HEAP XTREE_MEMORY) | ||
| set(argSingle THRESHOLD TIME_UNIT) | ||
| set(argSingle DEPTH DETAILED_FREQUENCY MAX_SNAPSHOTS PEAK_INACCURACY THRESHOLD TIME_UNIT) | ||
| set(argMulti "") | ||
|
|
||
| _valgrind_arguments_setup(${target} massif "${argOption}" "${argSingle}" "${argMulti}" "${ARGN}") | ||
|
|
@@ -309,6 +324,22 @@ function(swift_add_valgrind_massif target) | |
| list(APPEND valgrind_tool_options --xtree-memory-file=${target}.kcg.%p) | ||
| endif() | ||
|
|
||
| if (x_DEPTH) | ||
| list(APPEND valgrind_tool_options "--depth=${x_DEPTH}") | ||
| endif() | ||
|
|
||
| if (x_DETAILED_FREQUENCY) | ||
| list(APPEND valgrind_tool_options "--detailed-freq=${x_DETAILED_FREQUENCY}") | ||
| endif() | ||
|
|
||
| if (x_MAX_SNAPSHOTS) | ||
| list(APPEND valgrind_tool_options "--max-snapshots=${x_MAX_SNAPSHOTS}") | ||
| endif() | ||
|
|
||
| if (x_PEAK_INACCURACY) | ||
| list(APPEND valgrind_tool_options "--peak-inaccuracy=${x_PEAK_INACCURACY}") | ||
| endif() | ||
|
|
||
| if (x_THRESHOLD) | ||
| list(APPEND valgrind_tool_options "--threshold=${x_THRESHOLD}") | ||
| endif() | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you also add a unit or range to use as argument to depth?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did mention that the parameter expects a number and specified the default value. I've made this change to all the other single variable parameters as well.
There is no upper range within Valgrinds documentation (in my implementation it caps at 200), so I didn't want to specify the range as that isn't set in stone from the looks of things.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Super! 👍