Skip to content

Commit

Permalink
trace: rename the default trace category from 'ANY' to 'ALL'
Browse files Browse the repository at this point in the history
It seems more intuitive to set `OPENSSL_TRACE=all` instead of
`OPENSSL_TRACE=any` to obtain trace output for all categories.

Reviewed-by: Paul Dale <[email protected]>
(Merged from openssl#8552)
  • Loading branch information
mspncp committed Mar 29, 2019
1 parent 02bd2d7 commit 3a8269b
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion apps/openssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ static void setup_trace(const char *str)
for (valp = val; (item = strtok(valp, ",")) != NULL; valp = NULL) {
int category = OSSL_trace_get_category_num(item);

if (category == OSSL_TRACE_CATEGORY_ANY) {
if (category == OSSL_TRACE_CATEGORY_ALL) {
while (++category < OSSL_TRACE_CATEGORY_NUM)
setup_trace_category(category);
break;
Expand Down
4 changes: 2 additions & 2 deletions crypto/trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ struct trace_category_st {
#define TRACE_CATEGORY_(name) { #name, OSSL_TRACE_CATEGORY_##name }

static const struct trace_category_st trace_categories[] = {
TRACE_CATEGORY_(ANY),
TRACE_CATEGORY_(ALL),
TRACE_CATEGORY_(TRACE),
TRACE_CATEGORY_(INIT),
TRACE_CATEGORY_(TLS),
Expand Down Expand Up @@ -422,7 +422,7 @@ static int ossl_trace_get_category(int category)
return -1;
if (trace_channels[category].bio != NULL)
return category;
return OSSL_TRACE_CATEGORY_ANY;
return OSSL_TRACE_CATEGORY_ALL;
}
#endif

Expand Down
2 changes: 1 addition & 1 deletion doc/man3/OSSL_trace_enabled.pod
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ The tracing output is divided into types which are enabled
individually by the application.
The tracing types are described in detail in
L<OSSL_trace_set_callback(3)/Trace types>.
The fallback type C<OSSL_TRACE_CATEGORY_ANY> should I<not> be used
The fallback type C<OSSL_TRACE_CATEGORY_ALL> should I<not> be used
with the functions described here.

Tracing for a specific category is enabled if a so called
Expand Down
2 changes: 1 addition & 1 deletion doc/man3/OSSL_trace_set_channel.pod
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ Traces BIGNUM context operations.

=back

There is also C<OSSL_TRACE_CATEGORY_ANY>, which works as a fallback
There is also C<OSSL_TRACE_CATEGORY_ALL>, which works as a fallback
and can be used to get I<all> trace output.

Note, however, that in this case all trace output will effectively be
Expand Down
4 changes: 2 additions & 2 deletions include/openssl/trace.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ extern "C" {
* BIO which sends all trace output it receives to the registered application
* callback.
*
* The ANY category can be used as a fallback category to register a single
* The ALL category can be used as a fallback category to register a single
* channel which receives the output from all categories. However, if the
* application intends to print the trace channel name in the line prefix,
* it is better to register channels for all categories separately.
* (This is how the openssl application does it.)
*/
# define OSSL_TRACE_CATEGORY_ANY 0 /* The fallback */
# define OSSL_TRACE_CATEGORY_ALL 0 /* The fallback */
# define OSSL_TRACE_CATEGORY_TRACE 1
# define OSSL_TRACE_CATEGORY_INIT 2
# define OSSL_TRACE_CATEGORY_TLS 3
Expand Down

0 comments on commit 3a8269b

Please sign in to comment.