Skip to content
Snippets Groups Projects
  1. May 23, 2011
  2. May 20, 2011
  3. May 19, 2011
  4. May 18, 2011
    • Steven Rostedt's avatar
      ftrace: Add self-tests for multiple function trace users · 95950c2e
      Steven Rostedt authored
      
      Add some basic sanity tests for multiple users of the function
      tracer at startup.
      
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      95950c2e
    • Steven Rostedt's avatar
      ftrace: Modify ftrace_set_filter/notrace to take ops · 936e074b
      Steven Rostedt authored
      
      Since users of the function tracer can now pick and choose which
      functions they want to trace agnostically from other users of the
      function tracer, we need to pass the ops struct to the ftrace_set_filter()
      functions.
      
      The functions ftrace_set_global_filter() and ftrace_set_global_notrace()
      is added to keep the old filter functions which are used to modify
      the generic function tracers.
      
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      936e074b
    • Steven Rostedt's avatar
      ftrace: Allow dynamically allocated function tracers · cdbe61bf
      Steven Rostedt authored
      
      Now that functions may be selected individually, it only makes sense
      that we should allow dynamically allocated trace structures to
      be traced. This will allow perf to allocate a ftrace_ops structure
      at runtime and use it to pick and choose which functions that
      structure will trace.
      
      Note, a dynamically allocated ftrace_ops will always be called
      indirectly instead of being called directly from the mcount in
      entry.S. This is because there's no safe way to prevent mcount
      from being preempted before calling the function, unless we
      modify every entry.S to do so (not likely). Thus, dynamically allocated
      functions will now be called by the ftrace_ops_list_func() that
      loops through the ops that are allocated if there are more than
      one op allocated at a time. This loop is protected with a
      preempt_disable.
      
      To determine if an ftrace_ops structure is allocated or not, a new
      util function was added to the kernel/extable.c called
      core_kernel_data(), which returns 1 if the address is between
      _sdata and _edata.
      
      Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      cdbe61bf
    • Steven Rostedt's avatar
      ftrace: Implement separate user function filtering · b848914c
      Steven Rostedt authored
      
      ftrace_ops that are registered to trace functions can now be
      agnostic to each other in respect to what functions they trace.
      Each ops has their own hash of the functions they want to trace
      and a hash to what they do not want to trace. A empty hash for
      the functions they want to trace denotes all functions should
      be traced that are not in the notrace hash.
      
      Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      b848914c
    • Steven Rostedt's avatar
      ftrace: Free hash with call_rcu_sched() · 07fd5515
      Steven Rostedt authored
      
      When a hash is modified and might be in use, we need to perform
      a schedule RCU operation on it, as the hashes will soon be used
      directly in the function tracer callback.
      
      Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      07fd5515
    • Steven Rostedt's avatar
      ftrace: Have global_ops store the functions that are to be traced · 2b499381
      Steven Rostedt authored
      
      This is a step towards each ops structure defining its own set
      of functions to trace. As the current code with pid's and such
      are specific to the global_ops, it is restructured to be used
      with the global ops.
      
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      2b499381
    • Steven Rostedt's avatar
      ftrace: Add ops parameter to ftrace_startup/shutdown functions · bd69c30b
      Steven Rostedt authored
      
      In order to allow different ops to enable different functions,
      the ftrace_startup() and ftrace_shutdown() functions need the
      ops parameter passed to them.
      
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      bd69c30b
    • Steven Rostedt's avatar
      ftrace: Add enabled_functions file · 647bcd03
      Steven Rostedt authored
      
      Add the enabled_functions file that is used to show all the
      functions that have been enabled for tracing as well as their
      ref counts. This helps seeing if any function has been registered
      and what functions are being traced.
      
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      647bcd03
    • Steven Rostedt's avatar
      ftrace: Use counters to enable functions to trace · ed926f9b
      Steven Rostedt authored
      
      Every function has its own record that stores the instruction
      pointer and flags for the function to be traced. There are only
      two flags: enabled and free. The enabled flag states that tracing
      for the function has been enabled (actively traced), and the free
      flag states that the record no longer points to a function and can
      be used by new functions (loaded modules).
      
      These flags are now moved to the MSB of the flags (actually just
      the top 32bits). The rest of the bits (30 bits) are now used as
      a ref counter. Everytime a tracer register functions to trace,
      those functions will have its counter incremented.
      
      When tracing is enabled, to determine if a function should be traced,
      the counter is examined, and if it is non-zero it is set to trace.
      
      When a ftrace_ops is registered to trace functions, its hashes
      are examined. If the ftrace_ops filter_hash count is zero, then
      all functions are set to be traced, otherwise only the functions
      in the hash are to be traced. The exception to this is if a function
      is also in the ftrace_ops notrace_hash. Then that function's counter
      is not incremented for this ftrace_ops.
      
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      ed926f9b
    • Steven Rostedt's avatar
      ftrace: Separate hash allocation and assignment · 33dc9b12
      Steven Rostedt authored
      
      When filtering, allocate a hash to insert the function records.
      After the filtering is complete, assign it to the ftrace_ops structure.
      
      This allows the ftrace_ops structure to have a much smaller array of
      hash buckets instead of wasting a lot of memory.
      
      A read only empty_hash is created to be the minimum size that any ftrace_ops
      can point to.
      
      When a new hash is created, it has the following steps:
      
      o Allocate a default hash.
      o Walk the function records assigning the filtered records to the hash
      o Allocate a new hash with the appropriate size buckets
      o Move the entries from the default hash to the new hash.
      
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      33dc9b12
    • Steven Rostedt's avatar
      ftrace: Create a global_ops to hold the filter and notrace hashes · f45948e8
      Steven Rostedt authored
      
      Combine the filter and notrace hashes to be accessed by a single entity,
      the global_ops. The global_ops is a ftrace_ops structure that is passed
      to different functions that can read or modify the filtering of the
      function tracer.
      
      The ftrace_ops structure was modified to hold a filter and notrace
      hashes so that later patches may allow each ftrace_ops to have its own
      set of rules to what functions may be filtered.
      
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      f45948e8
    • Steven Rostedt's avatar
      ftrace: Use hash instead for FTRACE_FL_FILTER · 1cf41dd7
      Steven Rostedt authored
      
      When multiple users are allowed to have their own set of functions
      to trace, having the FTRACE_FL_FILTER flag will not be enough to
      handle the accounting of those users. Each user will need their own
      set of functions.
      
      Replace the FTRACE_FL_FILTER with a filter_hash instead. This is
      temporary until the rest of the function filtering accounting
      gets in.
      
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      1cf41dd7
    • Steven Rostedt's avatar
      ftrace: Replace FTRACE_FL_NOTRACE flag with a hash of ignored functions · b448c4e3
      Steven Rostedt authored
      
      To prepare for the accounting system that will allow multiple users of
      the function tracer, having the FTRACE_FL_NOTRACE as a flag in the
      dyn_trace record does not make sense.
      
      All ftrace_ops will soon have a hash of functions they should trace
      and not trace. By making a global hash of functions not to trace makes
      this easier for the transition.
      
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      b448c4e3
    • Jonathan Cameron's avatar
      irq: Export functions to allow modular irq drivers · edf76f83
      Jonathan Cameron authored
      
      Export handle_simple_irq, irq_modify_status, irq_alloc_descs,
      irq_free_descs and generic_handle_irq to allow their usage in
      modules. First user is IIO, which wants to be built modular, but needs
      to be able to create irq chips, allocate and configure interrupt
      descriptors and handle demultiplexing interrupts.
      
      [ tglx: Moved the uninlinig of generic_handle_irq to a separate patch ]
      
      Signed-off-by: default avatarJonathan Cameron <jic23@cam.ac.uk>
      Link: http://lkml.kernel.org/r/%3C1305711544-505-1-git-send-email-jic23%40cam.ac.uk%3E
      
      
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      edf76f83
    • Thomas Gleixner's avatar
      genirq: Uninline and sanity check generic_handle_irq() · fe12bc2c
      Thomas Gleixner authored
      
      generic_handle_irq() is missing a NULL pointer check for the result of
      irq_to_desc. This was a not a big problem, but we want to expose it to
      drivers, so we better have sanity checks in place. Add a return value
      as well, which indicates that the irq number was valid and the handler
      was invoked.
      
      Based on the pure code move from Jonathan Cameron.
      
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Cc: Jonathan Cameron <jic23@cam.ac.uk>
      fe12bc2c
    • Thomas Gleixner's avatar
      genirq: Remove pointless ifdefs · fe051434
      Thomas Gleixner authored
      
      kernel/irq/ is only built when CONFIG_GENERIC_HARDIRQS=y. So making
      code inside of kernel/irq/ conditional on CONFIG_GENERIC_HARDIRQS is
      pointless.
      
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      fe051434
  5. May 17, 2011
    • Rafael J. Wysocki's avatar
      PM: Allow drivers to allocate memory from .prepare() callbacks safely · 91e7c75b
      Rafael J. Wysocki authored
      
      If device drivers allocate substantial amounts of memory (above 1 MB)
      in their hibernate .freeze() callbacks (or in their legacy suspend
      callbcks during hibernation), the subsequent creation of hibernate
      image may fail due to the lack of memory.  This is the case, because
      the drivers' .freeze() callbacks are executed after the hibernate
      memory preallocation has been carried out and the preallocated amount
      of memory may be too small to cover the new driver allocations.
      Unfortunately, the drivers' .prepare() callbacks also are executed
      after the hibernate memory preallocation has completed, so they are
      not suitable for allocating additional memory either.  Thus the only
      way a driver can safely allocate memory during hibernation is to use
      a hibernate/suspend notifier.  However, the notifiers are called
      before the freezing of user space and the drivers wanting to use them
      for allocating additional memory may not know how much memory needs
      to be allocated at that point.
      
      To let device drivers overcome this difficulty rework the hibernation
      sequence so that the memory preallocation is carried out after the
      drivers' .prepare() callbacks have been executed, so that the
      .prepare() callbacks can be used for allocating additional memory
      to be used by the drivers' .freeze() callbacks.  Update documentation
      to match the new behavior of the code.
      
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      91e7c75b
Loading