[DTrace-devel] [PATCH 47/61] Clean up latch sequence number
eugene.loh at oracle.com
eugene.loh at oracle.com
Fri Jul 8 14:45:31 UTC 2022
From: Eugene Loh <eugene.loh at oracle.com>
We were checking multiple times whether it was 0. Have
dt_agg_one_agg() take a pointer to actual data without regard
to latch sequence number.
Signed-off-by: Eugene Loh <eugene.loh at oracle.com>
---
libdtrace/dt_aggregate.c | 14 +++-----------
1 file changed, 3 insertions(+), 11 deletions(-)
diff --git a/libdtrace/dt_aggregate.c b/libdtrace/dt_aggregate.c
index 191aef52..8fa2755d 100644
--- a/libdtrace/dt_aggregate.c
+++ b/libdtrace/dt_aggregate.c
@@ -421,10 +421,6 @@ dt_agg_one_agg(uint_t act, int64_t *dst, int64_t *src, uint_t realsz)
{
uint_t i, cnt;
- if (*src == 0)
- return;
-
- src++; /* skip latch sequence number */
switch (act) {
case DT_AGG_MAX:
if (*src > *dst)
@@ -471,6 +467,9 @@ dt_aggregate_snap_one(dt_idhash_t *dhp, dt_ident_t *aid, dt_snapstate_t *st)
if (*src == 0)
return 0;
+ /* advance past the latch sequence number */
+ src++;
+
datasz = agg->dtagd_recs[nrecs - 1].dtrd_size;
/* See if we already have an entry for this aggregation. */
@@ -496,13 +495,6 @@ dt_aggregate_snap_one(dt_idhash_t *dhp, dt_ident_t *aid, dt_snapstate_t *st)
return 0;
}
- /* not found, so skip it if latch sequence number is 0 */
- if (*src == 0)
- return 0;
-
- /* advance past the latch sequence number */
- src++;
-
/* add it to the hash table */
h = dt_zalloc(st->dtp, sizeof(dt_ahashent_t));
if (h == NULL)
--
2.18.4
More information about the DTrace-devel
mailing list