diff --git a/libmcount/mcount.c b/libmcount/mcount.c index a659abc60..6cfcba57f 100644 --- a/libmcount/mcount.c +++ b/libmcount/mcount.c @@ -1135,7 +1135,7 @@ void mcount_exit_filter_record(struct mcount_thread_data *mtdp, struct mcount_re mtdp->record_idx--; if (!mcount_enabled) - return; + goto out; if (!(rstack->flags & MCOUNT_FL_RETVAL)) retval = NULL; @@ -1179,6 +1179,7 @@ void mcount_exit_filter_record(struct mcount_thread_data *mtdp, struct mcount_re mtdp->nr_events = k; /* invalidate sync events */ } +out: /* script hooking for function exit */ if (script_str) script_hook_exit(mtdp, rstack); @@ -1755,6 +1756,8 @@ static void mcount_script_init(enum uftrace_pattern_type patt_type) if (script_init(&info, patt_type) < 0) script_str = NULL; + else if (!info.record) + mcount_enabled = false; } static int agent_init(struct sockaddr_un *addr) diff --git a/scripts/info.c b/scripts/info.c index e8d508623..10440f7f5 100644 --- a/scripts/info.c +++ b/scripts/info.c @@ -9,6 +9,9 @@ void uftrace_begin(struct uftrace_script_info *sc_info) printf("%s\n", sc_info->version); printf("%s\n", sc_info->name); printf("%s\n", sc_info->cmds); + + /* disable actual data record by uftrace */ + sc_info->record = false; } void uftrace_entry(struct uftrace_script_base_ctx *sc_ctx)