1. 03 Nov, 2015 1 commit
  2. 02 Nov, 2015 14 commits
  3. 26 Oct, 2015 5 commits
    • Steven Rostedt (Red Hat)'s avatar
      tracing: Fix sparse RCU warning · fb662288
      Steven Rostedt (Red Hat) authored
      p_start() and p_stop() are seq_file functions that match. Teach sparse to
      know that rcu_read_lock_sched() that is taken by p_start() is released by
      p_stop.
      Reported-by: default avatarkbuild test robot <fengguang.wu@intel.com>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      fb662288
    • Steven Rostedt (Red Hat)'s avatar
      tracing: Check all tasks on each CPU when filtering pids · 8ca532ad
      Steven Rostedt (Red Hat) authored
      My tests found that if a task is running but not filtered when set_event_pid
      is modified, then it can still be traced.
      
      Call on_each_cpu() to check if the current running task should be filtered
      and update the per cpu flags of tr->data appropriately.
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      8ca532ad
    • Steven Rostedt (Red Hat)'s avatar
      tracing: Implement event pid filtering · 3fdaf80f
      Steven Rostedt (Red Hat) authored
      Add the necessary hooks to use the pids loaded in set_event_pid to filter
      all the events enabled in the tracing instance that match the pids listed.
      
      Two probes are added to both sched_switch and sched_wakeup tracepoints to be
      called before other probes are called and after the other probes are called.
      The first is used to set the necessary flags to let the probes know to test
      if they should be traced or not.
      
      The sched_switch pre probe will set the "ignore_pid" flag if neither the
      previous or next task has a matching pid.
      
      The sched_switch probe will set the "ignore_pid" flag if the next task
      does not match the matching pid.
      
      The pre probe allows for probes tracing sched_switch to be traced if
      necessary.
      
      The sched_wakeup pre probe will set the "ignore_pid" flag if neither the
      current task nor the wakee task has a matching pid.
      
      The sched_wakeup post probe will set the "ignore_pid" flag if the current
      task does not have a matching pid.
      
      Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      3fdaf80f
    • Steven Rostedt (Red Hat)'s avatar
      tracing: Add set_event_pid directory for future use · 49090107
      Steven Rostedt (Red Hat) authored
      Create a tracing directory called set_event_pid, which currently has no
      function, but will be used to filter all events for the tracing instance or
      the pids that are added to the file.
      
      The reason no functionality is added with this commit is that this commit
      focuses on the creation and removal of the pids in a safe manner. And tests
      can be made against this change to make sure things are correct before
      hooking features to the list of pids.
      
      Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      49090107
    • Steven Rostedt (Red Hat)'s avatar
      tracepoint: Give priority to probes of tracepoints · 7904b5c4
      Steven Rostedt (Red Hat) authored
      In order to guarantee that a probe will be called before other probes that
      are attached to a tracepoint, there needs to be a mechanism to provide
      priority of one probe over the others.
      
      Adding a prio field to the struct tracepoint_func, which lets the probes be
      sorted by the priority set in the structure. If no priority is specified,
      then a priority of 10 is given (this is a macro, and perhaps may be changed
      in the future).
      
      Now probes may be added to affect other probes that are attached to a
      tracepoint with a guaranteed order.
      
      One use case would be to allow tracing of tracepoints be able to filter by
      pid. A special (higher priority probe) may be added to the sched_switch
      tracepoint and set the necessary flags of the other tracepoints to notify
      them if they should be traced or not. In case a tracepoint is enabled at the
      sched_switch tracepoint too, the order of the two are not random.
      
      Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      7904b5c4
  4. 22 Oct, 2015 1 commit
  5. 21 Oct, 2015 5 commits
  6. 20 Oct, 2015 1 commit
  7. 16 Oct, 2015 1 commit
  8. 14 Oct, 2015 1 commit
  9. 01 Oct, 2015 2 commits
  10. 30 Sep, 2015 9 commits
    • Steven Rostedt (Red Hat)'s avatar
      tracing: Add trace options for tracer options to instances · 37aea98b
      Steven Rostedt (Red Hat) authored
      Add the tracer options to instances options directory as well. Only add the
      options for tracers that are allowed to be enabled by an instance. But note,
      that tracer options are global. That is, tracer options enabled in an
      instance, also take affect at the top level and in other instances.
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      37aea98b
    • Steven Rostedt (Red Hat)'s avatar
      tracing: Add trace options for core options to instances · 16270145
      Steven Rostedt (Red Hat) authored
      Allow instances to have their own options, at least for the core options
      (non tracer specific ones). There are a few global options that should not
      be added to instances, like enabling of trace_printk, and the sched comm
      recording, which do not have a specific trace instance associated to them.
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      16270145
    • Steven Rostedt (Red Hat)'s avatar
      tracing: Make ftrace_trace_stack() depend on general trace_array flag · 2d34f489
      Steven Rostedt (Red Hat) authored
      In preparation for the multi buffer instances to have their own trace_flags,
      the check in ftrace_trace_stack() needs to test the trace_array descriptor
      flag that is for the current event, not the global_trace descriptor.
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      2d34f489
    • Steven Rostedt (Red Hat)'s avatar
      tracing: Add a method to pass in trace_array descriptor to option files · 9a38a885
      Steven Rostedt (Red Hat) authored
      In preparation of having the multi buffer instances having their own trace
      option flags, the trace option files needs a way to not only pass in the
      flag they represent, but also the trace_array descriptor.
      
      A new field is added to the trace_array descriptor called trace_flags_index,
      which is a 32 byte character array representing a bit. This array is simply
      filled with the index of the array, where
      
        index_array[n] = n;
      
      Then the address of this array is passed to the file callbacks instead of
      the index of the flag index. Then to retrieve both the flag index and the
      trace_array descriptor:
      
        data is the passed in argument.
      
        index = *(unsigned char *)data;
      
        data -= index;
      
        /* Now data points to the address of the array in the trace_array */
      
        tr = container_of(data, struct trace_array, trace_flags_index);
      Suggested-by: default avatarJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      9a38a885
    • Steven Rostedt (Red Hat)'s avatar
      tracing: Move trace_flags from global to a trace_array field · 983f938a
      Steven Rostedt (Red Hat) authored
      In preparation to make trace options per instance, the global trace_flags
      needs to be moved from being a global variable to a field within the trace
      instance trace_array structure.
      
      There's still more work to do, as there's some functions that use
      trace_flags without passing in a way to get to the current_trace array. For
      those, the global_trace is used directly (from trace.c). This includes
      setting and clearing the trace_flags. This means that when a new instance is
      created, it just gets the trace_flags of the global_trace and will not be
      able to modify them. Depending on the functions that have access to the
      trace_array, the flags of an instance may not affect parts of its trace,
      where the global_trace is used. These will be fixed in future changes.
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      983f938a
    • Steven Rostedt (Red Hat)'s avatar
      tracing: Move sleep-time and graph-time options out of the core trace_flags · 55577204
      Steven Rostedt (Red Hat) authored
      The sleep-time and graph-time options are only for the function graph tracer
      and are not used by anything else. As tracer options are now visible when
      the tracer is not activated, its better to move the function graph specific
      tracer options into the function graph tracer.
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      55577204
    • Steven Rostedt (Red Hat)'s avatar
      tracing: Remove access to trace_flags in trace_printk.c · b9f9108c
      Steven Rostedt (Red Hat) authored
      In the effort to move the global trace_flags to the tracing instances, the
      direct access to trace_flags must be removed from trace_printk.c
      
      Instead, add a new trace_printk_enabled boolean that is set by a new access
      function trace_printk_control(), that will enable or disable trace_printk.
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      b9f9108c
    • Steven Rostedt (Red Hat)'s avatar
      tracing: Add build bug if we have more trace_flags than bits · b5e87c05
      Steven Rostedt (Red Hat) authored
      Add a enum that denotes the last bit of the trace_flags and have a
      BUILD_BUG_ON(last_bit > 32).
      
      If we add more bits than we have in trace_flags, the kernel wont build.
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      b5e87c05
    • Steven Rostedt (Red Hat)'s avatar
      tracing: Always show all tracer options in the options directory · 41d9c0be
      Steven Rostedt (Red Hat) authored
      There are options that are unique to a specific tracer (like function and
      function graph). Currently, these options are only visible in the options
      directory when the tracer is enabled.
      
      This has been a pain, especially for something like the func_stack_trace
      option that if used inappropriately, could bring the system to a crawl. But
      the only way to see it, is to enable the function tracer.
      
      For example, if one had done:
      
       # cd /sys/kernel/tracing
       # echo __schedule > set_ftrace_filter
       # echo 1 > options/func_stack_trace
       # echo function > current_tracer
      
      The __schedule call will be traced and a stack trace will also be recorded
      there. Now when you were done, you may do...
      
       # echo nop > current_tracer
       # echo > set_ftrace_filter
      
      But you forgot to disable the func_stack_trace. The only way to disable it
      is to re-enable function tracing first. If you do not add a filter to
      set_ftrace_filter and just do:
      
       # echo function > current_tracer
      
      Now you would be performing a stack trace on *every* function! On some
      systems, that causes a live lock. Others may take a few minutes to fix your
      mistake.
      
      Having the func_stack_trace option visible allows you to check it and
      disable it before enabling the funtion tracer.
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      41d9c0be