]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915: Copy name string into ring buffer for intel_update/disable_plane tracepoints
authorSteven Rostedt (VMware) <rostedt@goodmis.org>
Wed, 10 Jul 2019 17:12:30 +0000 (20:12 +0300)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Thu, 11 Jul 2019 19:53:20 +0000 (22:53 +0300)
commit916a642d235071285bb196035fdb37d9004217e1
tree334fc7b7cce1e370e9d73d653752d32f8d79f8fe
parent5499eaa4e8ac29800b7783b66486e079a0e0ba50
drm/i915: Copy name string into ring buffer for intel_update/disable_plane tracepoints

Currently the intel_update_plane and intel_disable_plane tracepoints record
the address of plane->name in the ring buffer, and then when reading the
ring buffer uses %s to get the name. The issue with this, is that those two
events can be minutes, hours or even days apart. It is very dangerous to
dereference a string pointer without knowing if it still exists or not.

The proper way to handle this is to use the __string() macro in the
tracepoint which will save the string into the ring buffer at the time of
recording. Then there's no worries if the original string still exists in
memory when the ring buffer is read.

Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
[vsyrjala: Rebase on top of drm-tip]
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190710171230.7471-1-ville.syrjala@linux.intel.com
drivers/gpu/drm/i915/i915_trace.h