Skip to content

Commit

Permalink
Introduce dt_maxaggdsize
Browse files Browse the repository at this point in the history
We are moving to an implementation in which dt_aggregate tracks varID,
keys, and aggregation data for each aggregation found by the consumer.
For sizing purposes, dt_maxaggdsize will track the maximum size for
any aggregation.

Signed-off-by: Eugene Loh <eugene.loh@oracle.com>
Reviewed-by: Kris Van Hees <kris.van.hees@oracle.com>
  • Loading branch information
kvanhees committed Aug 31, 2022
1 parent b2bad36 commit c9d18cd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions libdtrace/dt_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,7 @@ struct dtrace_hdl {
uint_t dt_maxdvarsize; /* largest dynamic variable across programs */
uint_t dt_maxtuplesize; /* largest tuple across programs */
uint_t dt_maxlvaralloc; /* largest lvar alloc across pcbs */
uint_t dt_maxaggdsize; /* largest aggregation data sizw */
uint_t dt_zerosize; /* zero region, size */
uint_t dt_zerooffset; /* zero region, offset */
dt_tstring_t *dt_tstrings; /* temporary string slots */
Expand Down
4 changes: 4 additions & 0 deletions libdtrace/dt_map.c
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,10 @@ dt_aggid_add(dtrace_hdl_t *dtp, const dt_ident_t *aid)
agg->dtagd_dsize = drecs[DT_AGGDATA_COUNTER].dtrd_size +
drecs[DT_AGGDATA_RECORD].dtrd_size;

/* update dt_maxaggdsize */
if (dtp->dt_maxaggdsize < agg->dtagd_dsize)
dtp->dt_maxaggdsize = agg->dtagd_dsize;

dtp->dt_adesc[id] = agg;

return 0;
Expand Down

0 comments on commit c9d18cd

Please sign in to comment.