cryptodeflate: Drop z_stream zbuf.state->dummy from SDT probe.
For older versions of zlib, dummy was a workaround for compilers that do not handle opaque type definition well; on FreeBSD, it's representing a value that is not really useful for monitoring purposes, and the field would be gone in newer zlib versions. PR: 229763 Submitted by: Yoshihiro Ota <ota at j.email.ne.jp> Differential Revision: https://reviews.freebsd.org/D20222
This commit is contained in:
parent
22554a341e
commit
a49818787d
@ -50,10 +50,10 @@ __FBSDID("$FreeBSD$");
|
||||
SDT_PROVIDER_DECLARE(opencrypto);
|
||||
SDT_PROBE_DEFINE2(opencrypto, deflate, deflate_global, entry,
|
||||
"int", "u_int32_t");
|
||||
SDT_PROBE_DEFINE5(opencrypto, deflate, deflate_global, bad,
|
||||
"int", "int", "int", "int", "int");
|
||||
SDT_PROBE_DEFINE5(opencrypto, deflate, deflate_global, iter,
|
||||
"int", "int", "int", "int", "int");
|
||||
SDT_PROBE_DEFINE6(opencrypto, deflate, deflate_global, bad,
|
||||
"int", "int", "int", "int", "int", "int");
|
||||
SDT_PROBE_DEFINE6(opencrypto, deflate, deflate_global, iter,
|
||||
"int", "int", "int", "int", "int", "int");
|
||||
SDT_PROBE_DEFINE2(opencrypto, deflate, deflate_global, return,
|
||||
"int", "u_int32_t");
|
||||
|
||||
@ -105,8 +105,8 @@ deflate_global(data, size, decomp, out)
|
||||
bufh = bufp = malloc(sizeof(*bufp) + (size_t)(size * i),
|
||||
M_CRYPTO_DATA, M_NOWAIT);
|
||||
if (bufp == NULL) {
|
||||
SDT_PROBE5(opencrypto, deflate, deflate_global, bad,
|
||||
decomp, 0, __LINE__, 0, 0);
|
||||
SDT_PROBE6(opencrypto, deflate, deflate_global, bad,
|
||||
decomp, 0, __LINE__, 0, 0, 0);
|
||||
goto bad2;
|
||||
}
|
||||
bufp->next = NULL;
|
||||
@ -125,8 +125,8 @@ deflate_global(data, size, decomp, out)
|
||||
deflateInit2(&zbuf, Z_DEFAULT_COMPRESSION, Z_METHOD,
|
||||
window_deflate, Z_MEMLEVEL, Z_DEFAULT_STRATEGY);
|
||||
if (error != Z_OK) {
|
||||
SDT_PROBE5(opencrypto, deflate, deflate_global, bad,
|
||||
decomp, error, __LINE__, 0, 0);
|
||||
SDT_PROBE6(opencrypto, deflate, deflate_global, bad,
|
||||
decomp, error, __LINE__, 0, 0, 0);
|
||||
goto bad;
|
||||
}
|
||||
|
||||
@ -134,24 +134,14 @@ deflate_global(data, size, decomp, out)
|
||||
error = decomp ? inflate(&zbuf, Z_SYNC_FLUSH) :
|
||||
deflate(&zbuf, Z_FINISH);
|
||||
if (error != Z_OK && error != Z_STREAM_END) {
|
||||
/*
|
||||
* Unfortunately we are limited to 5 arguments,
|
||||
* thus use two probes.
|
||||
*/
|
||||
SDT_PROBE5(opencrypto, deflate, deflate_global, bad,
|
||||
SDT_PROBE6(opencrypto, deflate, deflate_global, bad,
|
||||
decomp, error, __LINE__,
|
||||
zbuf.avail_in, zbuf.avail_out);
|
||||
SDT_PROBE5(opencrypto, deflate, deflate_global, bad,
|
||||
decomp, error, __LINE__,
|
||||
zbuf.state->dummy, zbuf.total_out);
|
||||
zbuf.avail_in, zbuf.avail_out, zbuf.total_out);
|
||||
goto bad;
|
||||
}
|
||||
SDT_PROBE5(opencrypto, deflate, deflate_global, iter,
|
||||
SDT_PROBE6(opencrypto, deflate, deflate_global, iter,
|
||||
decomp, error, __LINE__,
|
||||
zbuf.avail_in, zbuf.avail_out);
|
||||
SDT_PROBE5(opencrypto, deflate, deflate_global, iter,
|
||||
decomp, error, __LINE__,
|
||||
zbuf.state->dummy, zbuf.total_out);
|
||||
zbuf.avail_in, zbuf.avail_out, zbuf.total_out);
|
||||
if (decomp && zbuf.avail_in == 0 && error == Z_STREAM_END) {
|
||||
/* Done. */
|
||||
break;
|
||||
@ -165,8 +155,8 @@ deflate_global(data, size, decomp, out)
|
||||
p = malloc(sizeof(*p) + (size_t)(size * i),
|
||||
M_CRYPTO_DATA, M_NOWAIT);
|
||||
if (p == NULL) {
|
||||
SDT_PROBE5(opencrypto, deflate, deflate_global,
|
||||
bad, decomp, 0, __LINE__, 0, 0);
|
||||
SDT_PROBE6(opencrypto, deflate, deflate_global,
|
||||
bad, decomp, 0, __LINE__, 0, 0, 0);
|
||||
goto bad;
|
||||
}
|
||||
p->next = NULL;
|
||||
@ -177,16 +167,9 @@ deflate_global(data, size, decomp, out)
|
||||
zbuf.avail_out = bufp->size;
|
||||
} else {
|
||||
/* Unexpect result. */
|
||||
/*
|
||||
* Unfortunately we are limited to 5 arguments,
|
||||
* thus, again, use two probes.
|
||||
*/
|
||||
SDT_PROBE5(opencrypto, deflate, deflate_global, bad,
|
||||
SDT_PROBE6(opencrypto, deflate, deflate_global, bad,
|
||||
decomp, error, __LINE__,
|
||||
zbuf.avail_in, zbuf.avail_out);
|
||||
SDT_PROBE5(opencrypto, deflate, deflate_global, bad,
|
||||
decomp, error, __LINE__,
|
||||
zbuf.state->dummy, zbuf.total_out);
|
||||
zbuf.avail_in, zbuf.avail_out, zbuf.total_out);
|
||||
goto bad;
|
||||
}
|
||||
}
|
||||
@ -195,8 +178,8 @@ deflate_global(data, size, decomp, out)
|
||||
|
||||
*out = malloc(result, M_CRYPTO_DATA, M_NOWAIT);
|
||||
if (*out == NULL) {
|
||||
SDT_PROBE5(opencrypto, deflate, deflate_global, bad,
|
||||
decomp, 0, __LINE__, 0, 0);
|
||||
SDT_PROBE6(opencrypto, deflate, deflate_global, bad,
|
||||
decomp, 0, __LINE__, 0, 0, 0);
|
||||
goto bad;
|
||||
}
|
||||
if (decomp)
|
||||
|
Loading…
Reference in New Issue
Block a user