-
Notifications
You must be signed in to change notification settings - Fork 5
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
Configure stack size #284
Configure stack size #284
Conversation
fb7350d
to
6d3d342
Compare
@@ -55,11 +58,34 @@ static void display_system_config(void) { | |||
} | |||
} | |||
|
|||
int pevent_compute_min_mmap_order(int min_buffer_size_order, |
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.
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.
ok for me
0e9bced
to
e7249b6
Compare
aa5ba50
to
f136a1c
Compare
I find that the naming |
I thought the same, though I wanted the consistency with the perf_event_open API
I guess we can forget about consistency and make it more user friendly ? |
./ddprof --config ${CONFIG_DEEP_STACK} ./test/deep_stacks | tee ./log_ddprof.txt | ||
|
||
# Check for truncated stack traces | ||
truncated_input=$(awk -F': ' '/datadog.profiling.native.unwind.stack.truncated_input/ { print $NF }' ./log_ddprof.txt) |
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.
Why not test that the stacks are correct ?
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 would need to open source prof-correctness to avoid duplicating some of the logics for this.
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.
Yes, but in its current state this test does not test much (and is quite complicated).
In release mode, everything is probably inlined in main
function.
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.
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 add a "no inline" attribute to make sure. Thanks for mentioning this.
Various adjustments based on pull request #284 comments - Adjust option naming - Add a template configuration element to properly account for default settings - other minor fixes
The failures in CI are related to mmap failures.. |
I adjusted the naming, we are now inconsistent, though the setting is easier to understand. |
- Ensure we take into account values from the template configuration when parsing a new configuration
I reverted the increase in buffer size :-( |
- Removal of useless volatile keyword
include/ddprof_defs.hpp
Outdated
// considering sample size, we adjust the size of ring buffers. | ||
// Following is considered as a minimum number of samples to be fit in the | ||
// ring buffer. | ||
constexpr auto k_min_number_samples_per_ring_buffer = 7; |
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.
My point was default config seems wasteful:
- event size is 32992 bytes (32768 + 224)
- hence buffer size order to accommodate 7 samples will be 6 , ie. 266240 bytes with a usable size of 262144 bytes
- meaning that with 7 samples in the buffer, 31200 bytes will remain free
What about decreasing default sample stack size to something like 32000 bytes, then we could fit 8 samples in the buffer and 4352 bytes would remain for other events ?
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 pushed a change on default sample sizes.
- More tweaking on default sizes
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.
LGTM !
What does this PR do?
Add a parameter to configure the size of samples.
Motivation
Ensure we can unwind deeper stacks.
Discussions in #276
Additional Notes
For now the maximum value allowed by linux is the closest value to USHORT_MAX, 8 byte aligned:
65528
If this is not enough we should consider a different kernel API.
How to test the change?
A test with deep stacks was added. I will run this in CI.
https://github.com/DataDog/ddprof-build/pull/101