1. 29 Jan, 2021 2 commits
    • Viktor Rosendahl's avatar
      tracing: Use pause-on-trace with the latency tracers · da7f84cd
      Viktor Rosendahl authored
      Eaerlier, tracing was disabled when reading the trace file. This behavior
      was changed with:
      
      commit 06e0a548 ("tracing: Do not disable tracing when reading the
      trace file").
      
      This doesn't seem to work with the latency tracers.
      
      The above mentioned commit dit not only change the behavior but also added
      an option to emulate the old behavior. The idea with this patch is to
      enable this pause-on-trace option when the latency tracers are used.
      
      Link: https://lkml.kernel.org/r/20210119164344.37500-2-Viktor.Rosendahl@bmw.de
      
      Cc: stable@vger.kernel.org
      Fixes: 06e0a548 ("tracing: Do not disable tracing when reading the trace file")
      Signed-off-by: default avatarViktor Rosendahl <Viktor.Rosendahl@bmw.de>
      Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
      da7f84cd
    • Steven Rostedt (VMware)'s avatar
      fgraph: Initialize tracing_graph_pause at task creation · 7e0a9220
      Steven Rostedt (VMware) authored
      On some archs, the idle task can call into cpu_suspend(). The cpu_suspend()
      will disable or pause function graph tracing, as there's some paths in
      bringing down the CPU that can have issues with its return address being
      modified. The task_struct structure has a "tracing_graph_pause" atomic
      counter, that when set to something other than zero, the function graph
      tracer will not modify the return address.
      
      The problem is that the tracing_graph_pause counter is initialized when the
      function graph tracer is enabled. This can corrupt the counter for the idle
      task if it is suspended in these architectures.
      
         CPU 1				CPU 2
         -----				-----
        do_idle()
          cpu_suspend()
            pause_graph_tracing()
                task_struct->tracing_graph_pause++ (0 -> 1)
      
      				start_graph_tracing()
      				  for_each_online_cpu(cpu) {
      				    ftrace_graph_init_idle_task(cpu)
      				      task-struct->tracing_graph_pause = 0 (1 -> 0)
      
            unpause_graph_tracing()
                task_struct->tracing_graph_pause-- (0 -> -1)
      
      The above should have gone from 1 to zero, and enabled function graph
      tracing again. But instead, it is set to -1, which keeps it disabled.
      
      There's no reason that the field tracing_graph_pause on the task_struct can
      not be initialized at boot up.
      
      Cc: stable@vger.kernel.org
      Fixes: 380c4b14 ("tracing/function-graph-tracer: append the tracing_graph_flag")
      Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=211339
      Reported-by: pierre.gondois@arm.com
      Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
      7e0a9220
  2. 25 Jan, 2021 1 commit
  3. 24 Jan, 2021 37 commits