Skip to content

RFC ftrace: track dynamic ftrace update failures

Abhishek Sagar lkml 1 version Applied

Status from this message: applied to tip/tracing/ftrace, thanks Abhishek.

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest3 patches 10 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/3ftrace: prevent freeing of all failed updatesinclude/linux/ftrace.h kernel/trace/ftrace.c+47 -304 replies
2/3ftrace: remove ftrace_ip_convertedarch/arm/kernel/ftrace.c arch/powerpc/kernel/ftrace.c arch/sparc64/kernel/ftrace.c +2 more+0 -441 reply
3/3ftrace: add debugfs entry 'failures'kernel/trace/ftrace.c+39 -11 reply

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/3][RFC] ftrace: track dynamic ftrace update failures

Hi Steven/Ingo,

In dynamic ftrace any record which fails gets freed to be recycled. This happens normally during (although not limited to) tracing of init functions. In general, failures can happen due to multiple reason, such as external patching of kernel functions, instrumentation of the mcount calls-sites, hardware error etc. As an example, in the case of kprobes if a probe is installed on the mcount call site (before being converted to NOP or after) then eventually ftrace will detect it and free the corresponding record. Kprobes however will keep on single-sepping the instruction it installed the probe on.

These patches prevent freeing of records which have failed (except for init functions). This prevents re-recording of failed functions and allows tracking them so that they can be listed using a new debugfs file -> 'failures'. The main change here is preventing removal of ftrace records from ftace_hash. This way records can be looked up by their 'ip' at any time.

--
Regards,
Abhishek Sagar