1. 18 2月, 2009 7 次提交
    • F
      tracing/function-graph-tracer: trace the idle tasks · 5b058bcd
      Frederic Weisbecker 提交于
      When the function graph tracer is activated, it iterates over the task_list
      to allocate a stack to store the return addresses.
      
      But the per cpu idle tasks are not iterated by using
      do_each_thread / while_each_thread.
      
      So we have to iterate on them manually.
      
      This fixes somes weirdness in the traces and many losses of traces.
      Examples on two cpus:
      
       0)   Xorg-4287    |   2.906 us    |              }
       0)   Xorg-4287    |   3.965 us    |            }
       0)   Xorg-4287    |   5.302 us    |          }
       ------------------------------------------
       0)   Xorg-4287    =>    <idle>-0
       ------------------------------------------
      
       0)    <idle>-0    |   2.861 us    |                        }
       0)    <idle>-0    |   0.526 us    |                        set_normalized_timespec();
       0)    <idle>-0    |   7.201 us    |                      }
       0)    <idle>-0    |   8.214 us    |                    }
       0)    <idle>-0    |               |                    clockevents_program_event() {
       0)    <idle>-0    |               |                      lapic_next_event() {
       0)    <idle>-0    |   0.510 us    |                        native_apic_mem_write();
       0)    <idle>-0    |   1.546 us    |                      }
       0)    <idle>-0    |   2.583 us    |                    }
       0)    <idle>-0    | + 12.435 us   |                  }
       0)    <idle>-0    | + 13.470 us   |                }
       0)    <idle>-0    |   0.608 us    |                _spin_unlock_irqrestore();
       0)    <idle>-0    | + 23.270 us   |              }
       0)    <idle>-0    | + 24.336 us   |            }
       0)    <idle>-0    | + 25.417 us   |          }
       0)    <idle>-0    |   0.593 us    |          _spin_unlock();
       0)    <idle>-0    | + 41.869 us   |        }
       0)    <idle>-0    | + 42.906 us   |      }
       0)    <idle>-0    | + 95.035 us   |    }
       0)    <idle>-0    |   0.540 us    |    menu_reflect();
       0)    <idle>-0    | ! 100.404 us  |  }
       0)    <idle>-0    |   0.564 us    |  mce_idle_callback();
       0)    <idle>-0    |               |  enter_idle() {
       0)    <idle>-0    |   0.526 us    |    mce_idle_callback();
       0)    <idle>-0    |   1.757 us    |  }
       0)    <idle>-0    |               |  cpuidle_idle_call() {
       0)    <idle>-0    |               |    menu_select() {
       0)    <idle>-0    |   0.525 us    |      pm_qos_requirement();
       0)    <idle>-0    |   0.518 us    |      tick_nohz_get_sleep_length();
       0)    <idle>-0    |   2.621 us    |    }
      [...]
       1)    <idle>-0    |   0.518 us    |              touch_softlockup_watchdog();
       1)    <idle>-0    | + 14.355 us   |            }
       1)    <idle>-0    | + 22.840 us   |          }
       1)    <idle>-0    | + 25.949 us   |        }
       1)    <idle>-0    |               |        handle_irq() {
       1)    <idle>-0    |   0.511 us    |          irq_to_desc();
       1)    <idle>-0    |               |          handle_edge_irq() {
       1)    <idle>-0    |   0.638 us    |            _spin_lock();
       1)    <idle>-0    |               |            ack_apic_edge() {
       1)    <idle>-0    |   0.510 us    |              irq_to_desc();
       1)    <idle>-0    |               |              move_native_irq() {
       1)    <idle>-0    |   0.510 us    |                irq_to_desc();
       1)    <idle>-0    |   1.532 us    |              }
       1)    <idle>-0    |   0.511 us    |              native_apic_mem_write();
       ------------------------------------------
       1)    <idle>-0    =>    cat-5073
       ------------------------------------------
      
       1)    cat-5073    |   3.731 us    |                    }
       1)    cat-5073    |               |                    run_local_timers() {
       1)    cat-5073    |   0.533 us    |                      hrtimer_run_queues();
       1)    cat-5073    |               |                      raise_softirq() {
       1)    cat-5073    |               |                        __raise_softirq_irqoff() {
       1)    cat-5073    |               |                          /* nr: 1 */
       1)    cat-5073    |   2.718 us    |                        }
       1)    cat-5073    |   3.814 us    |                      }
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      5b058bcd
    • S
      ftrace: show unlimited when traceon or traceoff has no counter · 35ebf1ca
      Steven Rostedt 提交于
      Impact: clean up
      
      The traceon and traceoff function probes are confusing to developers
      to what happens when a counter is not specified. This should help
      clear things up.
      
       # echo "*:traceoff" > set_ftrace_filter
       # cat /debug/tracing/set_ftrace_filter
      
        #### all functions enabled ####
        do_fork:traceoff:unlimited
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      35ebf1ca
    • W
      tracing: fix typing mistake in hint message and comments · 73d8b8bc
      Wenji Huang 提交于
      Impact: cleanup
      
      Fix incorrect hint message in code and typos in comments.
      Signed-off-by: NWenji Huang <wenji.huang@oracle.com>
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      73d8b8bc
    • W
      tracing: fix the return value of trace selftest · d2ef7c2f
      Wenji Huang 提交于
      This patch is to fix the return value of trace_selftest_startup_sysprof
      and trace_selftest_startup_branch on failure.
      Signed-off-by: NWenji Huang <wenji.huang@oracle.com>
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      d2ef7c2f
    • W
      tracing: use the more proper parameter · af513098
      Wenji Huang 提交于
      Pass tsk to tracing_record_cmdline instead of current.
      Signed-off-by: NWenji Huang <wenji.huang@oracle.com>
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      af513098
    • S
      ftrace: rename _hook to _probe · b6887d79
      Steven Rostedt 提交于
      Impact: clean up
      
      Ingo Molnar did not like the _hook naming convention used by the
      select function tracer. Luis Claudio R. Goncalves suggested using
      the "_probe" extension. This patch implements the change of
      calling the functions and variables "_hook" and replacing them
      with "_probe".
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      b6887d79
    • S
      ftrace: clean up coding style · 6a24a244
      Steven Rostedt 提交于
      Ingo Molnar pointed out some coding style issues with the recent ftrace
      updates. This patch cleans them up.
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      6a24a244
  2. 17 2月, 2009 16 次提交
    • I
      ftrace: fix !CONFIG_DYNAMIC_FTRACE ftrace_swapper_pid definition · 73d3fd96
      Ingo Molnar 提交于
      Impact: build fix
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      73d3fd96
    • S
      ftrace: add pretty print function for traceon and traceoff hooks · e110e3d1
      Steven Rostedt 提交于
      This patch adds a pretty print version of traceon and traceoff
      output for set_ftrace_filter.
      
        # echo 'sys_open:traceon:4' > set_ftrace_filter
        # cat set_ftrace_filter
      
       #### all functions enabled ####
       sys_open:traceon:count=4
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      e110e3d1
    • S
      ftrace: add pretty print to selected fuction traces · 809dcf29
      Steven Rostedt 提交于
      This patch adds a call back for the tracers that have hooks to
      selected functions. This allows the tracer to show better output
      in the set_ftrace_filter file.
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      809dcf29
    • S
      ftrace: show selected functions in set_ftrace_filter · 8fc0c701
      Steven Rostedt 提交于
      This patch adds output to show what functions have tracer hooks
      attached to them.
      
        # echo 'sys_open:traceon:4' > /debug/tracing/set_ftrace_filter
        # cat set_ftrace_filter
      
       #### all functions enabled ####
       sys_open:ftrace_traceon:0000000000000004
      
        # echo 'do_fork:traceoff:' > set_ftrace_filter
        # cat set_ftrace_filter
      
       #### all functions enabled ####
       sys_open:ftrace_traceon:0000000000000002
       do_fork:ftrace_traceoff:ffffffffffffffff
      
      Note the 4 changed to a 2. This is because The code was executed twice
      since the traceoff was added. If a cat is done again:
      
       #### all functions enabled ####
       sys_open:ftrace_traceon
       do_fork:ftrace_traceoff:ffffffffffffffff
      
      The number disappears. That is because it will not print a NULL.
      
      Callbacks to allow the tracer to pretty print will be implemented soon.
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      8fc0c701
    • S
      ftrace: add traceon traceoff commands to enable/disable the buffers · 23b4ff3a
      Steven Rostedt 提交于
      This patch adds the new function selection commands traceon and
      traceoff. traceon sets the function to enable the ring buffers
      while traceoff disables the ring buffers.  You can pass in the
      number of times you want the command to be executed when the function
      is hit. It will only execute if the state of the buffers are not
      already in that state.
      
      Example:
      
       # echo do_fork:traceon:4
      
      Will enable the ring buffers if they are disabled every time it
      hits do_fork, up to 4 times.
      
       # echo sys_close:traceoff
      
      This will disable the ring buffers every time (unlimited) when
      sys_close is called.
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      23b4ff3a
    • S
      ring-buffer: add tracing_is_on to test if ring buffer is enabled · 988ae9d6
      Steven Rostedt 提交于
      This patch adds the tracing_is_on() interface to tell if the ring
      buffer is turned on or not.
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      988ae9d6
    • S
      ftrace: trace different functions with a different tracer · 59df055f
      Steven Rostedt 提交于
      Impact: new feature
      
      Currently, the function tracer only gives you an ability to hook
      a tracer to all functions being traced. The dynamic function trace
      allows you to pick and choose which of those functions will be
      traced, but all functions being traced will call all tracers that
      registered with the function tracer.
      
      This patch adds a new feature that allows a tracer to hook to specific
      functions, even when all functions are being traced. It allows for
      different functions to call different tracer hooks.
      
      The way this is accomplished is by a special function that will hook
      to the function tracer and will set up a hash table knowing which
      tracer hook to call with which function. This is the most general
      and easiest method to accomplish this. Later, an arch may choose
      to supply their own method in changing the mcount call of a function
      to call a different tracer. But that will be an exercise for the
      future.
      
      To register a function:
      
       struct ftrace_hook_ops {
      	void			(*func)(unsigned long ip,
      					unsigned long parent_ip,
      					void **data);
      	int			(*callback)(unsigned long ip, void **data);
      	void			(*free)(void **data);
       };
      
       int register_ftrace_function_hook(char *glob, struct ftrace_hook_ops *ops,
      				  void *data);
      
      glob is a simple glob to search for the functions to hook.
      ops is a pointer to the operations (listed below)
      data is the default data to be passed to the hook functions when traced
      
      ops:
       func is the hook function to call when the functions are traced
       callback is a callback function that is called when setting up the hash.
         That is, if the tracer needs to do something special for each
         function, that is being traced, and wants to give each function
         its own data. The address of the entry data is passed to this
         callback, so that the callback may wish to update the entry to
         whatever it would like.
       free is a callback for when the entry is freed. In case the tracer
         allocated any data, it is give the chance to free it.
      
      To unregister we have three functions:
      
        void
        unregister_ftrace_function_hook(char *glob, struct ftrace_hook_ops *ops,
      				void *data)
      
      This will unregister all hooks that match glob, point to ops, and
      have its data matching data. (note, if glob is NULL, blank or '*',
      all functions will be tested).
      
        void
        unregister_ftrace_function_hook_func(char *glob,
      				 struct ftrace_hook_ops *ops)
      
      This will unregister all functions matching glob that has an entry
      pointing to ops.
      
        void unregister_ftrace_function_hook_all(char *glob)
      
      This simply unregisters all funcs.
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      59df055f
    • S
      ftrace: consolidate mutexes · e6ea44e9
      Steven Rostedt 提交于
      Impact: clean up
      
      Now that ftrace_lock is a mutex, there is no reason to have three
      different mutexes protecting similar data. All the mutex paths
      are not in hot paths, so having a mutex to cover more data is
      not a problem.
      
      This patch removes the ftrace_sysctl_lock and ftrace_start_lock
      and uses the ftrace_lock to protect the locations that were protected
      by these locks. By doing so, this change also removes some of
      the lock nesting that was taking place.
      
      There are still more mutexes in ftrace.c that can probably be
      consolidated, but they can be dealt with later. We need to be careful
      about the way the locks are nested, and by consolidating, we can cause
      a recursive deadlock.
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      e6ea44e9
    • S
      ftrace: convert ftrace_lock from a spinlock to mutex · 52baf119
      Steven Rostedt 提交于
      Impact: clean up
      
      The older versions of ftrace required doing the ftrace list
      search under atomic context. Now all the calls are in non-atomic
      context. There is no reason to keep the ftrace_lock as a spinlock.
      
      This patch converts it to a mutex.
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      52baf119
    • S
      ftrace: add command interface for function selection · f6180773
      Steven Rostedt 提交于
      Allow for other tracers to add their own commands for function
      selection. This interface gives a trace the ability to name a
      command for function selection. Right now it is pretty limited
      in what it offers, but this is a building step for more features.
      
      The :mod: command is converted to this interface and also serves
      as a template for other implementations.
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      f6180773
    • S
      ftrace: enable filtering only when a function is filtered on · e68746a2
      Steven Rostedt 提交于
      Impact: fix to prevent empty set_ftrace_filter and no ftrace output
      
      The function filter is used to only trace a given set of functions.
      The filter is enabled when a function name is echoed into the
      set_ftrace_filter file. But if the name has a typo and the function
      is not found, the filter is enabled, but no function is listed.
      
      This makes a confusing situation where set_ftrace_filter is empty
      but no functions ever get enabled for tracing.
      
      For example:
      
       # cat /debug/tracing/set_ftrace_filter
      
        #### all functions enabled ####
      
       # echo bad_name > set_ftrace_filter
       # cat /debug/tracing/set_ftrace_filter
      
       # echo function > current_tracer
       # cat trace
      
        # tracer: nop
        #
        #           TASK-PID    CPU#    TIMESTAMP  FUNCTION
        #              | |       |          |         |
      
      This patch changes that to only enable filtering if a function
      is set to be filtered on. Now, the filter is not enabled if
      a bad name is echoed into set_ftrace_filter.
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      e68746a2
    • S
      ftrace: add module command function filter selection · 64e7c440
      Steven Rostedt 提交于
      This patch adds a "command" syntax to the function filtering files:
      
        /debugfs/tracing/set_ftrace_filter
        /debugfs/tracing/set_ftrace_notrace
      
      Of the format:  <function>:<command>:<parameter>
      
      The command is optional, and dependent on the command, so are
      the parameters.
      
       echo do_fork > set_ftrace_filter
      
      Will only trace 'do_fork'.
      
       echo 'sched_*' > set_ftrace_filter
      
      Will only trace functions starting with the letters 'sched_'.
      
       echo '*:mod:ext3' > set_ftrace_filter
      
      Will trace only the ext3 module functions.
      
       echo '*write*:mod:ext3' > set_ftrace_notrace
      
      Will prevent the ext3 functions with the letters 'write' in
      the name from being traced.
      
       echo '!*_allocate:mod:ext3' > set_ftrace_filter
      
      Will remove the functions in ext3 that end with the letters
      '_allocate' from the ftrace filter.
      
      Although this patch implements the 'command' format, only the
      'mod' command is supported. More commands to follow.
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      64e7c440
    • S
      ftrace: break up ftrace_match_records into smaller components · 9f4801e3
      Steven Rostedt 提交于
      Impact: clean up
      
      ftrace_match_records does a lot of things that other features
      can use. This patch breaks up ftrace_match_records and pulls
      out ftrace_setup_glob and ftrace_match_record.
      
      ftrace_setup_glob prepares a simple glob expression for use with
      ftrace_match_record. ftrace_match_record compares a single record
      with a glob type.
      
      Breaking this up will allow for more features to run on individual
      records.
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      9f4801e3
    • S
      ftrace: rename ftrace_match to ftrace_match_records · 7f24b31b
      Steven Rostedt 提交于
      Impact: clean up
      
      ftrace_match is too generic of a name. What it really does is
      search all records and matches the records with the given string,
      and either sets or unsets the functions to be traced depending
      on if the parameter 'enable' is set or not.
      
      This allows us to make another function called ftrace_match that
      can be used to test a single record.
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      7f24b31b
    • S
      ftrace: add do_for_each_ftrace_rec and while_for_each_ftrace_rec · 265c831c
      Steven Rostedt 提交于
      Impact: clean up
      
      To iterate over all the functions that dynamic trace knows about
      it requires two for loops. One to iterate over the pages and the
      other to iterate over the records within the page.
      
      There are several duplications of these loops in ftrace.c. This
      patch creates the macros do_for_each_ftrace_rec and
      while_for_each_ftrace_rec to handle this logic, and removes the
      duplicate code.
      
      While making this change, I also discovered and fixed a small
      bug that one of the iterations should exit the loop after it found the
      record it was searching for. This used a break when it should have
      used a goto, since there were two loops it needed to break out
      from.  No real harm was done by this bug since it would only continue
      to search the other records, and the code was in a slow path anyway.
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      265c831c
    • S
      ftrace: state that all functions are enabled in set_ftrace_filter · 0c75a3ed
      Steven Rostedt 提交于
      Impact: clean up, make set_ftrace_filter less confusing
      
      The set_ftrace_filter shows only the functions that will be traced.
      But when it is empty, it will trace all functions. This can be a bit
      confusing.
      
      This patch makes set_ftrace_filter show:
      
        #### all functions enabled ####
      
      When all functions will be traced, and we do not filter only a select
      few.
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      0c75a3ed
  3. 16 2月, 2009 3 次提交
    • R
      tracing: fix section mismatch in trace_hw_branches.c · a234aa9e
      Rakib Mullick 提交于
      The function bts_trace_init() references a variable
      bts_hotcpu_notifier which is marked
      as __cpuinitdata. Thus causes section mismatch. This patch fixes it.
      
         LD      kernel/trace/built-in.o
       WARNING: kernel/trace/built-in.o(.text+0xc90c): Section mismatch in
       reference from the function bts_trace_init() to the variable
       .cpuinit.data:bts_hotcpu_notifier
       The function bts_trace_init() references
       the variable __cpuinitdata bts_hotcpu_notifier.
       This is often because bts_trace_init lacks a __cpuinitdata
       annotation or the annotation of bts_hotcpu_notifier is wrong.
      
       WARNING: kernel/trace/built-in.o(.text+0xc92a): Section mismatch in
       reference from the function bts_trace_reset() to the variable
       .cpuinit.data:bts_hotcpu_notifier
       The function bts_trace_reset() references
       the variable __cpuinitdata bts_hotcpu_notifier.
       This is often because bts_trace_reset lacks a __cpuinitdata
       annotation or the annotation of bts_hotcpu_notifier is wrong.
      Signed-off-by: NRakib Mullick <rakib.mullick@gmail.com>
      Cc: markus.t.metzger@gmail.com
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      a234aa9e
    • P
      trace: mmiotrace to the tracer menu in Kconfig · 6bc5c366
      Pekka Paalanen 提交于
      Impact: cosmetic change in Kconfig menu layout
      
      This patch was originally suggested by Peter Zijlstra, but seems it
      was forgotten.
      
      CONFIG_MMIOTRACE and CONFIG_MMIOTRACE_TEST were selectable
      directly under the Kernel hacking / debugging menu in the kernel
      configuration system. They were present only for x86 and x86_64.
      
      Other tracers that use the ftrace tracing framework are in their own
      sub-menu. This patch moves the mmiotrace configuration options there.
      Since the Kconfig file, where the tracer menu is, is not architecture
      specific, HAVE_MMIOTRACE_SUPPORT is introduced and provided only by
      x86/x86_64. CONFIG_MMIOTRACE now depends on it.
      Signed-off-by: NPekka Paalanen <pq@iki.fi>
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      6bc5c366
    • P
      mmiotrace: count events lost due to not recording · 391b170f
      Pekka Paalanen 提交于
      Impact: enhances lost events counting in mmiotrace
      
      The tracing framework, or the ring buffer facility it uses, has a switch
      to stop recording data. When recording is off, the trace events will be
      lost. The framework does not count these, so mmiotrace has to count them
      itself.
      Signed-off-by: NPekka Paalanen <pq@iki.fi>
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      391b170f
  4. 13 2月, 2009 2 次提交
  5. 11 2月, 2009 9 次提交
    • A
      ring_buffer: pahole struct ring_buffer · 00f62f61
      Arnaldo Carvalho de Melo 提交于
      While fixing some bugs in pahole (built-in.o files were not being
      processed due to relocation problems) I found out about these packable
      structures:
      
      $ pahole --packable kernel/trace/ring_buffer.o  | grep ring
      ring_buffer	72	64	8
      ring_buffer_per_cpu	112	104	8
      
      If we take a look at the current layout of struct ring_buffer we can see
      that we have two 4 bytes holes.
      
      $ pahole -C ring_buffer kernel/trace/ring_buffer.o
      struct ring_buffer {
      	unsigned int               pages;           /*     0     4 */
      	unsigned int               flags;           /*     4     4 */
      	int                        cpus;            /*     8     4 */
      
      	/* XXX 4 bytes hole, try to pack */
      
      	cpumask_var_t              cpumask;         /*    16     8 */
      	atomic_t                   record_disabled; /*    24     4 */
      
      	/* XXX 4 bytes hole, try to pack */
      
      	struct mutex               mutex;           /*    32    32 */
      	/* --- cacheline 1 boundary (64 bytes) --- */
      	struct ring_buffer_per_cpu * * buffers;     /*    64     8 */
      
      	/* size: 72, cachelines: 2, members: 7 */
      	/* sum members: 64, holes: 2, sum holes: 8 */
      	/* last cacheline: 8 bytes */
      };
      
      So, if I ask pahole to reorganize it:
      
      $ pahole -C ring_buffer --reorganize kernel/trace/ring_buffer.o
      
      struct ring_buffer {
      	unsigned int               pages;           /*     0     4 */
      	unsigned int               flags;           /*     4     4 */
      	int                        cpus;            /*     8     4 */
      	atomic_t                   record_disabled; /*    12     4 */
      	cpumask_var_t              cpumask;         /*    16     8 */
      	struct mutex               mutex;           /*    24    32 */
      	struct ring_buffer_per_cpu * * buffers;     /*    56     8 */
      	/* --- cacheline 1 boundary (64 bytes) --- */
      
      	/* size: 64, cachelines: 1, members: 7 */
      };   /* saved 8 bytes and 1 cacheline! */
      
      We get it using just one 64 bytes cacheline.
      
      To see what it did:
      
      $ pahole -C ring_buffer --reorganize --show_reorg_steps \
      	kernel/trace/ring_buffer.o | grep \/
      /* Moving 'record_disabled' from after 'cpumask' to after 'cpus' */
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      00f62f61
    • F
      tracing/sysprof: add missing tracing_{start,stop}_record_cmdline() · b22f4858
      Frederic Weisbecker 提交于
      Add the missing pair tracing_{start,stop}_record_cmdline() to record well
      the cmdline associated with pid.
      
      Changes in v2:
      
      - fix a build error, the sched_switch tracer is needed to record the
        cmdline.
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Acked-by: NSteven Rostedt <rostedt@goodmis.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      b22f4858
    • H
      tracing: fix sparse warning: attribute function with __acquires/__releases · e7669b8e
      Hannes Eder 提交于
      Fix this sparse warning:
      
        kernel/trace/trace.c:458:9: warning: context imbalance in 'register_tracer' - unexpected unlock
      Signed-off-by: NHannes Eder <hannes@hanneseder.net>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      e7669b8e
    • H
      tracing: fix sparse warnings: fix (un-)signedness · 5e39841c
      Hannes Eder 提交于
      Fix these sparse warnings:
      
        kernel/trace/ring_buffer.c:70:37: warning: incorrect type in argument 2 (different signedness)
        kernel/trace/ring_buffer.c:84:39: warning: incorrect type in argument 2 (different signedness)
        kernel/trace/ring_buffer.c:96:43: warning: incorrect type in argument 2 (different signedness)
        kernel/trace/ring_buffer.c:2475:13: warning: incorrect type in argument 2 (different signedness)
        kernel/trace/ring_buffer.c:2475:13: warning: incorrect type in argument 2 (different signedness)
        kernel/trace/ring_buffer.c:2478:42: warning: incorrect type in argument 2 (different signedness)
        kernel/trace/ring_buffer.c:2478:42: warning: incorrect type in argument 2 (different signedness)
        kernel/trace/ring_buffer.c:2500:40: warning: incorrect type in argument 3 (different signedness)
        kernel/trace/ring_buffer.c:2505:44: warning: incorrect type in argument 2 (different signedness)
        kernel/trace/ring_buffer.c:2507:46: warning: incorrect type in argument 2 (different signedness)
        kernel/trace/trace.c:2130:40: warning: incorrect type in argument 3 (different signedness)
        kernel/trace/trace.c:2280:40: warning: incorrect type in argument 3 (different signedness)
      Signed-off-by: NHannes Eder <hannes@hanneseder.net>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      5e39841c
    • H
      tracing: fix sparse warnings: make symbols static · 4fd27358
      Hannes Eder 提交于
      Impact: make global variables and a global function static
      
      The function '__trace_userstack' does not seem to have a caller, so it
      is commented out.
      
      Fix this sparse warnings:
        kernel/trace/trace.c:82:5: warning: symbol 'tracing_disabled' was not declared. Should it be static?
        kernel/trace/trace.c:600:10: warning: symbol 'trace_record_cmdline_disabled' was not declared. Should it be static?
        kernel/trace/trace.c:957:6: warning: symbol '__trace_userstack' was not declared. Should it be static?
        kernel/trace/trace.c:1694:5: warning: symbol 'tracing_release' was not declared. Should it be static?
      Signed-off-by: NHannes Eder <hannes@hanneseder.net>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      4fd27358
    • W
      tracing: fix typos in comments · c3706f00
      Wenji Huang 提交于
      Impact: clean up.
      
      Fix typos in the comments.
      Signed-off-by: NWenji Huang <wenji.huang@oracle.com>
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      c3706f00
    • W
      tracing: provide correct return value after outputting the event · 810dc732
      Wenji Huang 提交于
      This patch is to make the function return early on failure, and give
      correct return value on success.
      Signed-off-by: NWenji Huang <wenji.huang@oracle.com>
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      810dc732
    • W
      tracing: remove unneeded variable · f54fc98a
      Wenji Huang 提交于
      Impact: clean up.
      
      Remove the unnecessary variable ret.
      Signed-off-by: NWenji Huang <wenji.huang@oracle.com>
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      f54fc98a
    • T
      tracing: storage class should be before const qualifier · 4543ae7c
      Tobias Klauser 提交于
      The C99 specification states in section 6.11.5:
      
      The placement of a storage-class specifier other than at the beginning
      of the declaration specifiers in a declaration is an obsolescent
      feature.
      Signed-off-by: NTobias Klauser <tklauser@distanz.ch>
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      4543ae7c
  6. 10 2月, 2009 3 次提交
    • L
      ring_buffer: fix ring_buffer_read_page() · 667d2412
      Lai Jiangshan 提交于
      Impact: change API and init bpage when copy
      
      ring_buffer_read_page()/rb_remove_entries() may be called for
      a partially consumed page.
      
      Add a parameter for rb_remove_entries() and make it update
      cpu_buffer->entries correctly for partially consumed pages.
      
      ring_buffer_read_page() now returns the offset to the next event.
      
      Init the bpage's time_stamp when return value is 0.
      Signed-off-by: NLai Jiangshan <laijs@cn.fujitsu.com>
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      667d2412
    • L
      ring_buffer: fix typing mistake · b85fa01e
      Lai Jiangshan 提交于
      Impact: Fix bug
      
      I found several very very curious line.
      It's so curious that it may be brought by typing mistake.
      
      When (cpu_buffer->reader_page == cpu_buffer->commit_page):
      
      1) We haven't copied it for bpage is changed:
         bpage = cpu_buffer->reader_page->page;
         memcpy(bpage->data, cpu_buffer->reader_page->page->data + read ... )
      2) We need update cpu_buffer->reader_page->read, but
         "cpu_buffer->reader_page += read;" is not right.
      
      [
        This bug was a typo. The commit->reader_page is a page pointer
        and not an index into the page. The line should have been
        commit->reader_page->read += read.  The other changes
        by Lai are nice clean ups to the code.  - SDR
      ]
      Signed-off-by: NLai Jiangshan <laijs@cn.fujitsu.com>
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      b85fa01e
    • S
      tracing: clean up splice code · 34cd4998
      Steven Rostedt 提交于
      Ingo Molnar suggested a series of clean ups for the splice code.
      This patch implements those suggestions.
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      34cd4998