Skip to content

Commit

Permalink
Provide the maximum string length as BPF symbol STRSZ
Browse files Browse the repository at this point in the history
Signed-off-by: Kris Van Hees <kris.van.hees@oracle.com>
Reviewed-by: Eugene Loh <eugene.loh@oracle.com>
  • Loading branch information
kvanhees committed Aug 20, 2021
1 parent d1401ac commit dd59e2f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
7 changes: 4 additions & 3 deletions libdtrace/dt_bpf.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ extern "C" {
#define DT_CONST_CLID 3
#define DT_CONST_ARGC 4
#define DT_CONST_STBSZ 5
#define DT_CONST_STKOFF 6
#define DT_CONST_STKSIZ 7
#define DT_CONST_BOOTTM 8
#define DT_CONST_STRSZ 6
#define DT_CONST_STKOFF 7
#define DT_CONST_STKSIZ 8
#define DT_CONST_BOOTTM 9

extern int perf_event_open(struct perf_event_attr *attr, pid_t pid, int cpu,
int group_fd, unsigned long flags);
Expand Down
4 changes: 4 additions & 0 deletions libdtrace/dt_cc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2348,6 +2348,10 @@ dt_link_construct(dtrace_hdl_t *dtp, const dt_probe_t *prp, dtrace_difo_t *dp,
case DT_CONST_STBSZ:
nrp->dofr_data = dtp->dt_strlen;
continue;
case DT_CONST_STRSZ:
nrp->dofr_data =
dtp->dt_options[DTRACEOPT_STRSIZE];
continue;
case DT_CONST_STKOFF:
nrp->dofr_data = roundup(dtp->dt_maxreclen, 8);
continue;
Expand Down
1 change: 1 addition & 0 deletions libdtrace/dt_dlibs.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ static const dt_ident_t dt_bpf_symbols[] = {
DT_BPF_SYMBOL_ID(CLID, DT_IDENT_SCALAR, DT_CONST_CLID),
DT_BPF_SYMBOL_ID(ARGC, DT_IDENT_SCALAR, DT_CONST_ARGC),
DT_BPF_SYMBOL_ID(STBSZ, DT_IDENT_SCALAR, DT_CONST_STBSZ),
DT_BPF_SYMBOL_ID(STRSZ, DT_IDENT_SCALAR, DT_CONST_STRSZ),
DT_BPF_SYMBOL_ID(STKOFF, DT_IDENT_SCALAR, DT_CONST_STKOFF),
DT_BPF_SYMBOL_ID(STKSIZ, DT_IDENT_SCALAR, DT_CONST_STKSIZ),
DT_BPF_SYMBOL_ID(BOOTTM, DT_IDENT_SCALAR, DT_CONST_BOOTTM),
Expand Down

0 comments on commit dd59e2f

Please sign in to comment.