Skip to content

Commit

Permalink
cg: wrap dctx and dctx->member accesses in a function
Browse files Browse the repository at this point in the history
Introduce dt_cg_access_dctx() to implement access to the DTrace context
and members therein for both regular programs and trampolines.

Replace
	BPF_LOAD(BPF_DW, <reg>, BPF_REG_FP, DT_STK_DCTX)
	BPF_LOAD(<size>, <reg>, <reg>, <member>)
with
	dt_cg_access_dctx(<reg>, dlp, drp, <member>)

Replace
	BPF_LOAD(BPF_DW, <reg>, BPF_REG_FP, DT_STK_DCTX)
	(not followed by access to a member of dctx)
with
	dt_cg_access_dctx(<reg>, dlp, drp, -1)

Signed-off-by: Kris Van Hees <kris.van.hees@oracle.com>
Reviewed-by: Nick Alcock <nick.alcock@oracle.com>
  • Loading branch information
kvanhees committed Jan 18, 2024
1 parent ff3b2e1 commit a271d8a
Showing 1 changed file with 70 additions and 84 deletions.

0 comments on commit a271d8a

Please sign in to comment.