Skip to content

Commit dfea08a

Browse files
shellbombsrostedt
authored andcommitted
tracing/kprobes: 'nmissed' not showed correctly for kretprobe
The 'nmissed' column of the 'kprobe_profile' file for kretprobe is not showed correctly, kretprobe can be skipped by two reasons, shortage of kretprobe_instance which is counted by tk->rp.nmissed, and kprobe itself is missed by some reason, so to show the sum. Link: https://lkml.kernel.org/r/[email protected] Cc: [email protected] Fixes: 4a846b4 ("tracing/kprobes: Cleanup kprobe tracer code") Acked-by: Masami Hiramatsu <[email protected]> Signed-off-by: Xiangyang Zhang <[email protected]> Signed-off-by: Steven Rostedt <[email protected]>
1 parent 77360f9 commit dfea08a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

kernel/trace/trace_kprobe.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1170,15 +1170,18 @@ static int probes_profile_seq_show(struct seq_file *m, void *v)
11701170
{
11711171
struct dyn_event *ev = v;
11721172
struct trace_kprobe *tk;
1173+
unsigned long nmissed;
11731174

11741175
if (!is_trace_kprobe(ev))
11751176
return 0;
11761177

11771178
tk = to_trace_kprobe(ev);
1179+
nmissed = trace_kprobe_is_return(tk) ?
1180+
tk->rp.kp.nmissed + tk->rp.nmissed : tk->rp.kp.nmissed;
11781181
seq_printf(m, " %-44s %15lu %15lu\n",
11791182
trace_probe_name(&tk->tp),
11801183
trace_kprobe_nhit(tk),
1181-
tk->rp.kp.nmissed);
1184+
nmissed);
11821185

11831186
return 0;
11841187
}

0 commit comments

Comments
 (0)