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

[crashtracker] Enable client to configure which signals to trap #856

Open
wants to merge 22 commits into
base: main
Choose a base branch
from

Conversation

danielsn
Copy link
Contributor

@danielsn danielsn commented Feb 5, 2025

What does this PR do?

Instead of hardcoding the signals to trap, allow the client to specify them

Motivation

We wanted to catch sigabort and sigill in addition to sigsegv and sigbus, and I figured lets just make it generic.

Additional Notes

Anything else we should know when reviewing?

How to test the change?

@danielsn danielsn requested review from a team as code owners February 5, 2025 17:43
SigHandler::Handler(f) => f(signum),
SigHandler::SigAction(f) => f(signum, sig_info, ucontext),
};
eprintln!("Unexpected signal number {signum}, can't chain the handlers");
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What should we do here? abort?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this could happen if the user code changes the sigaction while we're in the middle of handling a signal? I'm not sure how it might arise.

unsafe { create_alt_stack()? };
}
let mut old_handlers = HashMap::new();
// TODO: if this fails, we end in a situation where handlers have been registered with no chain
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What to do here?

let boxed_ptr = Box::into_raw(Box::new(old_handlers));

let res = OLD_HANDLERS.compare_exchange(ptr::null_mut(), boxed_ptr, SeqCst, SeqCst);
anyhow::ensure!(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This leaks the old_handlers, if we care?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so--small one-time leak, right?

@@ -674,9 +665,11 @@ pub fn restore_old_handlers(inside_signal_handler: bool) -> anyhow::Result<()> {
anyhow::ensure!(!prev.is_null(), "No crashtracking previous signal handlers");
// Safety: The only nonnull pointer stored here comes from Box::into_raw()
let prev = unsafe { Box::from_raw(prev) };
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could flip this around, and only rehydrate into a box when we are ready to drop it

@pr-commenter
Copy link

pr-commenter bot commented Feb 5, 2025

Benchmarks

Comparison

Benchmark execution time: 2025-02-12 17:57:05

Comparing candidate commit a6154dd in PR branch dsn/crashtracker-many-signals with baseline commit 787d15e in branch main.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 52 metrics, 2 unstable metrics.

Candidate

Candidate benchmark details

Group 1

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz a6154dd 1739382360 dsn/crashtracker-many-signals
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
tags/replace_trace_tags execution_time 2.735µs 2.758µs ± 0.009µs 2.758µs ± 0.007µs 2.764µs 2.777µs 2.780µs 2.784µs 0.96% 0.300 0.117 0.33% 0.001µs 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
tags/replace_trace_tags execution_time [2.757µs; 2.760µs] or [-0.046%; +0.046%] None None None

Group 2

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz a6154dd 1739382360 dsn/crashtracker-many-signals
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
ip_address/quantize_peer_ip_address_benchmark execution_time 5.422µs 5.494µs ± 0.037µs 5.483µs ± 0.024µs 5.535µs 5.552µs 5.557µs 5.560µs 1.40% 0.408 -1.211 0.67% 0.003µs 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
ip_address/quantize_peer_ip_address_benchmark execution_time [5.489µs; 5.499µs] or [-0.092%; +0.092%] None None None

Group 3

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz a6154dd 1739382360 dsn/crashtracker-many-signals
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
sql/obfuscate_sql_string execution_time 77.570µs 77.780µs ± 0.174µs 77.757µs ± 0.045µs 77.807µs 77.913µs 78.252µs 79.880µs 2.73% 9.053 104.714 0.22% 0.012µs 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
sql/obfuscate_sql_string execution_time [77.755µs; 77.804µs] or [-0.031%; +0.031%] None None None

Group 4

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz a6154dd 1739382360 dsn/crashtracker-many-signals
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
redis/obfuscate_redis_string execution_time 39.716µs 40.213µs ± 0.805µs 39.848µs ± 0.090µs 40.003µs 41.885µs 41.927µs 43.566µs 9.33% 1.780 1.700 2.00% 0.057µs 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
redis/obfuscate_redis_string execution_time [40.102µs; 40.325µs] or [-0.277%; +0.277%] None None None

Group 5

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz a6154dd 1739382360 dsn/crashtracker-many-signals
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
write only interface execution_time 1.428µs 3.355µs ± 1.468µs 3.160µs ± 0.024µs 3.183µs 3.761µs 14.445µs 15.516µs 390.94% 7.441 56.113 43.65% 0.104µs 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
write only interface execution_time [3.152µs; 3.559µs] or [-6.065%; +6.065%] None None None

Group 6

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz a6154dd 1739382360 dsn/crashtracker-many-signals
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
benching string interning on wordpress profile execution_time 138.041µs 139.036µs ± 1.357µs 138.887µs ± 0.160µs 139.034µs 139.551µs 141.072µs 157.239µs 13.21% 12.217 160.611 0.97% 0.096µs 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
benching string interning on wordpress profile execution_time [138.848µs; 139.224µs] or [-0.135%; +0.135%] None None None

Group 7

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz a6154dd 1739382360 dsn/crashtracker-many-signals
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
credit_card/is_card_number/ execution_time 4.276µs 4.290µs ± 0.003µs 4.290µs ± 0.001µs 4.291µs 4.295µs 4.296µs 4.319µs 0.68% 2.878 29.943 0.08% 0.000µs 1 200
credit_card/is_card_number/ throughput 231515714.812op/s 233083170.519op/s ± 179318.441op/s 233084185.247op/s ± 70069.752op/s 233156330.569op/s 233356098.988op/s 233432353.055op/s 233880904.954op/s 0.34% -2.823 29.463 0.08% 12679.729op/s 1 200
credit_card/is_card_number/ 3782-8224-6310-005 execution_time 89.938µs 90.262µs ± 0.340µs 90.223µs ± 0.082µs 90.319µs 90.499µs 90.599µs 94.681µs 4.94% 11.033 140.502 0.38% 0.024µs 1 200
credit_card/is_card_number/ 3782-8224-6310-005 throughput 10561793.198op/s 11078974.313op/s ± 40132.276op/s 11083680.942op/s ± 10067.615op/s 11091922.585op/s 11104206.551op/s 11114712.983op/s 11118795.211op/s 0.32% -10.798 136.406 0.36% 2837.780op/s 1 200
credit_card/is_card_number/ 378282246310005 execution_time 82.407µs 82.654µs ± 0.336µs 82.638µs ± 0.045µs 82.681µs 82.760µs 82.810µs 87.260µs 5.59% 12.907 174.370 0.41% 0.024µs 1 200
credit_card/is_card_number/ 378282246310005 throughput 11460061.024op/s 12098765.081op/s ± 46801.853op/s 12101012.250op/s ± 6636.774op/s 12108022.776op/s 12122406.577op/s 12132821.612op/s 12134931.614op/s 0.28% -12.786 172.190 0.39% 3309.391op/s 1 200
credit_card/is_card_number/37828224631 execution_time 4.275µs 4.291µs ± 0.005µs 4.291µs ± 0.001µs 4.292µs 4.295µs 4.297µs 4.351µs 1.40% 8.451 101.584 0.12% 0.000µs 1 200
credit_card/is_card_number/37828224631 throughput 229836822.758op/s 233044262.313op/s ± 268994.312op/s 233051432.083op/s ± 67042.559op/s 233125614.677op/s 233282905.465op/s 233415150.896op/s 233937684.059op/s 0.38% -8.339 99.959 0.12% 19020.770op/s 1 200
credit_card/is_card_number/378282246310005 execution_time 78.977µs 79.390µs ± 0.184µs 79.354µs ± 0.126µs 79.514µs 79.731µs 79.818µs 79.949µs 0.75% 0.467 -0.166 0.23% 0.013µs 1 200
credit_card/is_card_number/378282246310005 throughput 12507924.167op/s 12596040.959op/s ± 29222.165op/s 12601691.150op/s ± 20036.523op/s 12617273.049op/s 12639818.398op/s 12649302.339op/s 12661842.973op/s 0.48% -0.456 -0.181 0.23% 2066.319op/s 1 200
credit_card/is_card_number/37828224631000521389798 execution_time 59.372µs 59.476µs ± 0.032µs 59.479µs ± 0.017µs 59.494µs 59.525µs 59.534µs 59.551µs 0.12% -0.550 0.547 0.05% 0.002µs 1 200
credit_card/is_card_number/37828224631000521389798 throughput 16792401.011op/s 16813421.504op/s ± 9053.790op/s 16812532.798op/s ± 4934.640op/s 16817783.742op/s 16829396.726op/s 16838136.458op/s 16842946.204op/s 0.18% 0.553 0.553 0.05% 640.200op/s 1 200
credit_card/is_card_number/x371413321323331 execution_time 7.237µs 7.248µs ± 0.004µs 7.248µs ± 0.002µs 7.251µs 7.255µs 7.260µs 7.262µs 0.20% 0.153 1.814 0.05% 0.000µs 1 200
credit_card/is_card_number/x371413321323331 throughput 137693686.625op/s 137961522.007op/s ± 72476.700op/s 137963301.762op/s ± 38171.250op/s 138000244.951op/s 138092483.989op/s 138156341.474op/s 138178028.572op/s 0.16% -0.147 1.809 0.05% 5124.877op/s 1 200
credit_card/is_card_number_no_luhn/ execution_time 4.276µs 4.291µs ± 0.003µs 4.291µs ± 0.001µs 4.292µs 4.295µs 4.298µs 4.298µs 0.18% -0.626 4.855 0.06% 0.000µs 1 200
credit_card/is_card_number_no_luhn/ throughput 232644342.790op/s 233061740.925op/s ± 146202.456op/s 233068197.853op/s ± 67576.834op/s 233134468.931op/s 233270739.043op/s 233462449.764op/s 233873137.819op/s 0.35% 0.638 4.905 0.06% 10338.075op/s 1 200
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005 execution_time 71.405µs 71.531µs ± 0.040µs 71.532µs ± 0.024µs 71.549µs 71.603µs 71.635µs 71.673µs 0.20% 0.256 1.357 0.06% 0.003µs 1 200
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005 throughput 13952334.639op/s 13979886.770op/s ± 7825.536op/s 13979659.595op/s ± 4666.448op/s 13984658.829op/s 13992590.924op/s 13997548.058op/s 14004690.171op/s 0.18% -0.251 1.353 0.06% 553.349op/s 1 200
credit_card/is_card_number_no_luhn/ 378282246310005 execution_time 63.782µs 63.900µs ± 0.038µs 63.894µs ± 0.024µs 63.923µs 63.972µs 63.999µs 64.007µs 0.18% 0.338 0.555 0.06% 0.003µs 1 200
credit_card/is_card_number_no_luhn/ 378282246310005 throughput 15623238.343op/s 15649371.875op/s ± 9353.981op/s 15651002.190op/s ± 5795.615op/s 15655404.407op/s 15661447.390op/s 15673470.019op/s 15678445.273op/s 0.18% -0.334 0.555 0.06% 661.426op/s 1 200
credit_card/is_card_number_no_luhn/37828224631 execution_time 4.272µs 4.290µs ± 0.003µs 4.290µs ± 0.001µs 4.291µs 4.294µs 4.296µs 4.304µs 0.33% -0.570 11.285 0.06% 0.000µs 1 200
credit_card/is_card_number_no_luhn/37828224631 throughput 232339506.328op/s 233101567.259op/s ± 148193.941op/s 233103764.626op/s ± 71622.052op/s 233166504.926op/s 233288868.342op/s 233460954.917op/s 234059433.022op/s 0.41% 0.595 11.356 0.06% 10478.894op/s 1 200
credit_card/is_card_number_no_luhn/378282246310005 execution_time 60.591µs 60.688µs ± 0.067µs 60.682µs ± 0.018µs 60.703µs 60.737µs 60.762µs 61.528µs 1.39% 9.815 119.929 0.11% 0.005µs 1 200
credit_card/is_card_number_no_luhn/378282246310005 throughput 16252780.580op/s 16477607.080op/s ± 18061.087op/s 16479464.117op/s ± 4885.873op/s 16484068.148op/s 16490540.119op/s 16499432.255op/s 16504201.970op/s 0.15% -9.730 118.520 0.11% 1277.112op/s 1 200
credit_card/is_card_number_no_luhn/37828224631000521389798 execution_time 59.366µs 59.476µs ± 0.033µs 59.475µs ± 0.019µs 59.496µs 59.524µs 59.543µs 59.644µs 0.28% 0.147 3.329 0.06% 0.002µs 1 200
credit_card/is_card_number_no_luhn/37828224631000521389798 throughput 16766016.059op/s 16813466.155op/s ± 9454.339op/s 16813761.377op/s ± 5305.254op/s 16818412.201op/s 16830183.267op/s 16841380.275op/s 16844604.833op/s 0.18% -0.138 3.306 0.06% 668.523op/s 1 200
credit_card/is_card_number_no_luhn/x371413321323331 execution_time 7.235µs 7.247µs ± 0.004µs 7.247µs ± 0.002µs 7.249µs 7.253µs 7.258µs 7.264µs 0.23% -0.091 1.570 0.06% 0.000µs 1 200
credit_card/is_card_number_no_luhn/x371413321323331 throughput 137668672.805op/s 137989333.443op/s ± 81504.154op/s 137983524.768op/s ± 40872.624op/s 138024803.057op/s 138144056.626op/s 138204345.491op/s 138212017.234op/s 0.17% 0.097 1.563 0.06% 5763.214op/s 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
credit_card/is_card_number/ execution_time [4.290µs; 4.291µs] or [-0.011%; +0.011%] None None None
credit_card/is_card_number/ throughput [233058318.708op/s; 233108022.331op/s] or [-0.011%; +0.011%] None None None
credit_card/is_card_number/ 3782-8224-6310-005 execution_time [90.215µs; 90.309µs] or [-0.052%; +0.052%] None None None
credit_card/is_card_number/ 3782-8224-6310-005 throughput [11073412.366op/s; 11084536.261op/s] or [-0.050%; +0.050%] None None None
credit_card/is_card_number/ 378282246310005 execution_time [82.608µs; 82.701µs] or [-0.056%; +0.056%] None None None
credit_card/is_card_number/ 378282246310005 throughput [12092278.795op/s; 12105251.368op/s] or [-0.054%; +0.054%] None None None
credit_card/is_card_number/37828224631 execution_time [4.290µs; 4.292µs] or [-0.016%; +0.016%] None None None
credit_card/is_card_number/37828224631 throughput [233006982.288op/s; 233081542.337op/s] or [-0.016%; +0.016%] None None None
credit_card/is_card_number/378282246310005 execution_time [79.365µs; 79.416µs] or [-0.032%; +0.032%] None None None
credit_card/is_card_number/378282246310005 throughput [12591991.048op/s; 12600090.870op/s] or [-0.032%; +0.032%] None None None
credit_card/is_card_number/37828224631000521389798 execution_time [59.472µs; 59.481µs] or [-0.007%; +0.007%] None None None
credit_card/is_card_number/37828224631000521389798 throughput [16812166.736op/s; 16814676.272op/s] or [-0.007%; +0.007%] None None None
credit_card/is_card_number/x371413321323331 execution_time [7.248µs; 7.249µs] or [-0.007%; +0.007%] None None None
credit_card/is_card_number/x371413321323331 throughput [137951477.434op/s; 137971566.581op/s] or [-0.007%; +0.007%] None None None
credit_card/is_card_number_no_luhn/ execution_time [4.290µs; 4.291µs] or [-0.009%; +0.009%] None None None
credit_card/is_card_number_no_luhn/ throughput [233041478.671op/s; 233082003.180op/s] or [-0.009%; +0.009%] None None None
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005 execution_time [71.526µs; 71.537µs] or [-0.008%; +0.008%] None None None
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005 throughput [13978802.226op/s; 13980971.314op/s] or [-0.008%; +0.008%] None None None
credit_card/is_card_number_no_luhn/ 378282246310005 execution_time [63.895µs; 63.906µs] or [-0.008%; +0.008%] None None None
credit_card/is_card_number_no_luhn/ 378282246310005 throughput [15648075.503op/s; 15650668.247op/s] or [-0.008%; +0.008%] None None None
credit_card/is_card_number_no_luhn/37828224631 execution_time [4.290µs; 4.290µs] or [-0.009%; +0.009%] None None None
credit_card/is_card_number_no_luhn/37828224631 throughput [233081029.004op/s; 233122105.514op/s] or [-0.009%; +0.009%] None None None
credit_card/is_card_number_no_luhn/378282246310005 execution_time [60.679µs; 60.698µs] or [-0.015%; +0.015%] None None None
credit_card/is_card_number_no_luhn/378282246310005 throughput [16475103.987op/s; 16480110.173op/s] or [-0.015%; +0.015%] None None None
credit_card/is_card_number_no_luhn/37828224631000521389798 execution_time [59.472µs; 59.481µs] or [-0.008%; +0.008%] None None None
credit_card/is_card_number_no_luhn/37828224631000521389798 throughput [16812155.874op/s; 16814776.435op/s] or [-0.008%; +0.008%] None None None
credit_card/is_card_number_no_luhn/x371413321323331 execution_time [7.246µs; 7.248µs] or [-0.008%; +0.008%] None None None
credit_card/is_card_number_no_luhn/x371413321323331 throughput [137978037.752op/s; 138000629.135op/s] or [-0.008%; +0.008%] None None None

Group 8

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz a6154dd 1739382360 dsn/crashtracker-many-signals
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
benching deserializing traces from msgpack to their internal representation execution_time 58.015ms 58.242ms ± 0.154ms 58.195ms ± 0.044ms 58.250ms 58.582ms 58.779ms 58.938ms 1.28% 2.160 4.762 0.26% 0.011ms 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
benching deserializing traces from msgpack to their internal representation execution_time [58.221ms; 58.263ms] or [-0.037%; +0.037%] None None None

Group 9

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz a6154dd 1739382360 dsn/crashtracker-many-signals
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
normalization/normalize_name/normalize_name/Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Lo... execution_time 311.135µs 313.381µs ± 0.936µs 313.297µs ± 0.647µs 313.988µs 314.899µs 315.616µs 316.493µs 1.02% 0.276 0.019 0.30% 0.066µs 1 200
normalization/normalize_name/normalize_name/Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Lo... throughput 3159625.623op/s 3191033.620op/s ± 9522.379op/s 3191854.781op/s ± 6577.427op/s 3197909.158op/s 3206190.754op/s 3211319.728op/s 3214038.525op/s 0.70% -0.259 0.002 0.30% 673.334op/s 1 200
normalization/normalize_name/normalize_name/bad-name execution_time 28.056µs 28.346µs ± 0.113µs 28.352µs ± 0.068µs 28.413µs 28.535µs 28.635µs 28.734µs 1.35% 0.124 0.415 0.40% 0.008µs 1 200
normalization/normalize_name/normalize_name/bad-name throughput 34801699.914op/s 35278954.341op/s ± 140560.159op/s 35271040.328op/s ± 84722.871op/s 35374360.974op/s 35519683.760op/s 35582715.771op/s 35642745.632op/s 1.05% -0.096 0.388 0.40% 9939.104op/s 1 200
normalization/normalize_name/normalize_name/good execution_time 16.470µs 16.753µs ± 0.105µs 16.758µs ± 0.065µs 16.813µs 16.925µs 16.991µs 17.036µs 1.66% 0.023 -0.205 0.63% 0.007µs 1 200
normalization/normalize_name/normalize_name/good throughput 58698327.591op/s 59691944.377op/s ± 375874.323op/s 59674069.273op/s ± 231702.749op/s 59918229.601op/s 60319011.708op/s 60479515.661op/s 60714657.437op/s 1.74% 0.011 -0.210 0.63% 26578.328op/s 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
normalization/normalize_name/normalize_name/Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Lo... execution_time [313.251µs; 313.511µs] or [-0.041%; +0.041%] None None None
normalization/normalize_name/normalize_name/Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Lo... throughput [3189713.910op/s; 3192353.330op/s] or [-0.041%; +0.041%] None None None
normalization/normalize_name/normalize_name/bad-name execution_time [28.330µs; 28.362µs] or [-0.055%; +0.055%] None None None
normalization/normalize_name/normalize_name/bad-name throughput [35259474.055op/s; 35298434.628op/s] or [-0.055%; +0.055%] None None None
normalization/normalize_name/normalize_name/good execution_time [16.739µs; 16.768µs] or [-0.087%; +0.087%] None None None
normalization/normalize_name/normalize_name/good throughput [59639851.810op/s; 59744036.943op/s] or [-0.087%; +0.087%] None None None

Group 10

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz a6154dd 1739382360 dsn/crashtracker-many-signals
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
normalization/normalize_service/normalize_service/A0000000000000000000000000000000000000000000000000... execution_time 619.463µs 620.832µs ± 0.832µs 620.759µs ± 0.342µs 621.070µs 621.622µs 624.966µs 627.540µs 1.09% 4.540 30.426 0.13% 0.059µs 1 200
normalization/normalize_service/normalize_service/A0000000000000000000000000000000000000000000000000... throughput 1593524.935op/s 1610744.948op/s ± 2146.884op/s 1610931.221op/s ± 886.659op/s 1611831.358op/s 1612786.403op/s 1613645.705op/s 1614301.767op/s 0.21% -4.493 29.962 0.13% 151.808op/s 1 200
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰てて execution_time 474.882µs 475.836µs ± 0.309µs 475.850µs ± 0.216µs 476.055µs 476.275µs 476.494µs 476.782µs 0.20% -0.159 0.063 0.06% 0.022µs 1 200
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰てて throughput 2097392.764op/s 2101564.920op/s ± 1365.293op/s 2101504.434op/s ± 953.708op/s 2102490.375op/s 2103735.124op/s 2104661.480op/s 2105785.813op/s 0.20% 0.163 0.064 0.06% 96.541op/s 1 200
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters execution_time 190.187µs 190.781µs ± 0.596µs 190.714µs ± 0.142µs 190.878µs 191.082µs 191.578µs 196.778µs 3.18% 8.103 74.051 0.31% 0.042µs 1 200
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters throughput 5081876.192op/s 5241648.641op/s ± 15970.239op/s 5243456.369op/s ± 3907.965op/s 5247161.664op/s 5252094.828op/s 5256179.866op/s 5257969.464op/s 0.28% -8.006 72.779 0.30% 1129.266op/s 1 200
normalization/normalize_service/normalize_service/[empty string] execution_time 45.237µs 45.421µs ± 0.085µs 45.420µs ± 0.060µs 45.474µs 45.575µs 45.627µs 45.662µs 0.53% 0.244 -0.227 0.19% 0.006µs 1 200
normalization/normalize_service/normalize_service/[empty string] throughput 21900111.026op/s 22016246.835op/s ± 40943.952op/s 22016505.395op/s ± 29299.507op/s 22046090.013op/s 22078128.177op/s 22100445.553op/s 22105734.319op/s 0.41% -0.235 -0.234 0.19% 2895.175op/s 1 200
normalization/normalize_service/normalize_service/test_ASCII execution_time 47.402µs 47.534µs ± 0.106µs 47.521µs ± 0.018µs 47.542µs 47.606µs 47.648µs 48.925µs 2.96% 11.439 147.530 0.22% 0.007µs 1 200
normalization/normalize_service/normalize_service/test_ASCII throughput 20439376.924op/s 21037658.873op/s ± 45708.597op/s 21043547.110op/s ± 7835.158op/s 21050419.522op/s 21061525.287op/s 21078597.794op/s 21095974.217op/s 0.25% -11.313 145.317 0.22% 3232.086op/s 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
normalization/normalize_service/normalize_service/A0000000000000000000000000000000000000000000000000... execution_time [620.716µs; 620.947µs] or [-0.019%; +0.019%] None None None
normalization/normalize_service/normalize_service/A0000000000000000000000000000000000000000000000000... throughput [1610447.410op/s; 1611042.485op/s] or [-0.018%; +0.018%] None None None
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰てて execution_time [475.793µs; 475.879µs] or [-0.009%; +0.009%] None None None
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰てて throughput [2101375.703op/s; 2101754.136op/s] or [-0.009%; +0.009%] None None None
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters execution_time [190.699µs; 190.864µs] or [-0.043%; +0.043%] None None None
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters throughput [5239435.320op/s; 5243861.963op/s] or [-0.042%; +0.042%] None None None
normalization/normalize_service/normalize_service/[empty string] execution_time [45.409µs; 45.433µs] or [-0.026%; +0.026%] None None None
normalization/normalize_service/normalize_service/[empty string] throughput [22010572.397op/s; 22021921.273op/s] or [-0.026%; +0.026%] None None None
normalization/normalize_service/normalize_service/test_ASCII execution_time [47.519µs; 47.549µs] or [-0.031%; +0.031%] None None None
normalization/normalize_service/normalize_service/test_ASCII throughput [21031324.101op/s; 21043993.645op/s] or [-0.030%; +0.030%] None None None

Group 11

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz a6154dd 1739382360 dsn/crashtracker-many-signals
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
normalization/normalize_trace/test_trace execution_time 296.144ns 309.266ns ± 16.824ns 301.674ns ± 3.967ns 312.285ns 344.575ns 364.966ns 368.917ns 22.29% 1.851 2.701 5.43% 1.190ns 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
normalization/normalize_trace/test_trace execution_time [306.935ns; 311.598ns] or [-0.754%; +0.754%] None None None

Group 12

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz a6154dd 1739382360 dsn/crashtracker-many-signals
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
concentrator/add_spans_to_concentrator execution_time 6.249ms 6.263ms ± 0.008ms 6.262ms ± 0.004ms 6.266ms 6.274ms 6.287ms 6.317ms 0.89% 2.848 15.123 0.13% 0.001ms 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
concentrator/add_spans_to_concentrator execution_time [6.262ms; 6.264ms] or [-0.017%; +0.017%] None None None

Group 13

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz a6154dd 1739382360 dsn/crashtracker-many-signals
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
two way interface execution_time 18.364µs 27.760µs ± 13.235µs 18.858µs ± 0.204µs 36.171µs 44.646µs 47.150µs 132.270µs 601.42% 3.712 24.251 47.56% 0.936µs 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
two way interface execution_time [25.926µs; 29.594µs] or [-6.607%; +6.607%] None None None

Baseline

Omitted due to size.

@danielsn danielsn force-pushed the dsn/crashtracker-many-signals branch from 8050f45 to 90442a0 Compare February 6, 2025 02:57
@codecov-commenter
Copy link

codecov-commenter commented Feb 6, 2025

Codecov Report

Attention: Patch coverage is 29.26829% with 145 lines in your changes missing coverage. Please review.

Project coverage is 71.67%. Comparing base (5ada426) to head (a6154dd).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #856      +/-   ##
==========================================
- Coverage   71.90%   71.67%   -0.24%     
==========================================
  Files         324      324              
  Lines       48077    48226     +149     
==========================================
- Hits        34572    34568       -4     
- Misses      13505    13658     +153     
Components Coverage Δ
crashtracker 42.71% <31.41%> (-0.51%) ⬇️
crashtracker-ffi 6.25% <0.00%> (-0.05%) ⬇️
datadog-alloc 98.73% <ø> (ø)
data-pipeline 92.19% <ø> (-0.17%) ⬇️
data-pipeline-ffi 91.45% <ø> (ø)
ddcommon 80.08% <ø> (ø)
ddcommon-ffi 61.05% <ø> (ø)
ddtelemetry 61.74% <ø> (ø)
ddtelemetry-ffi 22.46% <ø> (ø)
dogstatsd 90.01% <ø> (ø)
dogstatsd-client 79.77% <ø> (ø)
ipc 82.68% <ø> (ø)
profiling 80.04% <ø> (ø)
profiling-ffi 70.68% <ø> (ø)
serverless 0.00% <ø> (ø)
sidecar 40.97% <ø> (-0.54%) ⬇️
sidecar-ffi 5.14% <ø> (-4.12%) ⬇️
spawn-worker 54.37% <ø> (ø)
tinybytes 92.79% <ø> (ø)
trace-mini-agent 72.48% <ø> (ø)
trace-normalization 98.23% <ø> (ø)
trace-obfuscation 95.96% <ø> (ø)
trace-protobuf 77.67% <ø> (ø)
trace-utils 93.22% <ø> (-0.35%) ⬇️

@ivoanjo
Copy link
Member

ivoanjo commented Feb 6, 2025

We wanted to catch sigabort and sigill in addition to sigsegv and sigbus, and I figured lets just make it generic.

One thing I strongly recommend is: let's put in some defaults!

In past features "leaving it up to implementer" often meant unintended inconsistency as things get picked semi-randomly; I think in general it's nice to have a pattern of "if you don't want to choose, we pick a reasonable default, don't worry about it".

@danielsn
Copy link
Contributor Author

danielsn commented Feb 7, 2025

We wanted to catch sigabort and sigill in addition to sigsegv and sigbus, and I figured lets just make it generic.

One thing I strongly recommend is: let's put in some defaults!

In past features "leaving it up to implementer" often meant unintended inconsistency as things get picked semi-randomly; I think in general it's nice to have a pattern of "if you don't want to choose, we pick a reasonable default, don't worry about it".

https://github.com/DataDog/libdatadog/pull/856/files#diff-fded76796d1b1945fd14d3cdb6230e4692e94608fc4887d26e2530a004df451aR59
https://github.com/DataDog/libdatadog/pull/856/files#diff-3b348b31125a4320ee4d0c7b041dee864d9f66c6dae0ed1410712314b63820bfR139-R143

@ivoanjo
Copy link
Member

ivoanjo commented Feb 7, 2025

One thing I strongly recommend is: let's put in some defaults!
[...]
https://github.com/DataDog/libdatadog/pull/856/files#diff-fded76796d1b1945fd14d3cdb6230e4692e94608fc4887d26e2530a004df451aR59
https://github.com/DataDog/libdatadog/pull/856/files#diff-3b348b31125a4320ee4d0c7b041dee864d9f66c6dae0ed1410712314b63820bfR139-R143

Ahaha my bad for scrolling too fast through the PR, and amazing work in getting this in :D :D :D

SigHandler::Handler(f) => f(signum),
SigHandler::SigAction(f) => f(signum, sig_info, ucontext),
};
eprintln!("Unexpected signal number {signum}, can't chain the handlers");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this could happen if the user code changes the sigaction while we're in the middle of handling a signal? I'm not sure how it might arise.

let boxed_ptr = Box::into_raw(Box::new(old_handlers));

let res = OLD_HANDLERS.compare_exchange(ptr::null_mut(), boxed_ptr, SeqCst, SeqCst);
anyhow::ensure!(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so--small one-time leak, right?

bin_tests/src/bin/crashtracker_bin_test.rs Show resolved Hide resolved
bin_tests/src/bin/crashtracker_bin_test.rs Outdated Show resolved Hide resolved
crashtracker-ffi/src/collector/mod.rs Show resolved Hide resolved
@danielsn danielsn enabled auto-merge (squash) February 11, 2025 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants