Skip to content

Commit

Permalink
Tune DTrace 'aframes' for the FBT and profile providers on arm64.
Browse files Browse the repository at this point in the history
In both cases, too few frames were trimmed, leading to exception handling
or DTrace internals being exposed in stack traces exposed by D's stack()
primitive.

MFC after:	3 days
Reviewed by:	emaste, andrew
  • Loading branch information
rwatson committed Mar 22, 2021
1 parent 9f88bee commit 599fb1d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
5 changes: 3 additions & 2 deletions sys/cddl/dev/fbt/aarch64/fbt_isa.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
#define FBT_PATCHVAL (AARCH64_BRK | AARCH64_BRK_IMM16_VAL)
#define FBT_ENTRY "entry"
#define FBT_RETURN "return"
#define FBT_AFRAMES 4

int
fbt_invop(uintptr_t addr, struct trapframe *frame, uintptr_t rval)
Expand Down Expand Up @@ -154,7 +155,7 @@ fbt_provide_module_function(linker_file_t lf, int symindx,
fbt = malloc(sizeof (fbt_probe_t), M_FBT, M_WAITOK | M_ZERO);
fbt->fbtp_name = name;
fbt->fbtp_id = dtrace_probe_create(fbt_id, modname,
name, FBT_ENTRY, 3, fbt);
name, FBT_ENTRY, FBT_AFRAMES, fbt);
fbt->fbtp_patchpoint = instr;
fbt->fbtp_ctl = lf;
fbt->fbtp_loadcnt = lf->loadcnt;
Expand Down Expand Up @@ -196,7 +197,7 @@ fbt_provide_module_function(linker_file_t lf, int symindx,
fbt->fbtp_name = name;
if (retfbt == NULL) {
fbt->fbtp_id = dtrace_probe_create(fbt_id, modname,
name, FBT_RETURN, 3, fbt);
name, FBT_RETURN, FBT_AFRAMES, fbt);
} else {
retfbt->fbtp_probenext = fbt;
fbt->fbtp_id = retfbt->fbtp_id;
Expand Down
3 changes: 1 addition & 2 deletions sys/cddl/dev/profile/profile.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,7 @@ struct profile_probe_percpu;
#endif

#ifdef __aarch64__
/* TODO: verify */
#define PROF_ARTIFICIAL_FRAMES 10
#define PROF_ARTIFICIAL_FRAMES 12
#endif

#ifdef __riscv
Expand Down

0 comments on commit 599fb1d

Please sign in to comment.