1. 07 1月, 2010 8 次提交
    • L
      tracing: Consolidate protection of reader access to the ring buffer · 7e53bd42
      Lai Jiangshan 提交于
      At the beginning, access to the ring buffer was fully serialized
      by trace_types_lock. Patch d7350c3f gives more freedom to readers,
      and patch b04cc6b1 adds code to protect trace_pipe and cpu#/trace_pipe.
      
      But actually it is not enough, ring buffer readers are not always
      read-only, they may consume data.
      
      This patch makes accesses to trace, trace_pipe, trace_pipe_raw
      cpu#/trace, cpu#/trace_pipe and cpu#/trace_pipe_raw serialized.
      And removes tracing_reader_cpumask which is used to protect trace_pipe.
      
      Details:
      
      Ring buffer serializes readers, but it is low level protection.
      The validity of the events (which returns by ring_buffer_peek() ..etc)
      are not protected by ring buffer.
      
      The content of events may become garbage if we allow another process to consume
      these events concurrently:
        A) the page of the consumed events may become a normal page
           (not reader page) in ring buffer, and this page will be rewritten
           by the events producer.
        B) The page of the consumed events may become a page for splice_read,
           and this page will be returned to system.
      
      This patch adds trace_access_lock() and trace_access_unlock() primitives.
      
      These primitives allow multi process access to different cpu ring buffers
      concurrently.
      
      These primitives don't distinguish read-only and read-consume access.
      Multi read-only access is also serialized.
      
      And we don't use these primitives when we open files,
      we only use them when we read files.
      Signed-off-by: NLai Jiangshan <laijs@cn.fujitsu.com>
      LKML-Reference: <4B447D52.1050602@cn.fujitsu.com>
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      7e53bd42
    • L
      tracing: Remove show_format and related macros from TRACE_EVENT · 0fa0edaf
      Lai Jiangshan 提交于
      The previous patches added the use of print_fmt string and changes
      the trace_define_field() function to also create the fields and
      format output for the event format files.
      
         text	   data	    bss	    dec	    hex	filename
      5857201	1355780	9336808	16549789	 fc879d	vmlinux
      5884589	1351684	9337896	16574169	 fce6d9	vmlinux-orig
      
      The above shows the size of the vmlinux after this patch set
      compared to the vmlinux-orig which is before the patch set.
      
      This saves us 27k on text, 1k on bss and adds just 4k of data.
      
      The total savings of 24k in size.
      Signed-off-by: NLai Jiangshan <laijs@cn.fujitsu.com>
      LKML-Reference: <4B273D4D.40604@cn.fujitsu.com>
      Acked-by: NMasami Hiramatsu <mhiramat@redhat.com>
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      0fa0edaf
    • L
      tracing: Use defined fields and print_fmt to print formats · 5a65e956
      Lai Jiangshan 提交于
      The calls ftrace_format_##call() and ftrace_define_fields_##call()
      are almost duplicate in functionality. With the addition of the
      print_fmt in previous patches, these two functions can be merged
      into one.
      
      The trace_define_field() defines the fields and links them into
      the struct ftrace_event_call. The previous patches introduced
      the print_fmt field and this can now be used with the trace_define_field()
      to create the event format file fields and print_fmt field.
      
      The struct ftrace_event_call->fields are used to print the fields
      The struct ftrace_event_call->print_fmt is used to print
      the "print fmt: XXXXXXXXXXX" line.
      Signed-off-by: NLai Jiangshan <laijs@cn.fujitsu.com>
      LKML-Reference: <4B273D49.5000006@cn.fujitsu.com>
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      5a65e956
    • S
      tracing: Have syscall tracing call its own init function · c7ef3a90
      Steven Rostedt 提交于
      In the clean up of having all events call one specific function,
      the syscall event init was changed to call this helper function.
      
      With the new print_fmt updates, the syscalls need to do special
      initializations. This patch converts the syscall events to call
      its own init function again.
      
      Cc: Lai Jiangshan <laijs@cn.fujitsu.com>
      Cc: Li Zefan <lizf@cn.fujitsu.com>
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      c7ef3a90
    • L
      tracing/kprobes: Init print_fmt for kprobe events · a342a028
      Lai Jiangshan 提交于
      This is part of a patch set that removes the show_format method
      in the ftrace event macros.
      
      Add the print_fmt initialization to the kprobe events.
      The print_fmt is still not used, but will be in the follow up
      patches.
      Signed-off-by: NLai Jiangshan <laijs@cn.fujitsu.com>
      LKML-Reference: <4B273D45.3080100@cn.fujitsu.com>
      Acked-by: NMasami Hiramatsu <mhiramat@redhat.com>
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      a342a028
    • L
      tracing/syscalls: Init print_fmt for syscall events · 50307a45
      Lai Jiangshan 提交于
      This is part of a patch set that removes the show_format method
      in the ftrace event macros.
      
      Add the print_fmt initialization to the syscall events.
      The print_fmt is still not used, but will be in the follow up
      patches.
      Signed-off-by: NLai Jiangshan <laijs@cn.fujitsu.com>
      LKML-Reference: <4B273D41.609@cn.fujitsu.com>
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      50307a45
    • L
      tracing: Add print_fmt field · 509e760c
      Lai Jiangshan 提交于
      This is part of a patch set that removes the show_format method
      in the ftrace event macros.
      
      The print_fmt field is added to hold the string that shows
      the print_fmt in the event format files. This patch only adds
      the field but it is currently not used. Later patches will use
      this field to enable us to remove the show_format field
      and function.
      Signed-off-by: NLai Jiangshan <laijs@cn.fujitsu.com>
      LKML-Reference: <4B273D3E.2000704@cn.fujitsu.com>
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      509e760c
    • L
      tracing: Have __dynamic_array() define a field · 809826a3
      Lai Jiangshan 提交于
      This is part of a patch set that removes the show_format method
      in the ftrace event macros.
      
      This patch set requires that all fields are added to the
      ftrace_event_call->fields. This patch changes __dynamic_array()
      to call trace_define_field() to include fields that use __dynamic_array().
      Signed-off-by: NLai Jiangshan <laijs@cn.fujitsu.com>
      LKML-Reference: <4B273D36.8090100@cn.fujitsu.com>
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      809826a3
  2. 06 1月, 2010 5 次提交
  3. 05 1月, 2010 16 次提交
  4. 04 1月, 2010 11 次提交