Merge tag 'trace-3.15' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux...
authorLinus Torvalds <torvalds@linux-foundation.org>
Thu, 3 Apr 2014 17:26:31 +0000 (10:26 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 3 Apr 2014 17:26:31 +0000 (10:26 -0700)
Pull tracing updates from Steven Rostedt:
 "Most of the changes were largely clean ups, and some documentation.
  But there were a few features that were added:

  Uprobes now work with event triggers and multi buffers and have
  support under ftrace and perf.

  The big feature is that the function tracer can now be used within the
  multi buffer instances.  That is, you can now trace some functions in
  one buffer, others in another buffer, all functions in a third buffer
  and so on.  They are basically agnostic from each other.  This only
  works for the function tracer and not for the function graph trace,
  although you can have the function graph tracer running in the top
  level buffer (or any tracer for that matter) and have different
  function tracing going on in the sub buffers"

* tag 'trace-3.15' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: (45 commits)
  tracing: Add BUG_ON when stack end location is over written
  tracepoint: Remove unused API functions
  Revert "tracing: Move event storage for array from macro to standalone function"
  ftrace: Constify ftrace_text_reserved
  tracepoints: API doc update to tracepoint_probe_register() return value
  tracepoints: API doc update to data argument
  ftrace: Fix compilation warning about control_ops_free
  ftrace/x86: BUG when ftrace recovery fails
  ftrace: Warn on error when modifying ftrace function
  ftrace: Remove freelist from struct dyn_ftrace
  ftrace: Do not pass data to ftrace_dyn_arch_init
  ftrace: Pass retval through return in ftrace_dyn_arch_init()
  ftrace: Inline the code from ftrace_dyn_table_alloc()
  ftrace: Cleanup of global variables ftrace_new_pgs and ftrace_update_cnt
  tracing: Evaluate len expression only once in __dynamic_array macro
  tracing: Correctly expand len expressions from __dynamic_array macro
  tracing/module: Replace include of tracepoint.h with jump_label.h in module.h
  tracing: Fix event header migrate.h to include tracepoint.h
  tracing: Fix event header writeback.h to include tracepoint.h
  tracing: Warn if a tracepoint is not set via debugfs
  ...

1  2 
arch/mips/kernel/ftrace.c
arch/powerpc/kernel/ftrace.c
include/linux/ftrace_event.h
include/linux/tracepoint.h
include/trace/events/writeback.h
include/trace/ftrace.h
kernel/trace/blktrace.c
kernel/trace/trace.c
kernel/trace/trace_events.c
kernel/trace/trace_irqsoff.c
kernel/tracepoint.c

Simple merge
Simple merge
Simple merge
@@@ -60,26 -54,8 +54,14 @@@ struct tp_module 
        unsigned int num_tracepoints;
        struct tracepoint * const *tracepoints_ptrs;
  };
 +bool trace_module_has_bad_taint(struct module *mod);
 +#else
 +static inline bool trace_module_has_bad_taint(struct module *mod)
 +{
 +      return false;
 +}
  #endif /* CONFIG_MODULES */
  
- struct tracepoint_iter {
- #ifdef CONFIG_MODULES
-       struct tp_module *module;
- #endif /* CONFIG_MODULES */
-       struct tracepoint * const *tracepoint;
- };
- extern void tracepoint_iter_start(struct tracepoint_iter *iter);
- extern void tracepoint_iter_next(struct tracepoint_iter *iter);
- extern void tracepoint_iter_stop(struct tracepoint_iter *iter);
- extern void tracepoint_iter_reset(struct tracepoint_iter *iter);
  /*
   * tracepoint_synchronize_unregister must be called between the last tracepoint
   * probe unregistration and the end of module exit to make sure there is no
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -438,209 -456,16 +456,21 @@@ int tracepoint_probe_unregister(const c
  }
  EXPORT_SYMBOL_GPL(tracepoint_probe_unregister);
  
- static LIST_HEAD(old_probes);
- static int need_update;
- static void tracepoint_add_old_probes(void *old)
- {
-       need_update = 1;
-       if (old) {
-               struct tp_probes *tp_probes = container_of(old,
-                       struct tp_probes, probes[0]);
-               list_add(&tp_probes->u.list, &old_probes);
-       }
- }
- /**
-  * tracepoint_probe_register_noupdate -  register a probe but not connect
-  * @name: tracepoint name
-  * @probe: probe handler
-  *
-  * caller must call tracepoint_probe_update_all()
-  */
- int tracepoint_probe_register_noupdate(const char *name, void *probe,
-                                      void *data)
- {
-       struct tracepoint_func *old;
-       mutex_lock(&tracepoints_mutex);
-       old = tracepoint_add_probe(name, probe, data);
-       if (IS_ERR(old)) {
-               mutex_unlock(&tracepoints_mutex);
-               return PTR_ERR(old);
-       }
-       tracepoint_add_old_probes(old);
-       mutex_unlock(&tracepoints_mutex);
-       return 0;
- }
- EXPORT_SYMBOL_GPL(tracepoint_probe_register_noupdate);
- /**
-  * tracepoint_probe_unregister_noupdate -  remove a probe but not disconnect
-  * @name: tracepoint name
-  * @probe: probe function pointer
-  *
-  * caller must call tracepoint_probe_update_all()
-  */
- int tracepoint_probe_unregister_noupdate(const char *name, void *probe,
-                                        void *data)
- {
-       struct tracepoint_func *old;
-       mutex_lock(&tracepoints_mutex);
-       old = tracepoint_remove_probe(name, probe, data);
-       if (IS_ERR(old)) {
-               mutex_unlock(&tracepoints_mutex);
-               return PTR_ERR(old);
-       }
-       tracepoint_add_old_probes(old);
-       mutex_unlock(&tracepoints_mutex);
-       return 0;
- }
- EXPORT_SYMBOL_GPL(tracepoint_probe_unregister_noupdate);
- /**
-  * tracepoint_probe_update_all -  update tracepoints
-  */
- void tracepoint_probe_update_all(void)
- {
-       LIST_HEAD(release_probes);
-       struct tp_probes *pos, *next;
-       mutex_lock(&tracepoints_mutex);
-       if (!need_update) {
-               mutex_unlock(&tracepoints_mutex);
-               return;
-       }
-       if (!list_empty(&old_probes))
-               list_replace_init(&old_probes, &release_probes);
-       need_update = 0;
-       tracepoint_update_probes();
-       mutex_unlock(&tracepoints_mutex);
-       list_for_each_entry_safe(pos, next, &release_probes, u.list) {
-               list_del(&pos->u.list);
-               call_rcu_sched(&pos->u.rcu, rcu_free_old_probes);
-       }
- }
- EXPORT_SYMBOL_GPL(tracepoint_probe_update_all);
- /**
-  * tracepoint_get_iter_range - Get a next tracepoint iterator given a range.
-  * @tracepoint: current tracepoints (in), next tracepoint (out)
-  * @begin: beginning of the range
-  * @end: end of the range
-  *
-  * Returns whether a next tracepoint has been found (1) or not (0).
-  * Will return the first tracepoint in the range if the input tracepoint is
-  * NULL.
-  */
- static int tracepoint_get_iter_range(struct tracepoint * const **tracepoint,
-       struct tracepoint * const *begin, struct tracepoint * const *end)
- {
-       if (!*tracepoint && begin != end) {
-               *tracepoint = begin;
-               return 1;
-       }
-       if (*tracepoint >= begin && *tracepoint < end)
-               return 1;
-       return 0;
- }
- #ifdef CONFIG_MODULES
- static void tracepoint_get_iter(struct tracepoint_iter *iter)
- {
-       int found = 0;
-       struct tp_module *iter_mod;
-       /* Core kernel tracepoints */
-       if (!iter->module) {
-               found = tracepoint_get_iter_range(&iter->tracepoint,
-                               __start___tracepoints_ptrs,
-                               __stop___tracepoints_ptrs);
-               if (found)
-                       goto end;
-       }
-       /* Tracepoints in modules */
-       mutex_lock(&tracepoints_mutex);
-       list_for_each_entry(iter_mod, &tracepoint_module_list, list) {
-               /*
-                * Sorted module list
-                */
-               if (iter_mod < iter->module)
-                       continue;
-               else if (iter_mod > iter->module)
-                       iter->tracepoint = NULL;
-               found = tracepoint_get_iter_range(&iter->tracepoint,
-                       iter_mod->tracepoints_ptrs,
-                       iter_mod->tracepoints_ptrs
-                               + iter_mod->num_tracepoints);
-               if (found) {
-                       iter->module = iter_mod;
-                       break;
-               }
-       }
-       mutex_unlock(&tracepoints_mutex);
- end:
-       if (!found)
-               tracepoint_iter_reset(iter);
- }
- #else /* CONFIG_MODULES */
- static void tracepoint_get_iter(struct tracepoint_iter *iter)
- {
-       int found = 0;
-       /* Core kernel tracepoints */
-       found = tracepoint_get_iter_range(&iter->tracepoint,
-                       __start___tracepoints_ptrs,
-                       __stop___tracepoints_ptrs);
-       if (!found)
-               tracepoint_iter_reset(iter);
- }
- #endif /* CONFIG_MODULES */
- void tracepoint_iter_start(struct tracepoint_iter *iter)
- {
-       tracepoint_get_iter(iter);
- }
- EXPORT_SYMBOL_GPL(tracepoint_iter_start);
- void tracepoint_iter_next(struct tracepoint_iter *iter)
- {
-       iter->tracepoint++;
-       /*
-        * iter->tracepoint may be invalid because we blindly incremented it.
-        * Make sure it is valid by marshalling on the tracepoints, getting the
-        * tracepoints from following modules if necessary.
-        */
-       tracepoint_get_iter(iter);
- }
- EXPORT_SYMBOL_GPL(tracepoint_iter_next);
- void tracepoint_iter_stop(struct tracepoint_iter *iter)
- {
- }
- EXPORT_SYMBOL_GPL(tracepoint_iter_stop);
- void tracepoint_iter_reset(struct tracepoint_iter *iter)
- {
- #ifdef CONFIG_MODULES
-       iter->module = NULL;
- #endif /* CONFIG_MODULES */
-       iter->tracepoint = NULL;
- }
- EXPORT_SYMBOL_GPL(tracepoint_iter_reset);
  
  #ifdef CONFIG_MODULES
 +bool trace_module_has_bad_taint(struct module *mod)
 +{
 +      return mod->taints & ~((1 << TAINT_OOT_MODULE) | (1 << TAINT_CRAP));
 +}
 +
  static int tracepoint_module_coming(struct module *mod)
  {
-       struct tp_module *tp_mod, *iter;
+       struct tp_module *tp_mod;
        int ret = 0;
  
+       if (!mod->num_tracepoints)
+               return 0;
        /*
         * We skip modules that taint the kernel, especially those with different
         * module headers (for forced load), to make sure we don't cause a crash.