1. 08 Feb, 2011 10 commits
    • Steven Rostedt's avatar
      tracing/filter: Optimize filter by folding the tree · 43cd4145
      Steven Rostedt authored
      There are many cases that a filter will contain multiple ORs or
      ANDs together near the leafs. Walking up and down the tree to get
      to the next compare can be a waste.
      
      If there are several ORs or ANDs together, fold them into a single
      pred and allocate an array of the conditions that they check.
      This will speed up the filter by linearly walking an array
      and can still break out if a short circuit condition is met.
      
      Cc: Tom Zanussi <tzanussi@gmail.com>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      43cd4145
    • Steven Rostedt's avatar
      tracing/filter: Check the created pred tree · ec126cac
      Steven Rostedt authored
      Since the filter walks a tree to determine if a match is made or not,
      if the tree was incorrectly created, it could cause an infinite loop.
      
      Add a check to walk the entire tree before assigning it as a filter
      to make sure the tree is correct.
      
      Cc: Tom Zanussi <tzanussi@gmail.com>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      ec126cac
    • Steven Rostedt's avatar
      tracing/filter: Optimize short ciruit check · 55719274
      Steven Rostedt authored
      The test if we should break out early for OR and AND operations
      can be optimized by comparing the current result with
        (pred->op == OP_OR)
      
      That is if the result is true and the op is an OP_OR, or
      if the result is false and the op is not an OP_OR (thus an OP_AND)
      we can break out early in either case. Otherwise we continue
      processing.
      
      Cc: Tom Zanussi <tzanussi@gmail.com>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      55719274
    • Steven Rostedt's avatar
      tracing/filter: Use a tree instead of stack for filter_match_preds() · 61e9dea2
      Steven Rostedt authored
      Currently the filter_match_preds() requires a stack to push
      and pop the preds to determine if the filter matches the record or not.
      This has two drawbacks:
      
      1) It requires a stack to store state information. As this is done
         in fast paths we can't allocate the storage for this stack, and
         we can't use a global as it must be re-entrant. The stack is stored
         on the kernel stack and this greatly limits how many preds we
         may allow.
      
      2) All conditions are calculated even when a short circuit exists.
         a || b  will always calculate a and b even though a was determined
         to be true.
      
      Using a tree we can walk a constant structure that will save
      the state as we go. The algorithm is simply:
      
        pred = root;
        do {
      	switch (move) {
      	case MOVE_DOWN:
      		if (OR or AND) {
      			pred = left;
      			continue;
      		}
      		if (pred == root)
      			break;
      		match = pred->fn();
      		pred = pred->parent;
      		move = left child ? MOVE_UP_FROM_LEFT : MOVE_UP_FROM_RIGHT;
      		continue;
      
      	case MOVE_UP_FROM_LEFT:
      		/* Only OR or AND can be a parent */
      		if (match && OR || !match && AND) {
      			/* short circuit */
      			if (pred == root)
      				break;
      			pred = pred->parent;
      			move = left child ?
      				MOVE_UP_FROM_LEFT :
      				MOVE_UP_FROM_RIGHT;
      			continue;
      		}
      		pred = pred->right;
      		move = MOVE_DOWN;
      		continue;
      
      	case MOVE_UP_FROM_RIGHT:
      		if (pred == root)
      			break;
      		pred = pred->parent;
      		move = left child ? MOVE_UP_FROM_LEFT : MOVE_UP_FROM_RIGHT;
      		continue;
      	}
      	done = 1;
        } while (!done);
      
      This way there's no strict limit to how many preds we allow
      and it also will short circuit the logical operations when possible.
      
      Cc: Tom Zanussi <tzanussi@gmail.com>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      61e9dea2
    • Steven Rostedt's avatar
      tracing/filter: Free pred array on disabling of filter · f76690af
      Steven Rostedt authored
      When a filter is disabled, free the preds.
      
      Cc: Tom Zanussi <tzanussi@gmail.com>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      f76690af
    • Steven Rostedt's avatar
      tracing/filter: Allocate the preds in an array · 74e9e58c
      Steven Rostedt authored
      Currently we allocate an array of pointers to filter_preds, and then
      allocate a separate filter_pred for each item in the array.
      This adds slight overhead in the filters as it needs to derefernce
      twice to get to the op condition.
      
      Allocating the preds themselves in a single array removes a dereference
      as well as helps on the cache footprint.
      
      Cc: Tom Zanussi <tzanussi@gmail.com>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      74e9e58c
    • Steven Rostedt's avatar
      tracing/filter: Call synchronize_sched() just once for system filters · 0fc3ca9a
      Steven Rostedt authored
      By separating out the reseting of the filter->n_preds to zero from
      the reallocation of preds for the filter, we can reset groups of
      filters first, call synchronize_sched() just once, and then reallocate
      each of the filters in the system group.
      
      Cc: Tom Zanussi <tzanussi@gmail.com>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      0fc3ca9a
    • Steven Rostedt's avatar
      tracing/filter: Dynamically allocate preds · c9c53ca0
      Steven Rostedt authored
      For every filter that is made, we create predicates to hold every
      operation within the filter. We have a max of 32 predicates that we
      can hold. Currently, we allocate all 32 even if we only need to
      use one.
      
      Part of the reason we do this is that the filter can be used at
      any moment by any event. Fortunately, the filter is only used
      with preemption disabled. By reseting the count of preds used "n_preds"
      to zero, then performing a synchronize_sched(), we can safely
      free and reallocate a new array of preds.
      
      Cc: Tom Zanussi <tzanussi@gmail.com>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      c9c53ca0
    • Steven Rostedt's avatar
      tracing/filter: Move OR and AND logic out of fn() method · 58d9a597
      Steven Rostedt authored
      The ops OR and AND act different from the other ops, as they
      are the only ones to take other ops as their arguements.
      These ops als change the logic of the filter_match_preds.
      
      By removing the OR and AND fn's we can also remove the val1 and val2
      that is passed to all other fn's and are unused.
      
      Cc: Tom Zanussi <tzanussi@gmail.com>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      58d9a597
    • Steven Rostedt's avatar
      tracing/filter: Have no filter return a match · 6d54057d
      Steven Rostedt authored
      The n_preds field of a file can change at anytime, and even can become
      zero, just as the filter is about to be processed by an event.
      In the case that is zero on entering the filter, return 1, telling
      the caller the event matchs and should be trace.
      
      Also use a variable and assign it with ACCESS_ONCE() such that the
      count stays consistent within the function.
      
      Cc: Tom Zanussi <tzanussi@gmail.com>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      6d54057d
  2. 07 Feb, 2011 2 commits
  3. 06 Feb, 2011 11 commits
  4. 05 Feb, 2011 7 commits
    • Thomas Gleixner's avatar
      m32r: Fixup last __do_IRQ leftover · a9fe8d5f
      Thomas Gleixner authored
      Somehow I managed to miss the last __do_IRQ caller when I cleanup the
      remaining users. m32r is fully converted to the generic irq layer, but
      I managed to not commit the conversion of __do_IRQ() to
      generic_handle_irq() after compile testing the quilt series :(
      Pointed-out-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Cc: Hirokazu Takata <takata@linux-m32r.org>
      Cc: Paul Mundt <lethal@linux-sh.org>
      a9fe8d5f
    • Arnaldo Carvalho de Melo's avatar
      perf annotate: Config options for symbol__tty_annotate · d040bd36
      Arnaldo Carvalho de Melo authored
      Max line# that should be printed, minimum percentage filter, just like
      'perf top', alas, due to it :-)
      
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      LKML-Reference: <new-submission>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      d040bd36
    • Thomas Gleixner's avatar
      genirq: Add missing status flags to modification mask · 872434d6
      Thomas Gleixner authored
      The mask which filters out the valid bits which can be set via
      irq_modify_status() is missing IRQ_NO_BALANCING, which breaks UV.
      
      Add IRQ_PER_CPU as well to avoid another one line patch for 39.
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      872434d6
    • Arnaldo Carvalho de Melo's avatar
      perf annotate: Support multiple histograms in annotation · 2f525d01
      Arnaldo Carvalho de Melo authored
      The perf annotate tool continues aggregating everything on just one
      histograms, but to support the top model add support for one histogram
      perf evsel in the evlist.
      
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      LKML-Reference: <new-submission>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      2f525d01
    • Arnaldo Carvalho de Melo's avatar
      perf annotate: Move annotate functions to util/ · 78f7defe
      Arnaldo Carvalho de Melo authored
      They will be used by perf top, so that we have just one set of routines
      to do annotation.
      
      Rename "struct sym_priv" to "struct annotation", etc, to clarify this
      code a bit.
      
      Rename "struct sym_ext" to "struct source_line", to give it a meaningful
      name, that clarifies that it is a the result of an addr2line call, that
      is sorted by percentage one particular source code line appeared in the
      annotation.
      
      And since we're moving things around also rename 'sym_hist->ip' to
      'sym_hist->addr' as we want to do data structure annotation at some
      point.
      
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      LKML-Reference: <new-submission>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      78f7defe
    • Arnaldo Carvalho de Melo's avatar
      perf top: Remove superfluous name_len field · 764328d3
      Arnaldo Carvalho de Melo authored
      From the sym_entry struct, struct symbol already has this field.
      
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      LKML-Reference: <new-submission>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      764328d3
    • H. Peter Anvin's avatar
      x86-32: Make sure the stack is set up before we use it · 11d4c3f9
      H. Peter Anvin authored
      Since checkin ebba638a we call
      verify_cpu even in 32-bit mode.  Unfortunately, calling a function
      means using the stack, and the stack pointer was not initialized in
      the 32-bit setup code!  This code initializes the stack pointer, and
      simplifies the interface slightly since it is easier to rely on just a
      pointer value rather than a descriptor; we need to have different
      values for the segment register anyway.
      
      This retains start_stack as a virtual address, even though a physical
      address would be more convenient for 32 bits; the 64-bit code wants
      the other way around...
      Reported-by: default avatarMatthieu Castet <castet.matthieu@free.fr>
      LKML-Reference: <4D41E86D.8060205@free.fr>
      Tested-by: default avatarKees Cook <kees.cook@canonical.com>
      Signed-off-by: default avatarH. Peter Anvin <hpa@linux.intel.com>
      11d4c3f9
  5. 04 Feb, 2011 10 commits