Skip to content

Commit

Permalink
Assemble tuple components at predictable offsets
Browse files Browse the repository at this point in the history
We concatenate tuple components in the tuple assembly area.  When a
component is a string, we place the following component immediately
after the terminating NUL byte.

We will use this same tuple-assembly code to support aggregation keys,
however, and for printing aggregation keys it would be nice for each
key to start at a predictable offset.  Make that change in dt_cg_arglist().

Signed-off-by: Eugene Loh <eugene.loh@oracle.com>
Reviewed-by: Kris Van Hees <kris.van.hees@oracle.com>
  • Loading branch information
euloh authored and kvanhees committed Aug 5, 2022
1 parent 59d8f9d commit 2240e0c
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions libdtrace/dt_cg.c
Original file line number Diff line number Diff line change
Expand Up @@ -2706,13 +2706,10 @@ dt_cg_arglist(dt_ident_t *idp, dt_node_t *args, dt_irlist_t *dlp,
dt_regset_free(drp, BPF_REG_0);
dt_cg_probe_error(yypcb, DTRACEFLT_BADADDR,
DT_ISIMM, 128 + i);
dt_regset_xalloc(drp, BPF_REG_0);

emitl(dlp, lbl_valid,
BPF_ALU64_REG(BPF_ADD, treg, BPF_REG_0));
BPF_ALU64_IMM(BPF_ADD, treg, size + 1));
tuplesize += size + 1;

dt_regset_free(drp, BPF_REG_0);
} else if (t.dtdt_flags & DIF_TF_BYREF) {
uint_t lbl_valid = dt_irlist_label(dlp);

Expand Down

0 comments on commit 2240e0c

Please sign in to comment.