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

Merged
merged 25 commits into from
Feb 13, 2025

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-13 19:07:26

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

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

scenario:credit_card/is_card_number/37828224631000521389798

  • 🟩 execution_time [-10.906µs; -10.808µs] or [-15.510%; -15.370%]
  • 🟩 throughput [+2586102.058op/s; +2606273.054op/s] or [+18.185%; +18.327%]

scenario:credit_card/is_card_number_no_luhn/37828224631000521389798

  • 🟩 execution_time [-10.826µs; -10.749µs] or [-15.408%; -15.298%]
  • 🟩 throughput [+2573358.742op/s; +2589240.235op/s] or [+18.080%; +18.192%]

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 1aa8fb3 1739472987 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 295.111ns 307.579ns ± 14.917ns 301.680ns ± 4.422ns 310.623ns 343.913ns 356.554ns 357.284ns 18.43% 1.859 2.693 4.84% 1.055ns 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 [305.512ns; 309.647ns] or [-0.672%; +0.672%] None None None

Group 2

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 1aa8fb3 1739472987 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.643µs 2.708µs ± 0.019µs 2.708µs ± 0.009µs 2.719µs 2.740µs 2.749µs 2.756µs 1.77% -0.951 2.354 0.72% 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.706µs; 2.711µs] or [-0.100%; +0.100%] None None None

Group 3

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 1aa8fb3 1739472987 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.243ms 6.257ms ± 0.007ms 6.256ms ± 0.004ms 6.260ms 6.267ms 6.275ms 6.305ms 0.77% 2.233 12.898 0.11% 0.000ms 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.256ms; 6.258ms] or [-0.015%; +0.015%] None None None

Group 4

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 1aa8fb3 1739472987 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.415µs 5.512µs ± 0.054µs 5.527µs ± 0.054µs 5.551µs 5.595µs 5.606µs 5.609µs 1.48% 0.081 -1.352 0.98% 0.004µ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.505µs; 5.520µs] or [-0.136%; +0.136%] None None None

Group 5

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 1aa8fb3 1739472987 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 78.096µs 78.414µs ± 0.144µs 78.402µs ± 0.053µs 78.456µs 78.568µs 78.739µs 79.930µs 1.95% 6.367 61.952 0.18% 0.010µ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 [78.395µs; 78.434µs] or [-0.025%; +0.025%] None None None

Group 6

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 1aa8fb3 1739472987 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.379µs 28.731µs ± 15.298µs 18.758µs ± 0.289µs 39.593µs 49.914µs 57.579µs 154.906µs 725.82% 3.544 23.565 53.11% 1.082µs 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
two way interface execution_time [26.611µs; 30.851µs] or [-7.380%; +7.380%] None None None

Group 7

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 1aa8fb3 1739472987 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.340µs 139.117µs ± 0.473µs 139.062µs ± 0.231µs 139.305µs 139.660µs 140.185µs 143.280µs 3.03% 4.227 31.609 0.34% 0.033µ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 [139.052µs; 139.183µs] or [-0.047%; +0.047%] None None None

Group 8

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 1aa8fb3 1739472987 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.288ms 58.547ms ± 0.214ms 58.464ms ± 0.082ms 58.668ms 58.944ms 59.259ms 59.646ms 2.02% 1.743 4.054 0.37% 0.015ms 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.517ms; 58.577ms] or [-0.051%; +0.051%] None None None

Group 9

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 1aa8fb3 1739472987 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.390µs 620.611µs ± 0.623µs 620.561µs ± 0.354µs 620.944µs 621.342µs 621.906µs 626.342µs 0.93% 3.988 34.025 0.10% 0.044µs 1 200
normalization/normalize_service/normalize_service/A0000000000000000000000000000000000000000000000000... throughput 1596573.030op/s 1611316.416op/s ± 1611.722op/s 1611444.695op/s ± 919.846op/s 1612319.150op/s 1613223.789op/s 1613460.020op/s 1614491.156op/s 0.19% -3.928 33.305 0.10% 113.966op/s 1 200
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰てて execution_time 474.935µs 475.801µs ± 0.290µs 475.797µs ± 0.182µs 475.982µs 476.254µs 476.497µs 476.637µs 0.18% 0.040 0.127 0.06% 0.020µs 1 200
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰てて throughput 2098032.211op/s 2101718.041op/s ± 1280.418op/s 2101735.270op/s ± 804.337op/s 2102471.937op/s 2103749.100op/s 2104510.947op/s 2105551.286op/s 0.18% -0.037 0.126 0.06% 90.539op/s 1 200
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters execution_time 190.047µs 190.741µs ± 0.519µs 190.672µs ± 0.167µs 190.862µs 191.240µs 191.527µs 195.774µs 2.68% 6.473 55.446 0.27% 0.037µs 1 200
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters throughput 5107925.221op/s 5242753.944op/s ± 14024.361op/s 5244607.837op/s ± 4588.145op/s 5248711.366op/s 5254624.349op/s 5258230.827op/s 5261854.148op/s 0.33% -6.347 53.868 0.27% 991.672op/s 1 200
normalization/normalize_service/normalize_service/[empty string] execution_time 45.057µs 45.240µs ± 0.069µs 45.232µs ± 0.044µs 45.284µs 45.365µs 45.424µs 45.471µs 0.53% 0.550 0.593 0.15% 0.005µs 1 200
normalization/normalize_service/normalize_service/[empty string] throughput 21991975.507op/s 22104383.294op/s ± 33866.178op/s 22108481.286op/s ± 21723.020op/s 22128259.362op/s 22150136.174op/s 22173379.706op/s 22194296.525op/s 0.39% -0.540 0.578 0.15% 2394.700op/s 1 200
normalization/normalize_service/normalize_service/test_ASCII execution_time 47.414µs 47.517µs ± 0.107µs 47.502µs ± 0.019µs 47.531µs 47.575µs 47.670µs 48.923µs 2.99% 11.518 148.818 0.22% 0.008µs 1 200
normalization/normalize_service/normalize_service/test_ASCII throughput 20440321.693op/s 21045355.026op/s ± 46122.836op/s 21051654.541op/s ± 8628.248op/s 21058678.392op/s 21068020.567op/s 21086918.052op/s 21090933.319op/s 0.19% -11.396 146.637 0.22% 3261.377op/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.525µs; 620.698µs] or [-0.014%; +0.014%] None None None
normalization/normalize_service/normalize_service/A0000000000000000000000000000000000000000000000000... throughput [1611093.047op/s; 1611539.785op/s] or [-0.014%; +0.014%] None None None
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰てて execution_time [475.761µs; 475.842µs] or [-0.008%; +0.008%] None None None
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰てて throughput [2101540.588op/s; 2101895.495op/s] or [-0.008%; +0.008%] None None None
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters execution_time [190.669µs; 190.813µs] or [-0.038%; +0.038%] None None None
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters throughput [5240810.302op/s; 5244697.585op/s] or [-0.037%; +0.037%] None None None
normalization/normalize_service/normalize_service/[empty string] execution_time [45.230µs; 45.250µs] or [-0.021%; +0.021%] None None None
normalization/normalize_service/normalize_service/[empty string] throughput [22099689.767op/s; 22109076.820op/s] or [-0.021%; +0.021%] None None None
normalization/normalize_service/normalize_service/test_ASCII execution_time [47.502µs; 47.531µs] or [-0.031%; +0.031%] None None None
normalization/normalize_service/normalize_service/test_ASCII throughput [21038962.845op/s; 21051747.208op/s] or [-0.030%; +0.030%] None None None

Group 10

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 1aa8fb3 1739472987 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.272µs 4.290µs ± 0.003µs 4.290µs ± 0.001µs 4.291µs 4.294µs 4.297µs 4.316µs 0.62% 1.779 21.506 0.08% 0.000µs 1 200
credit_card/is_card_number/ throughput 231687037.309op/s 233118733.011op/s ± 182638.196op/s 233119830.103op/s ± 61557.026op/s 233177445.912op/s 233376776.012op/s 233480248.504op/s 234077039.853op/s 0.41% -1.732 21.231 0.08% 12914.471op/s 1 200
credit_card/is_card_number/ 3782-8224-6310-005 execution_time 89.985µs 90.270µs ± 0.352µs 90.230µs ± 0.096µs 90.331µs 90.530µs 90.637µs 94.817µs 5.08% 10.914 138.495 0.39% 0.025µs 1 200
credit_card/is_card_number/ 3782-8224-6310-005 throughput 10546602.873op/s 11078028.463op/s ± 41403.009op/s 11082728.123op/s ± 11786.195op/s 11093230.634op/s 11103818.216op/s 11111555.118op/s 11112910.980op/s 0.27% -10.664 134.162 0.37% 2927.635op/s 1 200
credit_card/is_card_number/ 378282246310005 execution_time 82.357µs 82.624µs ± 0.368µs 82.605µs ± 0.061µs 82.667µs 82.741µs 82.815µs 87.632µs 6.09% 12.691 170.428 0.44% 0.026µs 1 200
credit_card/is_card_number/ 378282246310005 throughput 11411397.477op/s 12103208.196op/s ± 51026.369op/s 12105816.846op/s ± 9004.355op/s 12114383.711op/s 12130722.512op/s 12137954.584op/s 12142307.442op/s 0.30% -12.537 167.663 0.42% 3608.109op/s 1 200
credit_card/is_card_number/37828224631 execution_time 4.268µs 4.291µs ± 0.014µs 4.290µs ± 0.001µs 4.291µs 4.295µs 4.351µs 4.426µs 3.18% 8.380 73.878 0.32% 0.001µs 1 200
credit_card/is_card_number/37828224631 throughput 225927830.645op/s 233024277.869op/s ± 723198.351op/s 233110163.603op/s ± 59647.438op/s 233165088.035op/s 233294200.344op/s 233421789.340op/s 234309223.038op/s 0.51% -8.326 73.101 0.31% 51137.846op/s 1 200
credit_card/is_card_number/378282246310005 execution_time 78.997µs 79.390µs ± 0.219µs 79.338µs ± 0.125µs 79.523µs 79.752µs 80.119µs 80.334µs 1.26% 1.173 2.499 0.28% 0.016µs 1 200
credit_card/is_card_number/378282246310005 throughput 12448100.805op/s 12596209.546op/s ± 34697.580op/s 12604360.492op/s ± 19920.331op/s 12618525.271op/s 12643407.537op/s 12656267.133op/s 12658690.754op/s 0.43% -1.147 2.394 0.27% 2453.489op/s 1 200
credit_card/is_card_number/37828224631000521389798 execution_time 59.376µs 59.462µs ± 0.032µs 59.463µs ± 0.018µs 59.482µs 59.510µs 59.549µs 59.552µs 0.15% -0.179 0.610 0.05% 0.002µs 1 200
credit_card/is_card_number/37828224631000521389798 throughput 16791992.227op/s 16817400.941op/s ± 9065.985op/s 16817052.412op/s ± 5181.019op/s 16822040.357op/s 16834095.526op/s 16841274.191op/s 16841784.687op/s 0.15% 0.183 0.610 0.05% 641.062op/s 1 200
credit_card/is_card_number/x371413321323331 execution_time 7.235µs 7.247µs ± 0.011µs 7.246µs ± 0.002µs 7.248µs 7.253µs 7.261µs 7.350µs 1.43% 8.143 73.801 0.14% 0.001µs 1 200
credit_card/is_card_number/x371413321323331 throughput 136060592.317op/s 137984029.977op/s ± 197914.331op/s 138007887.151op/s ± 30308.366op/s 138033134.854op/s 138121279.483op/s 138197958.360op/s 138218315.830op/s 0.15% -8.102 73.289 0.14% 13994.657op/s 1 200
credit_card/is_card_number_no_luhn/ execution_time 4.272µs 4.290µs ± 0.003µs 4.290µs ± 0.001µs 4.291µs 4.294µs 4.295µs 4.296µs 0.14% -1.768 11.105 0.06% 0.000µs 1 200
credit_card/is_card_number_no_luhn/ throughput 232792380.542op/s 233110513.983op/s ± 138088.702op/s 233114598.468op/s ± 51650.714op/s 233159010.646op/s 233380432.250op/s 233479596.789op/s 234062990.245op/s 0.41% 1.786 11.232 0.06% 9764.346op/s 1 200
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005 execution_time 71.400µs 71.516µs ± 0.040µs 71.517µs ± 0.021µs 71.539µs 71.583µs 71.615µs 71.648µs 0.18% -0.156 0.840 0.06% 0.003µs 1 200
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005 throughput 13957152.936op/s 13982812.715op/s ± 7884.946op/s 13982665.689op/s ± 4103.003op/s 13986227.412op/s 13998002.905op/s 14001644.554op/s 14005675.100op/s 0.16% 0.161 0.840 0.06% 557.550op/s 1 200
credit_card/is_card_number_no_luhn/ 378282246310005 execution_time 63.789µs 63.886µs ± 0.038µs 63.885µs ± 0.019µs 63.905µs 63.957µs 63.993µs 64.022µs 0.22% 0.332 1.060 0.06% 0.003µs 1 200
credit_card/is_card_number_no_luhn/ 378282246310005 throughput 15619619.874op/s 15652938.286op/s ± 9278.144op/s 15653202.403op/s ± 4763.786op/s 15657770.211op/s 15669614.502op/s 15673694.541op/s 15676648.065op/s 0.15% -0.327 1.054 0.06% 656.064op/s 1 200
credit_card/is_card_number_no_luhn/37828224631 execution_time 4.273µs 4.290µs ± 0.003µs 4.290µs ± 0.001µs 4.291µs 4.294µs 4.296µs 4.301µs 0.27% -1.679 14.506 0.06% 0.000µs 1 200
credit_card/is_card_number_no_luhn/37828224631 throughput 232487472.395op/s 233109542.562op/s ± 147590.992op/s 233119736.875op/s ± 50941.912op/s 233161738.159op/s 233245569.340op/s 233460326.718op/s 234036140.921op/s 0.39% 1.705 14.633 0.06% 10436.259op/s 1 200
credit_card/is_card_number_no_luhn/378282246310005 execution_time 60.579µs 60.676µs ± 0.037µs 60.676µs ± 0.017µs 60.695µs 60.728µs 60.760µs 60.921µs 0.40% 1.176 8.797 0.06% 0.003µs 1 200
credit_card/is_card_number_no_luhn/378282246310005 throughput 16414748.363op/s 16480855.808op/s ± 10070.243op/s 16481016.341op/s ± 4680.668op/s 16485060.002op/s 16497631.602op/s 16505340.666op/s 16507413.479op/s 0.16% -1.159 8.686 0.06% 712.074op/s 1 200
credit_card/is_card_number_no_luhn/37828224631000521389798 execution_time 59.378µs 59.474µs ± 0.037µs 59.470µs ± 0.016µs 59.489µs 59.544µs 59.602µs 59.614µs 0.24% 0.711 2.175 0.06% 0.003µs 1 200
credit_card/is_card_number_no_luhn/37828224631000521389798 throughput 16774584.817op/s 16814117.188op/s ± 10530.758op/s 16815179.193op/s ± 4505.600op/s 16819341.168op/s 16830990.500op/s 16838366.396op/s 16841388.599op/s 0.16% -0.704 2.162 0.06% 744.637op/s 1 200
credit_card/is_card_number_no_luhn/x371413321323331 execution_time 7.234µs 7.246µs ± 0.004µs 7.245µs ± 0.002µs 7.248µs 7.254µs 7.258µs 7.263µs 0.25% 0.608 2.371 0.06% 0.000µs 1 200
credit_card/is_card_number_no_luhn/x371413321323331 throughput 137676205.105op/s 138010863.056op/s ± 81923.784op/s 138018886.302op/s ± 36636.376op/s 138052337.431op/s 138145846.463op/s 138205148.928op/s 138244410.111op/s 0.16% -0.601 2.360 0.06% 5792.886op/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.289µs; 4.290µs] or [-0.011%; +0.011%] None None None
credit_card/is_card_number/ throughput [233093421.113op/s; 233144044.908op/s] or [-0.011%; +0.011%] None None None
credit_card/is_card_number/ 3782-8224-6310-005 execution_time [90.221µs; 90.319µs] or [-0.054%; +0.054%] None None None
credit_card/is_card_number/ 3782-8224-6310-005 throughput [11072290.404op/s; 11083766.522op/s] or [-0.052%; +0.052%] None None None
credit_card/is_card_number/ 378282246310005 execution_time [82.573µs; 82.675µs] or [-0.062%; +0.062%] None None None
credit_card/is_card_number/ 378282246310005 throughput [12096136.432op/s; 12110279.959op/s] or [-0.058%; +0.058%] None None None
credit_card/is_card_number/37828224631 execution_time [4.290µs; 4.293µs] or [-0.044%; +0.044%] None None None
credit_card/is_card_number/37828224631 throughput [232924049.533op/s; 233124506.205op/s] or [-0.043%; +0.043%] None None None
credit_card/is_card_number/378282246310005 execution_time [79.359µs; 79.420µs] or [-0.038%; +0.038%] None None None
credit_card/is_card_number/378282246310005 throughput [12591400.795op/s; 12601018.297op/s] or [-0.038%; +0.038%] None None None
credit_card/is_card_number/37828224631000521389798 execution_time [59.458µs; 59.467µs] or [-0.007%; +0.007%] None None None
credit_card/is_card_number/37828224631000521389798 throughput [16816144.483op/s; 16818657.399op/s] or [-0.007%; +0.007%] None None None
credit_card/is_card_number/x371413321323331 execution_time [7.246µs; 7.249µs] or [-0.020%; +0.020%] None None None
credit_card/is_card_number/x371413321323331 throughput [137956600.954op/s; 138011459.000op/s] or [-0.020%; +0.020%] None None None
credit_card/is_card_number_no_luhn/ execution_time [4.289µs; 4.290µs] or [-0.008%; +0.008%] None None None
credit_card/is_card_number_no_luhn/ throughput [233091376.217op/s; 233129651.749op/s] or [-0.008%; +0.008%] None None None
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005 execution_time [71.511µs; 71.522µs] or [-0.008%; +0.008%] None None None
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005 throughput [13981719.937op/s; 13983905.492op/s] or [-0.008%; +0.008%] None None None
credit_card/is_card_number_no_luhn/ 378282246310005 execution_time [63.881µs; 63.891µs] or [-0.008%; +0.008%] None None None
credit_card/is_card_number_no_luhn/ 378282246310005 throughput [15651652.424op/s; 15654224.147op/s] or [-0.008%; +0.008%] None None None
credit_card/is_card_number_no_luhn/37828224631 execution_time [4.289µs; 4.290µs] or [-0.009%; +0.009%] None None None
credit_card/is_card_number_no_luhn/37828224631 throughput [233089087.870op/s; 233129997.254op/s] or [-0.009%; +0.009%] None None None
credit_card/is_card_number_no_luhn/378282246310005 execution_time [60.671µs; 60.682µs] or [-0.008%; +0.008%] None None None
credit_card/is_card_number_no_luhn/378282246310005 throughput [16479460.169op/s; 16482251.447op/s] or [-0.008%; +0.008%] None None None
credit_card/is_card_number_no_luhn/37828224631000521389798 execution_time [59.469µs; 59.479µs] or [-0.009%; +0.009%] None None None
credit_card/is_card_number_no_luhn/37828224631000521389798 throughput [16812657.726op/s; 16815576.650op/s] or [-0.009%; +0.009%] None None None
credit_card/is_card_number_no_luhn/x371413321323331 execution_time [7.245µs; 7.246µs] or [-0.008%; +0.008%] None None None
credit_card/is_card_number_no_luhn/x371413321323331 throughput [137999509.207op/s; 138022216.904op/s] or [-0.008%; +0.008%] None None None

Group 11

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 1aa8fb3 1739472987 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.403µs 3.355µs ± 1.490µs 3.151µs ± 0.020µs 3.171µs 3.811µs 14.528µs 15.581µs 394.50% 7.447 56.157 44.32% 0.105µ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.148µs; 3.561µs] or [-6.157%; +6.157%] None None None

Group 12

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 1aa8fb3 1739472987 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.382µs 313.627µs ± 0.929µs 313.589µs ± 0.650µs 314.228µs 315.233µs 315.822µs 316.375µs 0.89% 0.275 -0.009 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 3160805.237op/s 3188529.276op/s ± 9439.422op/s 3188891.676op/s ± 6624.768op/s 3195566.817op/s 3202581.301op/s 3208565.702op/s 3211491.408op/s 0.71% -0.258 -0.022 0.30% 667.468op/s 1 200
normalization/normalize_name/normalize_name/bad-name execution_time 27.916µs 28.142µs ± 0.092µs 28.136µs ± 0.061µs 28.200µs 28.301µs 28.376µs 28.417µs 1.00% 0.364 0.001 0.32% 0.006µs 1 200
normalization/normalize_name/normalize_name/bad-name throughput 35190332.780op/s 35534525.160op/s ± 115462.466op/s 35542112.015op/s ± 76663.467op/s 35614540.774op/s 35701210.450op/s 35758588.556op/s 35821970.945op/s 0.79% -0.346 -0.019 0.32% 8164.429op/s 1 200
normalization/normalize_name/normalize_name/good execution_time 16.406µs 16.651µs ± 0.105µs 16.650µs ± 0.064µs 16.713µs 16.837µs 16.906µs 16.990µs 2.04% 0.258 0.205 0.63% 0.007µs 1 200
normalization/normalize_name/normalize_name/good throughput 58856492.539op/s 60058734.021op/s ± 379233.939op/s 60059484.313op/s ± 231160.893op/s 60290049.463op/s 60665456.218op/s 60868180.681op/s 60952903.894op/s 1.49% -0.218 0.164 0.63% 26815.889op/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.498µs; 313.756µ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 [3187221.063op/s; 3189837.489op/s] or [-0.041%; +0.041%] None None None
normalization/normalize_name/normalize_name/bad-name execution_time [28.129µs; 28.155µs] or [-0.045%; +0.045%] None None None
normalization/normalize_name/normalize_name/bad-name throughput [35518523.173op/s; 35550527.148op/s] or [-0.045%; +0.045%] None None None
normalization/normalize_name/normalize_name/good execution_time [16.636µs; 16.666µs] or [-0.088%; +0.088%] None None None
normalization/normalize_name/normalize_name/good throughput [60006175.844op/s; 60111292.197op/s] or [-0.088%; +0.088%] None None None

Group 13

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 1aa8fb3 1739472987 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 38.879µs 39.339µs ± 0.716µs 39.023µs ± 0.042µs 39.082µs 40.821µs 40.857µs 42.674µs 9.36% 1.880 2.394 1.81% 0.051µ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 [39.240µs; 39.438µs] or [-0.252%; +0.252%] 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.62%. Comparing base (5ada426) to head (1aa8fb3).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #856      +/-   ##
==========================================
- Coverage   71.90%   71.62%   -0.29%     
==========================================
  Files         324      324              
  Lines       48077    48226     +149     
==========================================
- Hits        34572    34541      -31     
- Misses      13505    13685     +180     
Components Coverage Δ
crashtracker 42.69% <31.41%> (-0.54%) ⬇️
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.78% <ø> (+0.10%) ⬆️
profiling 79.31% <ø> (-0.74%) ⬇️
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
@danielsn danielsn merged commit 7518483 into main Feb 13, 2025
31 checks passed
@danielsn danielsn deleted the dsn/crashtracker-many-signals branch February 13, 2025 19:23
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