[DTrace-devel] [PATCH 48/61] Introduce dt_aggsiz

Kris Van Hees kris.van.hees at oracle.com
Mon Aug 15 04:21:49 UTC 2022


On Fri, Jul 08, 2022 at 10:45:32AM -0400, eugene.loh--- via DTrace-devel wrote:
> From: Eugene Loh <eugene.loh at oracle.com>
> 
> 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_aggsiz will track the
> maximum size for any aggregation.
> 
> Signed-off-by: Eugene Loh <eugene.loh at oracle.com>

Reviewed-by: Kris Van Hees <kris.van.hees at oracle.com>

... please rename dt_aggsiz to be dt_maxaggdsize
... queued for dev

> ---
>  libdtrace/dt_impl.h | 1 +
>  libdtrace/dt_map.c  | 4 ++++
>  2 files changed, 5 insertions(+)
> 
> diff --git a/libdtrace/dt_impl.h b/libdtrace/dt_impl.h
> index 258ec810..bf31bd76 100644
> --- a/libdtrace/dt_impl.h
> +++ b/libdtrace/dt_impl.h
> @@ -344,6 +344,7 @@ struct dtrace_hdl {
>  	dtrace_datadesc_t **dt_ddesc; /* probe data descriptions */
>  	dtrace_probedesc_t **dt_pdesc; /* probe descriptions for enabled prbs */
>  	size_t dt_maxagg;	/* max aggregation ID */
> +	size_t dt_aggsiz;	/* max value size in aggs BPF map */
>  	dtrace_aggdesc_t **dt_adesc; /* aggregation descriptions */
>  	int dt_maxformat;	/* max format ID */
>  	dt_aggregate_t dt_aggregate; /* aggregate */
> diff --git a/libdtrace/dt_map.c b/libdtrace/dt_map.c
> index 338f5df4..bec12bee 100644
> --- a/libdtrace/dt_map.c
> +++ b/libdtrace/dt_map.c
> @@ -298,6 +298,10 @@ dt_aggid_add(dtrace_hdl_t *dtp, const dt_ident_t *aid, int nrecs)
>  	recs[nrecs - 1].dtrd_action = ((dt_ident_t *) aid->di_iarg)->di_id;
>  	recs[nrecs - 1].dtrd_size = (aid->di_size - sizeof(uint64_t)) / DT_AGG_NUM_COPIES;
>  
> +	/* update dt_aggsiz */
> +	if (dtp->dt_aggsiz < aid->di_size)
> +		dtp->dt_aggsiz = aid->di_size;
> +
>  	dtp->dt_adesc[id] = agg;
>  
>  	return 0;
> -- 
> 2.18.4
> 
> 
> _______________________________________________
> DTrace-devel mailing list
> DTrace-devel at oss.oracle.com
> https://oss.oracle.com/mailman/listinfo/dtrace-devel



More information about the DTrace-devel mailing list