1. 09 Dec, 2009 5 commits
    • Carsten Emde's avatar
      tracing: Remove comparing of NULL to va_list in trace_array_vprintk() · f2942487
      Carsten Emde authored
      Olof Johansson stated the following:
      
        Comparing a va_list with NULL is bogus. It's supposed to be treated like
        an opaque type and only be manipulated with va_* accessors.
      
      Olof noticed that this code broke the ARM builds:
      
          kernel/trace/trace.c: In function 'trace_array_vprintk':
          kernel/trace/trace.c:1364: error: invalid operands to binary == (have 'va_list' and 'void *')
          kernel/trace/trace.c: In function 'tracing_mark_write':
          kernel/trace/trace.c:3349: error: incompatible type for argument 3 of 'trace_vprintk'
      
      This patch partly reverts c13d2f7c and
      re-installs the original mark_printk() mechanism.
      Reported-by: default avatarOlof Johansson <olof@lixom.net>
      Signed-off-by: default avatarCarsten Emde <C.Emde@osadl.org>
      LKML-Reference: <4B1BAB74.104@osadl.org>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      f2942487
    • Jiri Olsa's avatar
      tracing: Fix function graph trace_pipe to properly display failed entries · be1eca39
      Jiri Olsa authored
      There is a case where the graph tracer might get confused and omits
      displaying of a single record.  This applies mostly with the trace_pipe
      since it is unlikely that the trace_seq buffer will overflow with the
      trace file.
      
      As the function_graph tracer goes through the trace entries keeping a
      pointer to the current record:
      
      current ->  func1 ENTRY
                  func2 ENTRY
                  func2 RETURN
                  func1 RETURN
      
      When an function ENTRY is encountered, it moves the pointer to the
      next entry to check if the function is a nested or leaf function.
      
                  func1 ENTRY
      current ->  func2 ENTRY
                  func2 RETURN
                  func1 RETURN
      
      If the rest of the writing of the function fills the trace_seq buffer,
      then the trace_pipe read will ignore this entry. The next read will
      Now start at the current location, but the first entry (func1) will
      be discarded.
      
      This patch keeps a copy of the current entry in the iterator private
      storage and will keep track of when the trace_seq buffer fills. When
      the trace_seq buffer fills, it will reuse the copy of the entry in the
      next iteration.
      
      [
        This patch has been largely modified by Steven Rostedt in order to
        clean it up and simplify it. The original idea and concept was from
        Jirka and for that, this patch will go under his name to give him
        the credit he deserves. But because this was modify by Steven Rostedt
        anything wrong with the patch should be blamed on Steven.
      ]
      Signed-off-by: default avatarJiri Olsa <jolsa@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <1259067458-27143-1-git-send-email-jolsa@redhat.com>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      be1eca39
    • Johannes Berg's avatar
      tracing: Add full state to trace_seq · d184b31c
      Johannes Berg authored
      The trace_seq buffer might fill up, and right now one needs to check the
      return value of each printf into the buffer to check for that.
      
      Instead, have the buffer keep track of whether it is full or not, and
      reject more input if it is full or would have overflowed with an input
      that wasn't added.
      
      Cc: Lai Jiangshan <laijs@cn.fujitsu.com>
      Signed-off-by: default avatarJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      d184b31c
    • Steven Rostedt's avatar
      tracing: Buffer the output of seq_file in case of filled buffer · a63ce5b3
      Steven Rostedt authored
      If the seq_read fills the buffer it will call s_start again on the next
      itertation with the same position. This causes a problem with the
      function_graph tracer because it consumes the iteration in order to
      determine leaf functions.
      
      What happens is that the iterator stores the entry, and the function
      graph plugin will look at the next entry. If that next entry is a return
      of the same function and task, then the function is a leaf and the
      function_graph plugin calls ring_buffer_read which moves the ring buffer
      iterator forward (the trace iterator still points to the function start
      entry).
      
      The copying of the trace_seq to the seq_file buffer will fail if the
      seq_file buffer is full. The seq_read will not show this entry.
      The next read by userspace will cause seq_read to again call s_start
      which will reuse the trace iterator entry (the function start entry).
      But the function return entry was already consumed. The function graph
      plugin will think that this entry is a nested function and not a leaf.
      
      To solve this, the trace code now checks the return status of the
      seq_printf (trace_print_seq). If the writing to the seq_file buffer
      fails, we set a flag in the iterator (leftover) and we do not reset
      the trace_seq buffer. On the next call to s_start, we check the leftover
      flag, and if it is set, we just reuse the trace_seq buffer and do not
      call into the plugin print functions.
      
      Before this patch:
      
       2)               |      fput() {
       2)               |        __fput() {
       2)   0.550 us    |          inotify_inode_queue_event();
       2)               |          __fsnotify_parent() {
       2)   0.540 us    |          inotify_dentry_parent_queue_event();
      
      After the patch:
      
       2)               |      fput() {
       2)               |        __fput() {
       2)   0.550 us    |          inotify_inode_queue_event();
       2)   0.548 us    |          __fsnotify_parent();
       2)   0.540 us    |          inotify_dentry_parent_queue_event();
      
      [
        Updated the patch to fix a missing return 0 from the trace_print_seq()
        stub when CONFIG_TRACING is disabled.
      Reported-by: default avatarIngo Molnar <mingo@elte.hu>
      ]
      Reported-by: default avatarJiri Olsa <jolsa@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      a63ce5b3
    • Steven Rostedt's avatar
      tracing: Only call pipe_close if pipe_close is defined · 29bf4a5e
      Steven Rostedt authored
      This fixes a cut and paste error that had pipe_close get called
      if pipe_open was defined (not pipe_close).
      Reported-by: default avatarKosaki Motohiro <kosaki.motohiro@jp.fujitsu.com>
      LKML-Reference: <20091209153204.F4CD.A69D9226@jp.fujitsu.com>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      29bf4a5e
  2. 07 Dec, 2009 1 commit
    • Steven Rostedt's avatar
      tracing: Add pipe_close interface · c521efd1
      Steven Rostedt authored
      An ftrace plugin can add a pipe_open interface when the user opens
      trace_pipe. But if the plugin allocates something within the pipe_open
      it can not free it because there exists no pipe_close. The hook to
      the trace file open has a corresponding close. The closing of the
      trace_pipe file should also have a corresponding close.
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      c521efd1
  3. 05 Dec, 2009 25 commits
  4. 03 Dec, 2009 9 commits
    • Ingo Molnar's avatar
      Merge branch 'perf/probes' into perf/core · d103d01e
      Ingo Molnar authored
      Merge reason: add these fixes to 'perf probe'.
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      d103d01e
    • Ingo Molnar's avatar
      Merge branch 'perf/mce' into perf/core · 26fb20d0
      Ingo Molnar authored
      Merge reason: It's ready for v2.6.33.
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      26fb20d0
    • Ingo Molnar's avatar
      Merge branch 'perf/scripting' into perf/core · 23ba90e3
      Ingo Molnar authored
      Merge reason: it's ready for v2.6.33.
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      23ba90e3
    • Mikael Pettersson's avatar
      x86, apic: Enable lapic nmi watchdog on AMD Family 11h · 7d1849af
      Mikael Pettersson authored
      The x86 lapic nmi watchdog does not recognize AMD Family 11h,
      resulting in:
      
        NMI watchdog: CPU not supported
      
      As far as I can see from available documentation (the BKDM),
      family 11h looks identical to family 10h as far as the PMU
      is concerned.
      
      Extending the check to accept family 11h results in:
      
        Testing NMI watchdog ... OK.
      
      I've been running with this change on a Turion X2 Ultra ZM-82
      laptop for a couple of weeks now without problems.
      Signed-off-by: default avatarMikael Pettersson <mikpe@it.uu.se>
      Cc: Andreas Herrmann <andreas.herrmann3@amd.com>
      Cc: Joerg Roedel <joerg.roedel@amd.com>
      Cc: <stable@kernel.org>
      LKML-Reference: <19223.53436.931768.278021@pilspetsen.it.uu.se>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      7d1849af
    • Steven Whitehouse's avatar
      GFS2: Fix glock refcount issues · 26bb7505
      Steven Whitehouse authored
      This patch fixes some ref counting issues. Firstly by moving
      the point at which we drop the ref count after a dlm lock
      operation has completed we ensure that we never call
      gfs2_glock_hold() on a lock with a zero ref count.
      
      Secondly, by using atomic_dec_and_lock() in gfs2_glock_put()
      we ensure that at no time will a glock with zero ref count
      appear on the lru_list. That means that we can remove the
      check for this in our shrinker (which was racy).
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
      26bb7505
    • Wu Fengguang's avatar
      writeback: remove unused nonblocking and congestion checks (gfs2) · c29cd900
      Wu Fengguang authored
      No one is calling wb_writeback and write_cache_pages with
      wbc.nonblocking=1 any more. And lumpy pageout will want to do
      nonblocking writeback without the congestion wait.
      Signed-off-by: default avatarWu Fengguang <fengguang.wu@intel.com>
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
      c29cd900
    • Benjamin Marzinski's avatar
      GFS2: drop rindex glock to refresh rindex list · 9ae3c6de
      Benjamin Marzinski authored
      When a gfs2 filesystem is grown, it needs to rebuild the rindex list to be able
      to use the new space.  gfs2 does this when the rindex is marked not uptodate,
      which happens when the rindex glock is dropped.  However, on a single node
      setup, there is never any reason to drop the rindex glock, so gfs2 never
      invalidates the the rindex. This patch makes gfs2 automatically drop the
      rindex glock after filesystem grows, so it can refresh the rindex list.
      Signed-off-by: default avatarBenjamin Marzinski <bmarzins@redhat.com>
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
      9ae3c6de
    • Steven Whitehouse's avatar
      GFS2: Tag all metadata with jid · 0ab7d13f
      Steven Whitehouse authored
      There are two spare field in the header common to all GFS2
      metadata. One is just the right size to fit a journal id
      in it, and this patch updates the journal code so that each
      time a metadata block is modified, we tag it with the journal
      id of the node which is performing the modification.
      
      The reason for this is that it should make it much easier to
      debug issues which arise if we can tell which node was the
      last to modify a particular metadata block.
      
      Since the field is updated before the block is written into
      the journal, each journal should only contain metadata which
      is tagged with its own journal id. The one exception to this
      is the journal header block, which might have a different node's
      id in it, if that journal was recovered by another node in the
      cluster.
      
      Thus each journal will contain a record of which nodes recovered
      it, via the journal header.
      
      The other field in the metadata header could potentially be
      used to hold information about what kind of operation was
      performed, but for the time being we just zero it on each
      transaction so that if we use it for that in future, we'll
      know that the information (where it exists) is reliable.
      
      I did consider using the other field to hold the journal
      sequence number, however since in GFS2's journaling we write
      the modified data into the journal and not the original
      data, this gives no information as to what action caused the
      modification, so I think we can probably come up with a better
      use for those 64 bits in the future.
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
      0ab7d13f
    • Steven Whitehouse's avatar
      GFS2: Locking order fix in gfs2_check_blk_state · 2c776349
      Steven Whitehouse authored
      In some cases we already have the rindex lock when
      we enter this function.
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
      2c776349