Skip to content

Commit

Permalink
chore: re-use existing function logic
Browse files Browse the repository at this point in the history
  • Loading branch information
bduranleau-nr committed Jun 11, 2024
1 parent 64c6306 commit f3164c6
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions agent/php_wrapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,17 +79,18 @@ nruserfn_t* nr_php_wrap_user_function_before_after_clean_extra(
nrspecialfn_t before_callback,
nrspecialfn_t after_callback,
nrspecialfn_t clean_callback,
const char *extra) {

nruserfn_t* wraprec = nr_php_add_custom_tracer_named(name, namelen);
const char* extra) {
nruserfn_t* wraprec = nr_php_wrap_user_function_before_after_clean(
name, namelen, before_callback, after_callback, clean_callback);

if (nrunlikely(NULL == wraprec)) {
nrl_warning(NRL_INSTRUMENT, "%s: unable to wrap '%s'", __func__,
NRSAFESTR(name));
return wraprec;
}

wraprec->extra = extra;

nr_php_wraprec_add_before_after_clean_callbacks(name, namelen, wraprec,
before_callback,
after_callback,
clean_callback);

return wraprec;
}

Expand Down

0 comments on commit f3164c6

Please sign in to comment.