[DTrace-devel] [PATCH 1/3] Implement a 'state' BPF map to communicate tracing session state

Eugene Loh eugene.loh at oracle.com
Fri Sep 4 12:48:12 PDT 2020


Oops.  One more minor thing:


On 08/27/2020 11:54 AM, Kris Van Hees wrote:
> The is a need to communicate information about the tracing session
> between the BPF programs we generate and the userspace consumer.  The
> current need covers:
> - DT_STATE_ACTIVITY	Records the activity state of the session
> - DT_STATE_BEGANON	Records the CPU the BEGIN probe ran on
> - DT_STATE_ENDEDON	Records the CPU the END probe ran on
>
> diff --git a/libdtrace/dt_state.h b/libdtrace/dt_state.h
> new file mode 100644
> index 00000000..9acb66b2
> --- /dev/null
> +++ b/libdtrace/dt_state.h
> @@ -0,0 +1,27 @@
> +/*
> + * Licensed under the Universal Permissive License v 1.0 as shown at
> + * http://oss.oracle.com/licenses/upl.
> + *
> + * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
> + */
> +
> +#ifndef _DT_STATE_H
> +#define _DT_STATE_H
> +
> +/*
> + * DTrace 'state' BPF map.
> + *
> + * The keys are uint32_t values corresponding to dt_state_elem_t values.
> + * The values are uint32_t values.
> + */
> +#define DT_STATE_KEY_TYPE	uint32_t
> +#define DT_STATE_VAL_TYPE	uint32_t
> +
> +typedef enum dt_state_elem {
> +	DT_STATE_ACTIVITY	= 0,	/* activity state of the seesion */

seesion -> session

And since:
*)  the line will be modified anyhow to fix this typo
*)  you decide in a future patch to reformat s/\t=/ =\t/
just convert that tab before the = to a space here, where the code is 
being introduced.

> +	DT_STATE_BEGANON,		/* cpu BEGIN probe executed on */
> +	DT_STATE_ENDEDON,		/* cpu END probe executed on */
> +	DT_STATE_NUM_ELEMS
> +} dt_state_elem_t;
> +
> +#endif /* _DT_STATE_H */




More information about the DTrace-devel mailing list