1. 17 Apr, 2009 5 commits
    • Steven Rostedt's avatar
      tracing/events: perform function tracing in event selftests · 9ea21c1e
      Steven Rostedt authored
      We can find some bugs in the trace events if we stress the writes as well.
      The function tracer is a good way to stress the events.
      
      [ Impact: extend scope of event tracer self-tests ]
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <20090416161746.604786131@goodmis.org>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      9ea21c1e
    • Avadh Patel's avatar
      tracing: add saved_cmdlines file to show cached task comms · 69abe6a5
      Avadh Patel authored
      Export the cached task comms to userspace. This allows user apps to translate
      the pids from a trace into their respective task command lines.
      
      [ Impact: let userspace apps reading binary buffer know comm's of pids ]
      Signed-off-by: default avatarAvadh Patel <avadh4all@gmail.com>
      [ added error checking and use of buf pointer to index file_buf ]
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      69abe6a5
    • Steven Rostedt's avatar
      tracing/events/ring-buffer: expose format of ring buffer headers to users · d1b182a8
      Steven Rostedt authored
      Currently, every thing needed to read the binary output from the
      ring buffers is available, with the exception of the way the ring
      buffers handles itself internally.
      
      This patch creates two special files in the debugfs/tracing/events
      directory:
      
       # cat /debug/tracing/events/header_page
              field: u64 timestamp;   offset:0;       size:8;
              field: local_t commit;  offset:8;       size:8;
              field: char data;       offset:16;      size:4080;
      
       # cat /debug/tracing/events/header_event
              type        :    2 bits
              len         :    3 bits
              time_delta  :   27 bits
              array       :   32 bits
      
              padding     : type == 0
              time_extend : type == 1
              data        : type == 3
      
      This is to allow a userspace app to see if the ring buffer format changes
      or not.
      
      [ Impact: allow userspace apps to know of ringbuffer format changes ]
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      d1b182a8
    • Steven Rostedt's avatar
      tracing/events: add startup tests for events · e6187007
      Steven Rostedt authored
      As events start to become popular, and the new way to add tracing
      infrastructure into ftrace, it is important to catch any problems
      that might happen with a mistake in the TRACE_EVENT macro.
      
      This patch introduces a startup self test on the registered trace
      events. Note, it can only do a generic test, any type of testing that
      needs more involement is needed to be implemented by the tracepoint
      creators.
      
      The test goes down one by one enabling a trace point and running
      some random tasks (random in the sense that I just made them up).
      Those tasks are creating threads, grabbing mutexes and spinlocks
      and using workqueues.
      
      After testing each event individually, it does the same test after
      enabling each system of trace points. Like sched, irq, lockdep.
      
      Then finally it enables all tracepoints and performs the tasks again.
      The output to the console on bootup will look like this when everything
      works:
      
      Running tests on trace events:
      Testing event kfree_skb: OK
      Testing event kmalloc: OK
      Testing event kmem_cache_alloc: OK
      Testing event kmalloc_node: OK
      Testing event kmem_cache_alloc_node: OK
      Testing event kfree: OK
      Testing event kmem_cache_free: OK
      Testing event irq_handler_exit: OK
      Testing event irq_handler_entry: OK
      Testing event softirq_entry: OK
      Testing event softirq_exit: OK
      Testing event lock_acquire: OK
      Testing event lock_release: OK
      Testing event sched_kthread_stop: OK
      Testing event sched_kthread_stop_ret: OK
      Testing event sched_wait_task: OK
      Testing event sched_wakeup: OK
      Testing event sched_wakeup_new: OK
      Testing event sched_switch: OK
      Testing event sched_migrate_task: OK
      Testing event sched_process_free: OK
      Testing event sched_process_exit: OK
      Testing event sched_process_wait: OK
      Testing event sched_process_fork: OK
      Testing event sched_signal_send: OK
      Running tests on trace event systems:
      Testing event system skb: OK
      Testing event system kmem: OK
      Testing event system irq: OK
      Testing event system lockdep: OK
      Testing event system sched: OK
      Running tests on all trace events:
      Testing all events: OK
      
      [ folded in:
      
        tracing: add #include <linux/delay.h> to fix build failure in test_work()
      
        This build failure occured on a few rare configs:
      
         kernel/trace/trace_events.c: In function ‘test_work’:
         kernel/trace/trace_events.c:975: error: implicit declaration of function ‘udelay’
         kernel/trace/trace_events.c:980: error: implicit declaration of function ‘msleep’
      
        delay.h is included in way too many other headers, hiding cases
        where new usage is added without header inclusion.
      
        [ Impact: build fix ]
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      ]
      
      [ Impact: add event tracer self-tests ]
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      e6187007
    • Steven Rostedt's avatar
      ftrace: use module notifier for function tracer · 93eb677d
      Steven Rostedt authored
      The hooks in the module code for the function tracer must be called
      before any of that module code runs. The function tracer hooks
      modify the module (replacing calls to mcount to nops). If the code
      is executed while the change occurs, then the CPU can take a GPF.
      
      To handle the above with a bit of paranoia, I originally implemented
      the hooks as calls directly from the module code.
      
      After examining the notifier calls, it looks as though the start up
      notify is called before any of the module's code is executed. This makes
      the use of the notify safe with ftrace.
      
      Only the startup notify is required to be "safe". The shutdown simply
      removes the entries from the ftrace function list, and does not modify
      any code.
      
      This change has another benefit. It removes a issue with a reverse dependency
      in the mutexes of ftrace_lock and module_mutex.
      
      [ Impact: fix lock dependency bug, cleanup ]
      
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      93eb677d
  2. 16 Apr, 2009 4 commits
    • Li Zefan's avatar
      blktrace: fix context-info when mixed-using blk tracer and trace events · f3948f88
      Li Zefan authored
      When current tracer is set to blk tracer, TRACE_ITER_CONTEXT_INFO is
      unset, but actually context-info is printed:
      
          pdflush-431   [000]   821.181576:   8,0    P   N [pdflush]
      
      And then if we enable TRACE_ITER_CONTEXT_INFO:
      
          # echo context-info > trace_options
      
      We'll see context-info printed twice. What's worse, when we use blk
      tracer and trace events at the same time, we'll see no context-info
      for trace events at all:
      
          jbd2_commit_logging: dev dm-0:8 transaction 333227
          jbd2_end_commit: dev dm-0:8 transaction 333227 head 332814
            rm-25433 [001]  9578.307485:   8,18   m   N cfq25433 slice expired t=0
            rm-25433 [001]  9578.307486:   8,18   m   N cfq25433 put_queue
      
      This patch adds blk_tracer->set_flags(), and context-info flag is unset
      only when we set the output to classic mode.
      
      Note after this patch, one should unset context-info explicitly if he
      wants to get binary output that can be parsed by blkparse:
      
          # echo nocontext-info > trace_options
          # echo bin > trace_options
          # echo blk > current_tracer
          # cat trace_pipe | blkparse -i -
      Reported-by: default avatarTheodore Ts'o <tytso@mit.edu>
      Signed-off-by: default avatarLi Zefan <lizf@cn.fujitsu.com>
      Cc: Jens Axboe <jens.axboe@oracle.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      LKML-Reference: <49E54E60.50408@cn.fujitsu.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      f3948f88
    • Li Zefan's avatar
      blktrace: add trace/ to /sys/block/sda · 1d54ad6d
      Li Zefan authored
      Impact: allow ftrace-plugin blktrace to trace device-mapper devices
      
      To trace a single partition:
        # echo 1 > /sys/block/sda/sda1/enable
      
      To trace the whole sda instead:
        # echo 1 > /sys/block/sda/enable
      
      Thus we also fix an issue reported by Ted, that ftrace-plugin blktrace
      can't be used to trace device-mapper devices.
      
      Now:
      
        # echo 1 > /sys/block/dm-0/trace/enable
        echo: write error: No such device or address
        # mount -t ext4 /dev/dm-0 /mnt
        # echo 1 > /sys/block/dm-0/trace/enable
        # echo blk > /debug/tracing/current_tracer
      Reported-by: default avatarTheodore Tso <tytso@mit.edu>
      Signed-off-by: default avatarLi Zefan <lizf@cn.fujitsu.com>
      Acked-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Shawn Du <duyuyang@gmail.com>
      Cc: Jens Axboe <jens.axboe@oracle.com>
      LKML-Reference: <49E42665.6020506@cn.fujitsu.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      1d54ad6d
    • Li Zefan's avatar
      blktrace: support per-partition tracing for ftrace plugin · 9908c309
      Li Zefan authored
      The previous patch adds support to trace a single partition for
      relay+ioctl blktrace, and this patch is for ftrace plugin blktrace:
      
        # echo 1 > /sys/block/sda/sda7/enable
        # cat start_lba
        102398373
        # cat end_lba
        102703545
      Signed-off-by: default avatarLi Zefan <lizf@cn.fujitsu.com>
      Acked-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Shawn Du <duyuyang@gmail.com>
      Cc: Jens Axboe <jens.axboe@oracle.com>
      LKML-Reference: <49E42646.4060608@cn.fujitsu.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      9908c309
    • Shawn Du's avatar
      blktrace: support per-partition tracing · d0deef5b
      Shawn Du authored
      Though one can specify '-d /dev/sda1' when using blktrace, it still
      traces the whole sda.
      
      To support per-partition tracing, when we start tracing, we initialize
      bt->start_lba and bt->end_lba to the start and end sector of that
      partition.
      
      Note some actions are per device, thus we don't filter 0-sector events.
      
      The original patch and discussion can be found here:
      	http://marc.info/?l=linux-btrace&m=122949374214540&w=2Signed-off-by: default avatarShawn Du <duyuyang@gmail.com>
      Signed-off-by: default avatarLi Zefan <lizf@cn.fujitsu.com>
      Acked-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Jens Axboe <jens.axboe@oracle.com>
      LKML-Reference: <49E42620.4050701@cn.fujitsu.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      d0deef5b
  3. 15 Apr, 2009 4 commits
  4. 14 Apr, 2009 8 commits
    • Steven Rostedt's avatar
      tracing/events: add support for modules to TRACE_EVENT · 6d723736
      Steven Rostedt authored
      Impact: allow modules to add TRACE_EVENTS on load
      
      This patch adds the final hooks to allow modules to use the TRACE_EVENT
      macro. A notifier and a data structure are used to link the TRACE_EVENTs
      defined in the module to connect them with the ftrace event tracing system.
      
      It also adds the necessary automated clean ups to the trace events when a
      module is removed.
      
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      6d723736
    • Steven Rostedt's avatar
      tracing/events: add export symbols for trace events in modules · 17c873ec
      Steven Rostedt authored
      Impact: let modules add trace events
      
      The trace event code requires some functions to be exported to allow
      modules to use TRACE_EVENT. This patch adds EXPORT_SYMBOL_GPL to the
      necessary functions.
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      17c873ec
    • Steven Rostedt's avatar
      tracing/events: convert event call sites to use a link list · a59fd602
      Steven Rostedt authored
      Impact: makes it possible to define events in modules
      
      The events are created by reading down the section that they are linked
      in by the macros. But this is not scalable to modules. This patch converts
      the manipulations to use a global link list, and on boot up it adds
      the items in the section to the list.
      
      This change will allow modules to add their tracing events to the list as
      well.
      
      Note, this change alone does not permit modules to use the TRACE_EVENT macros,
      but the change is needed for them to eventually do so.
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      a59fd602
    • Steven Rostedt's avatar
      tracing/events: move the ftrace event tracing code to core · f42c85e7
      Steven Rostedt authored
      This patch moves the ftrace creation into include/trace/ftrace.h and
      simplifies the work of developers in adding new tracepoints.
      Just the act of creating the trace points in include/trace and including
      define_trace.h will create the events in the debugfs/tracing/events
      directory.
      
      This patch removes the need of include/trace/trace_events.h
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      f42c85e7
    • Steven Rostedt's avatar
      tracing/events: move declarations from trace directory to core include · 97f20251
      Steven Rostedt authored
      In preparation to allowing trace events to happen in modules, we need
      to move some of the local declarations in the kernel/trace directory
      into include/linux.
      
      This patch simply moves the declarations and performs no context changes.
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      97f20251
    • Steven Rostedt's avatar
      tracing: make trace_seq operations available for core kernel · 9504504c
      Steven Rostedt authored
      In the process to make TRACE_EVENT macro work for modules, the trace_seq
      operations must be available for core kernel code.
      
      These operations are quite useful and can be used for other implementations.
      
      The main idea is that we create a trace_seq handle that acts very much
      like the seq_file handle.
      
      	struct trace_seq *s = kmalloc(sizeof(*s, GFP_KERNEL);
      
      	trace_seq_init(s);
      	trace_seq_printf(s, "some data %d\n", variable);
      
      	printk("%s", s->buffer);
      
      The main use is to allow a top level function call several other functions
      that may store printf like data into the buffer. Then at the end, the top
      level function can process all the data with any method it would like to.
      It could be passed to userspace, output via printk or even use seq_file:
      
      	trace_seq_to_user(s, ubuf, cnt);
      	seq_puts(m, s->buffer);
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      9504504c
    • Steven Rostedt's avatar
      tracing: create automated trace defines · a8d154b0
      Steven Rostedt authored
      This patch lowers the number of places a developer must modify to add
      new tracepoints. The current method to add a new tracepoint
      into an existing system is to write the trace point macro in the
      trace header with one of the macros TRACE_EVENT, TRACE_FORMAT or
      DECLARE_TRACE, then they must add the same named item into the C file
      with the macro DEFINE_TRACE(name) and then add the trace point.
      
      This change cuts out the needing to add the DEFINE_TRACE(name).
      Every file that uses the tracepoint must still include the trace/<type>.h
      file, but the one C file must also add a define before the including
      of that file.
      
       #define CREATE_TRACE_POINTS
       #include <trace/mytrace.h>
      
      This will cause the trace/mytrace.h file to also produce the C code
      necessary to implement the trace point.
      
      Note, if more than one trace/<type>.h is used to create the C code
      it is best to list them all together.
      
       #define CREATE_TRACE_POINTS
       #include <trace/foo.h>
       #include <trace/bar.h>
       #include <trace/fido.h>
      
      Thanks to Mathieu Desnoyers and Christoph Hellwig for coming up with
      the cleaner solution of the define above the includes over my first
      design to have the C code include a "special" header.
      
      This patch converts sched, irq and lockdep and skb to use this new
      method.
      
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Neil Horman <nhorman@tuxdriver.com>
      Cc: Zhao Lei <zhaolei@cn.fujitsu.com>
      Cc: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro>
      Cc: Pekka Enberg <penberg@cs.helsinki.fi>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      a8d154b0
    • Steven Rostedt's avatar
      tracing: consolidate trace and trace_event headers · ea20d929
      Steven Rostedt authored
      Impact: clean up
      
      Neil Horman (et. al.) criticized the way the trace events were broken up
      into two files. The reason for that was that ftrace needed to separate out
      the declarations from where the #include <linux/tracepoint.h> was used.
      It then dawned on me that the tracepoint.h header only needs to define the
      TRACE_EVENT macro if it is not already defined.
      
      The solution is simply to test if TRACE_EVENT is defined, and if it is not
      then the linux/tracepoint.h header can define it. This change consolidates
      all the <traces>.h and <traces>_event_types.h into the <traces>.h file.
      Reported-by: default avatarNeil Horman <nhorman@tuxdriver.com>
      Reported-by: default avatarTheodore Tso <tytso@mit.edu>
      Reported-by: default avatarJiaying Zhang <jiayingz@google.com>
      Cc: Zhaolei <zhaolei@cn.fujitsu.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Jason Baron <jbaron@redhat.com>
      Cc: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      ea20d929
  5. 13 Apr, 2009 19 commits
    • Tom Zanussi's avatar
      tracing/filters: allow on-the-fly filter switching · 0a19e53c
      Tom Zanussi authored
      This patch allows event filters to be safely removed or switched
      on-the-fly while avoiding the use of rcu or the suspension of tracing of
      previous versions.
      
      It does it by adding a new filter_pred_none() predicate function which
      does nothing and by never deallocating either the predicates or any of
      the filter_pred members used in matching; the predicate lists are
      allocated and initialized during ftrace_event_calls initialization.
      
      Whenever a filter is removed or replaced, the filter_pred_* functions
      currently in use by the affected ftrace_event_call are immediately
      switched over to to the filter_pred_none() function, while the rest of
      the filter_pred members are left intact, allowing any currently
      executing filter_pred_* functions to finish up, using the values they're
      currently using.
      
      In the case of filter replacement, the new predicate values are copied
      into the old predicates after the above step, and the filter_pred_none()
      functions are replaced by the filter_pred_* functions for the new
      filter.  In this case, it is possible though very unlikely that a
      previous filter_pred_* is still running even after the
      filter_pred_none() switch and the switch to the new filter_pred_*.  In
      that case, however, because nothing has been deallocated in the
      filter_pred, the worst that can happen is that the old filter_pred_*
      function sees the new values and as a result produces either a false
      positive or a false negative, depending on the values it finds.
      
      So one downside to this method is that rarely, it can produce a bad
      match during the filter switch, but it should be possible to live with
      that, IMHO.
      
      The other downside is that at least in this patch the predicate lists
      are always pre-allocated, taking up memory from the start.  They could
      probably be allocated on first-use, and de-allocated when tracing is
      completely stopped - if this patch makes sense, I could create another
      one to do that later on.
      
      Oh, and it also places a restriction on the size of __arrays in events,
      currently set to 128, since they can't be larger than the now embedded
      str_val arrays in the filter_pred struct.
      Signed-off-by: default avatarTom Zanussi <tzanussi@gmail.com>
      Acked-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: paulmck@linux.vnet.ibm.com
      LKML-Reference: <1239610670.6660.49.camel@tropicana>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      0a19e53c
    • Ingo Molnar's avatar
      Merge branch 'linus' into tracing/core · b5c851a8
      Ingo Molnar authored
      Merge reason: merge latest tracing fixes to avoid conflicts in
                    kernel/trace/trace_events_filter.c with upcoming change
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      b5c851a8
    • Tom Zanussi's avatar
      tracing/filters: use ring_buffer_discard_commit() in filter_check_discard() · eb02ce01
      Tom Zanussi authored
      This patch changes filter_check_discard() to make use of the new
      ring_buffer_discard_commit() function and modifies the current users to
      call the old commit function in the non-discard case.
      
      It also introduces a version of filter_check_discard() that uses the
      global trace buffer (filter_current_check_discard()) for those cases.
      
      v2 changes:
      
      - fix compile error noticed by Ingo Molnar
      Signed-off-by: default avatarTom Zanussi <tzanussi@gmail.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: fweisbec@gmail.com
      LKML-Reference: <1239178554.10295.36.camel@tropicana>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      eb02ce01
    • Tom Zanussi's avatar
      tracing/infrastructure: separate event tracer from event support · 5f77a88b
      Tom Zanussi authored
      Add a new config option, CONFIG_EVENT_TRACING that gets selected
      when CONFIG_TRACING is selected and adds everything needed by the stuff
      in trace_export - basically all the event tracing support needed by e.g.
      bprint, minus the actual events, which are only included if
      CONFIG_EVENT_TRACER is selected.
      
      So CONFIG_EVENT_TRACER can be used to turn on or off the generated events
      (what I think of as the 'event tracer'), while CONFIG_EVENT_TRACING turns
      on or off the base event tracing support used by both the event tracer and
      the other things such as bprint that can't be configured out.
      Signed-off-by: default avatarTom Zanussi <tzanussi@gmail.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: fweisbec@gmail.com
      LKML-Reference: <1239178441.10295.34.camel@tropicana>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      5f77a88b
    • Steven Rostedt's avatar
      tracing/filters: use ring_buffer_discard_commit for discarded events · 77d9f465
      Steven Rostedt authored
      The ring_buffer_discard_commit makes better usage of the ring_buffer
      when an event has been discarded. It tries to remove it completely if
      possible.
      
      This patch converts the trace event filtering to use
      ring_buffer_discard_commit instead of the ring_buffer_event_discard.
      Signed-off-by: default avatarSteven Rostedt <srostedt@redhat.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      77d9f465
    • Steven Rostedt's avatar
      ring-buffer: add ring_buffer_discard_commit · fa1b47dd
      Steven Rostedt authored
      The ring_buffer_discard_commit is similar to ring_buffer_event_discard
      but it can only be done on an event that has yet to be commited.
      Unpredictable results can happen otherwise.
      
      The main difference between ring_buffer_discard_commit and
      ring_buffer_event_discard is that ring_buffer_discard_commit will try
      to free the data in the ring buffer if nothing has addded data
      after the reserved event. If something did, then it acts almost the
      same as ring_buffer_event_discard followed by a
      ring_buffer_unlock_commit.
      
      Note, either ring_buffer_commit_discard and ring_buffer_unlock_commit
      can be called on an event, not both.
      
      This commit also exports both discard functions to be usable by
      GPL modules.
      Signed-off-by: default avatarSteven Rostedt <srostedt@redhat.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      fa1b47dd
    • Tom Zanussi's avatar
      tracing/filters: add TRACE_EVENT_FORMAT_NOFILTER event macro · e45f2e2b
      Tom Zanussi authored
      Frederic Weisbecker suggested that the trace_special event shouldn't be
      filterable; this patch adds a TRACE_EVENT_FORMAT_NOFILTER event macro
      that allows an event format to be exported without having a filter
      attached, and removes filtering from the trace_special event.
      Signed-off-by: default avatarTom Zanussi <tzanussi@gmail.com>
      Signed-off-by: default avatarSteven Rostedt <srostedt@redhat.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      e45f2e2b
    • Tom Zanussi's avatar
      tracing/filters: add run-time field descriptions to TRACE_EVENT_FORMAT events · e1112b4d
      Tom Zanussi authored
      This patch adds run-time field descriptions to all the event formats
      exported using TRACE_EVENT_FORMAT.  It also hooks up all the tracers
      that use them (i.e. the tracers in the 'ftrace subsystem') so they can
      also have their output filtered by the event-filtering mechanism.
      
      When I was testing this, there were a couple of things that fooled me
      into thinking the filters weren't working, when actually they were -
      I'll mention them here so others don't make the same mistakes (and file
      bug reports. ;-)
      
      One is that some of the tracers trace multiple events e.g. the
      sched_switch tracer uses the context_switch and wakeup events, and if
      you don't set filters on all of the traced events, the unfiltered output
      from the events without filters on them can make it look like the
      filtering as a whole isn't working properly, when actually it is doing
      what it was asked to do - it just wasn't asked to do the right thing.
      
      The other is that for the really high-volume tracers e.g. the function
      tracer, the volume of filtered events can be so high that it pushes the
      unfiltered events out of the ring buffer before they can be read so e.g.
      cat'ing the trace file repeatedly shows either no output, or once in
      awhile some output but that isn't there the next time you read the
      trace, which isn't what you normally expect when reading the trace file.
      If you read from the trace_pipe file though, you can catch them before
      they disappear.
      
      Changes from v1:
      
      As suggested by Frederic Weisbecker:
      
      - get rid of externs in functions
      - added unlikely() to filter_check_discard()
      Signed-off-by: default avatarTom Zanussi <tzanussi@gmail.com>
      Signed-off-by: default avatarSteven Rostedt <srostedt@redhat.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      e1112b4d
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild-fixes · 80a04d3f
      Linus Torvalds authored
      * git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild-fixes:
        docbook: make cleandocs
        kbuild: fix spurious initramfs rebuild
        Documentation: explain the difference between __bitwise and __bitwise__
        kbuild: make it possible for the linker to discard local symbols from vmlinux
        kbuild: remove pointless strdup() on arguments passed to new_module() in modpost
        kbuild: fix a few typos in top-level Makefile
        kbuild: introduce destination-y for exported headers
        kbuild: use git svn instead of git-svn in setlocalversion
        kconfig: fix update-po-config to accect backslash in input
        kbuild: fix option processing for -I in headerdep
      80a04d3f
    • Linus Torvalds's avatar
      Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev · eebb2afb
      Linus Torvalds authored
      * 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev:
        ata: fix obviously wrong comment
        ahci: force CAP_NCQ for earlier NV MCPs
        [libata] sata_via: kill uninit'd var warning
      eebb2afb
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input · b534d388
      Linus Torvalds authored
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (22 commits)
        Input: i8042 - add HP DV9700 to the noloop list
        Input: arrange drivers/input/misc/Makefile in alphabetical order
        Input: add AD7879 Touchscreen driver
        Input: add AD7877 touchscreen driver
        Input: bf54x-keys - fix typo in warning
        Input: add driver for S1 button of rb532
        Input: generic driver for rotary encoders on GPIOs
        Input: hilkbd - fix crash when removing hilkbd module
        Input: atkbd - add quirk for Fujitsu Siemens Amilo PA 1510
        Input: atkbd - consolidate force release quirk setup
        Input: add accelerated touchscreen support for Marvell Zylonite
        Input: ucb1400_ts, mainstone-wm97xx - add BTN_TOUCH events
        Input: wm97xx - use disable_irq_nosync() for Mainstone
        Input: wm97xx - add BTN_TOUCH event to wm97xx to use it with Android
        Input: fix polling of /proc/bus/input/devices
        Input: psmouse - add newline to OLPC HGPK touchpad debugging
        Input: ati_remote2 - check module params
        Input: ati_remote2 - add per device attrs
        Input: ati_remote2 - complete suspend support
        Input: stop autorepeat timer on key release
        ...
      b534d388
    • Rafael J. Wysocki's avatar
      PM/Hibernate: Wait for SCSI devices scan to complete during resume · c7510859
      Rafael J. Wysocki authored
      There is a race between resume from hibernation and the asynchronous
      scanning of SCSI devices and to prevent it from happening we need to
      call scsi_complete_async_scans() during resume from hibernation.
      
      In addition, if the resume from hibernation is userland-driven, it's
      better to wait for all device probes in the kernel to complete before
      attempting to open the resume device.
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      Acked-by: default avatarArjan van de Ven <arjan@linux.intel.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      c7510859
    • Linus Torvalds's avatar
      Merge git://git.infradead.org/iommu-2.6 · 7b11428d
      Linus Torvalds authored
      * git://git.infradead.org/iommu-2.6:
        intel-iommu: Avoid panic() for DRHD at address zero.
        Intel-IOMMU Alignment Issue in dma_pte_clear_range()
      7b11428d
    • Linus Torvalds's avatar
      Merge branch 'x86-fixes-for-linus' of... · b8256b45
      Linus Torvalds authored
      Merge branch 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
      
      * 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
        x86: add linux kernel support for YMM state
        x86: fix wrong section of pat_disable & make it static
        x86: Fix section mismatches in mpparse
        x86: fix set_fixmap to use phys_addr_t
        x86: Document get_user_pages_fast()
        x86, intr-remap: fix eoi for interrupt remapping without x2apic
      b8256b45
    • Linus Torvalds's avatar
      Merge branch 'tracing-fixes-for-linus' of... · 8255309b
      Linus Torvalds authored
      Merge branch 'tracing-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
      
      * 'tracing-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
        tracing/filters: return proper error code when writing filter file
        tracing/filters: allow user input integer to be oct or hex
        tracing/filters: fix NULL pointer dereference
        tracing/filters: NIL-terminate user input filter
        ftrace: Output REC->var instead of __entry->var for trace format
        Make __stringify support variable argument macros too
        tracing: fix document references
        tracing: fix splice return too large
        tracing: update file->f_pos when splice(2) it
        tracing: allocate page when needed
        tracing: disable seeking for trace_pipe_raw
      8255309b
    • Linus Torvalds's avatar
      Merge branch 'core-fixes-for-linus' of... · bf20753c
      Linus Torvalds authored
      Merge branch 'core-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
      
      * 'core-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
        lockdep: continue lock debugging despite some taints
        lockdep: warn about lockdep disabling after kernel taint
      bf20753c
    • Andrew Morton's avatar
      cpufreq: use smp_call_function_[single|many]() in acpi-cpufreq.c · 01599fca
      Andrew Morton authored
      Atttempting to rid us of the problematic work_on_cpu().  Just use
      smp_call_fuction_single() here.
      
      This repairs a 10% sysbench(oltp)+mysql regression which Mike reported,
      due to
      
        commit 6b44003e
        Author: Andrew Morton <akpm@linux-foundation.org>
        Date:   Thu Apr 9 09:50:37 2009 -0600
      
            work_on_cpu(): rewrite it to create a kernel thread on demand
      
      It seems that the kernel calls these acpi-cpufreq functions at a quite
      high frequency.
      
      Valdis Kletnieks also reports that this causes 70-90 forks per second on
      his hardware.
      
      Cc: Valdis.Kletnieks@vt.edu
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Cc: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
      Cc: Len Brown <len.brown@intel.com>
      Cc: Zhao Yakui <yakui.zhao@intel.com>
      Acked-by: default avatarDave Jones <davej@redhat.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Tested-by: default avatarMike Galbraith <efault@gmx.de>
      Cc: "Zhang, Yanmin" <yanmin_zhang@linux.intel.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Acked-by: default avatarIngo Molnar <mingo@elte.hu>
      [ Made it use smp_call_function_many() instead of looping over cpu's
        with smp_call_function_single()    - Linus ]
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      01599fca
    • Linus Torvalds's avatar
      Merge branch 'i2c-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6 · 8371f87c
      Linus Torvalds authored
      * 'i2c-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6:
        i2c: Let new-style drivers implement attach_adapter
        i2c: Fix sparse warnings for I2C_BOARD_INFO()
        i2c-voodoo3: Deprecate in favor of tdfxfb
        i2c-algo-pca: Fix use of uninitialized variable in debug message
      8371f87c
    • Serge E. Hallyn's avatar
      add some long-missing capabilities to fs_mask · 0ad30b8f
      Serge E. Hallyn authored
      When POSIX capabilities were introduced during the 2.1 Linux
      cycle, the fs mask, which represents the capabilities which having
      fsuid==0 is supposed to grant, did not include CAP_MKNOD and
      CAP_LINUX_IMMUTABLE.  However, before capabilities the privilege
      to call these did in fact depend upon fsuid==0.
      
      This patch introduces those capabilities into the fsmask,
      restoring the old behavior.
      
      See the thread starting at http://lkml.org/lkml/2009/3/11/157 for
      reference.
      
      Note that if this fix is deemed valid, then earlier kernel versions (2.4
      and 2.2) ought to be fixed too.
      
      Changelog:
      	[Mar 23] Actually delete old CAP_FS_SET definition...
      	[Mar 20] Updated against J. Bruce Fields's patch
      Reported-by: default avatarIgor Zhbanov <izh1979@gmail.com>
      Signed-off-by: default avatarSerge E. Hallyn <serue@us.ibm.com>
      Cc: stable@kernel.org
      Cc: J. Bruce Fields <bfields@citi.umich.edu>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      0ad30b8f