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
OSSL_TRACE: enhance documentation and fix doc-nit errors #9224
Conversation
- OpenSSL Tracing API | ||
|
||
=head1 SYNOPSIS | ||
|
||
=for comment generic |
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.
Actually, this line disables the synopsis check completely, which is inconvenient when additional symbols are added later on to the pod file. Of course, I can remove the comment line temporarily to get the errors back, but it would be nicer if one could add a specific exclusion list (here: OSSL_TRACEV, OSSL_TRACE3, OSSL_TRACE4, ... OSSL_TRACE8
).
@levitte do you think this would be a useful feature? If yes, I could raise an issue with a feature request for it.
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 have had similar thoughts, but more on a section basis (and we should have our own keyword instead of piggy-backing on comment)
for openssl no-check NAME, SYNOPSIS
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 added a feature request in #9226.
@@ -17,7 +23,13 @@ OSSL_TRACE_BEGIN, OSSL_TRACE_END, OSSL_TRACE1, OSSL_TRACE2, OSSL_TRACE9 | |||
|
|||
/* trace group macros */ | |||
OSSL_TRACE_BEGIN(category) { | |||
... | |||
... |
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.
Relative indentation was corrected from +3 to +4 characters.
doc/man3/OSSL_trace_enabled.pod
Outdated
BIO_dump(trace, somememory, somememory_l); | ||
OSSL_trace_end(OSSL_TRACE_CATEGORY_TLS, trace); | ||
} | ||
if (OSSL_trace_enabled(OSSL_TRACE_CATEGORY_TLS)) { |
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.
1+4 (one space for perlpod, 4 spaces for C)
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 just noticed that the entire NOTES section needs an update. I'll put the pull request in WIP until it's done...
6a0fb8a
to
ef71d83
Compare
Done. Taking the pr out of WIP again. Please note the new commit message:
|
- Add the following macros to the NAME section: - with synopsis OSSL_TRACE_CANCEL, OSSL_TRACE, OSSL_TRACE_ENABLED - without synopsis OSSL_TRACEV (helper macro, not intended for public use) OSSL_TRACE[3-8] (omitted on purpose) - Revise the NOTES section
ef71d83
to
a93dfcd
Compare
doc/man3/OSSL_trace_enabled.pod
Outdated
@@ -136,26 +152,71 @@ This will normally expand to: | |||
} while (0); | |||
|
|||
|
|||
C<OSSL_TRACE1()>, ... C<OSSL_TRACE9()> are one-shot macros which essentially wrap | |||
a single BIO_printf() into a tracing group. | |||
C<OSSL_TRACE()> and C<OSSL_TRACE1()>, C<OSSL_TRACE1()>, ... C<OSSL_TRACE9()> are |
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.
You repeat OSSL_TRACE1
twice here
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.
Done.
doc/man3/OSSL_trace_enabled.pod
Outdated
|
||
Internally, all one-shot macros are implemented using a generic C<OSSL_TRACEV()> | ||
macro, since C90 does not support variadic macros. This helper macro has a rather | ||
weird synopsis and is not intended to be used directly. |
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'd make this stronger. Perhaps "must not be used directly".
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.
Hmmm... "must" sounds a bit too strong IMHO. Can we meet in the middle and say "should not be used directly"?
On one hand, I don't want to encourage using OSSL_TRACEV()
by documenting it (mainly because of its odd synopsis), but on the other hand, I don't want to forbid it either. One valid use case for an application developer would be for example to add more macros OSSL_TRACE10(), ..., OSSL_TRACE11()
along the lines of the existing ones.
(So it's more like "Use it at your own risk. We're unlikely to change it, but we don't advertise it as an official api.")
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.
Its the last bit I was mostly worried about, i.e. people using it and expecting it to be stable. I'd be ok with "should", if there was something about it possibly changing in the future.
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.
This helper macro is really unlikely to change, since the 'numbered' macros derived from it are officially documented and not allowed to change after their initial release. (Currently, the new TRACE api only exists on master.)
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 strongly disagree with "must". These are public macros, we cannot dictate their use, only give the users a "fair warning". Our users often use more modern compilers.
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, fair enough.
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 like how fair we are 😉
Fixup pushed, see 91d0f49. |
I pushed one final trivial fixup which I overlooked, see 74ca3d4 |
Merged to 6f92692, thanks! |
- Add the following macros to the NAME section: - with synopsis OSSL_TRACE_CANCEL, OSSL_TRACE, OSSL_TRACE_ENABLED - without synopsis OSSL_TRACEV (helper macro, not intended for public use) OSSL_TRACE[3-8] (omitted on purpose) - Revise the NOTES section Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from #9224)
Checklist