Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implementation of the printa() action
Given the design for the handling of aggregation data, there is no further need for cummulative data retrieval using snapshots. When we are ready to display aggregation data, we can retrieve the data by performing a key 0 BPF map lookup on the 'aggs' map. It gives us all data for all CPUs in a single buffer. The consumer processes the per-CPU aggregation data and aggregates it into its final values. The retrieval of aggregation data from the kernel does not pose any concurrent access issues and therefore does not make use of the latch sequence mechanism that the producer provides. This is because the data is currently stored in a regular BPF map that requires the use of the bpf_map_lookup_elem syscall option. This copies out the data with preemption disabled. Change summary: Global - General code cleanup - Replace dtrace_aggvarid_t by dtrace_aggid_t - Replace DTRACEAGG_* constants with DT_AGG_* constants cmd/dtrace.c - Remove disabling of default agg printing include/dtrace/metadesc.h struct dtrace_aggdesc - Removed dtagd_epid and dtagd_pad - Added dtagd_sig (lquantize and llquantize parameters) - Replaced dtagd_rec[1] with *dtagd_recs libdtrace/dt_aggregate.c - Switch from retrieving per-CPU aggregation data using ioctl() to retrieving the BPF map value for key 0 from the 'aggs' map. The order of aggregation data blocks is defined by the order of the aggregations (by ID) in the dt_aggs idhash. libdtrace/dt_cg.c - Add support for storing aggregation IDs in dt_cg_store_val() - Implement printa() libdtrace/dt_consume.c - Remove obsolete support for reading parameters from first data value - Pass encoded agg function parameters to dt_print_datum() - Pass encoded lquantize parameters to dt_print_lquantize() - Pass encoded llquantize parameters to dt_print_llquantize() - Implement dt_printa() libdtrace/dt_map.c - Rewrite dt_aggid_add() to not try to retrieve data from the kernel using ioctl() calls but instead construct the data description based on the aggregation identifier. libdtrace/dt_printf.c - Adjust pfprint_*() functions to passing agg func parameters libdtrace/dt_work.c: - Move the call to dt_aggregate_go() to before the BEGIN probe to ensure that setting up the consumer side for aggregation handling does not affect whatever work is done in the BEGIN probe program. libdtrace/dtrace.h struct dtrace_aggdata - Renamed dtada_handle -> dtada_hdl - Removed dtada_ddesc and dtada_pdesc Tests - Various tests have been renamed to make their meaning more clear - Various tests have been adjusted to more accurately test things Signed-off-by: Kris Van Hees <kris.van.hees@oracle.com>
- Loading branch information