Add extra statistic to track the number of signature validation operations - #1289
Conversation
…tions performed by the validator module
|
Since this is about every single validation operation I would be concerned about the locking. Line 133 in 81f3de4 In dnskey_verify_rrset_sig() you can get access to the mesh_area with qstate->env->mesh.As for the extended statistics, you can get access to the value via qstate->env->cfg->stat_extended.
|
I copied this pattern from how Line 453 in e4cf7ae This led me to conclude that it was OK to use locking for this type of statistic, so I'm now somewhat confused as to how |
|
You followed the pattern for You followed the pattern for (small note that For the It is defined here (for stats): Line 772 in e4cf7ae and here (for the mesh area): Line 133 in e4cf7ae It is counted (for the mesh area) here: Line 1450 in e4cf7ae It is gathered here: Line 275 in e4cf7ae You can follow this paradigm and when counting for |
|
Ahh, the naming is confusing, you're (of course) right. Let me see if I can find some time to fix this tomorrow. |
|
With thanks to the rain today I finally found time to make the requested change 😅 |
…LL`) Co-authored-by: Wouter Wijngaards <wcawijngaards@users.noreply.github.com>
|
This looks good to me now, thanks for the fixes! |
- Merge #1289 from Roland van Rijswijk-Deij: Add extra statistic to track the number of signature validation operations. Adds 'num.valops' to extended statistics.
This PR adds an extra statistic to the extended statistics to track the number of signature validation operations performed by the validator module. This is mostly useful for research purposes, as it makes it possible to track the workload required for cryptographic operations over time.
The statistic tracks the number of calls to
verify_canonrrset(..)inval_sigcrypt.c. The implementation follows the same pattern as for the statistic that tracks the number of bogus RRsets. That is: there is a lock around operations that change or read the statistic (I assume this is because the validator module is not replicated in each thread if Unbound runs multi-threaded).It would be much appreciated if this patch could be considered for merging as it would help us in research into performance of PQC algorithms; I admit that the extra lock/unlock operation around updates of the statistic adds overhead, I didn't immediately see an easy way to mitigate this as information on whether or not extended statistics are enabled is not available at the abstraction level where the statistic needs to be updated. It seems this is deemed acceptable for tracking the number of bogus RRsets, so hoping one more lock/unlock is fine here.