15 Jan, 2010

6 commits

  • We should be clear on 2 things:

    - the length parameter of a match callback includes
    tailing '\0'.

    - the string to be searched might not be NULL-terminated.

    Signed-off-by: Li Zefan
    LKML-Reference:
    Signed-off-by: Steven Rostedt

    Li Zefan
     
  • MATCH_FULL matching for PTR_STRING is not working correctly:

    # echo 'func == vt' > events/bkl/lock_kernel/filter
    # echo 1 > events/bkl/lock_kernel/enable
    ...
    # cat trace
    Xorg-1484 [000] 1973.392586: lock_kernel: ... func=vt_ioctl()
    gpm-1402 [001] 1974.027740: lock_kernel: ... func=vt_ioctl()

    We should pass to regex.match(..., len) the length (including '\0')
    of the source string instead of the length of the pattern string.

    Signed-off-by: Li Zefan
    LKML-Reference:
    Acked-by: Frederic Weisbecker
    Signed-off-by: Steven Rostedt

    Li Zefan
     
  • The @str might not be NULL-terminated if it's of type
    DYN_STRING or STATIC_STRING, so we should use strnstr()
    instead of strstr().

    Signed-off-by: Li Zefan
    LKML-Reference:
    Acked-by: Frederic Weisbecker
    Signed-off-by: Steven Rostedt

    Li Zefan
     
  • For '*foo' pattern, we should allow any string ending with
    'foo', but event filtering incorrectly disallows strings
    like bar_foo_foo:

    Signed-off-by: Li Zefan
    LKML-Reference:
    Acked-by: Frederic Weisbecker
    Signed-off-by: Steven Rostedt

    Li Zefan
     
  • MATCH_FRONT_ONLY actually is a full matching:

    # ./perf record -R -f -a -e lock:lock_acquire \
    --filter 'name ~rcu_*' sleep 1
    # ./perf trace
    (no output)

    We should pass the length of the pattern string to strncmp().

    Signed-off-by: Li Zefan
    LKML-Reference:
    Acked-by: Frederic Weisbecker
    Signed-off-by: Steven Rostedt

    Li Zefan
     
  • For '*foo' pattern, we should allow any string ending with
    'foo', but ftrace filter incorrectly disallows strings
    like bar_foo_foo:

    # echo '*io' > set_ftrace_filter
    # cat set_ftrace_filter | grep 'req_bio_endio'
    # cat available_filter_functions | grep 'req_bio_endio'
    req_bio_endio

    Signed-off-by: Li Zefan
    LKML-Reference:
    Acked-by: Frederic Weisbecker
    Signed-off-by: Steven Rostedt

    Li Zefan
     

07 Jan, 2010

2 commits

  • If the very unlikely case happens where the writer moves the head by one
    between where the head page is read and where the new reader page
    is assigned _and_ the writer then writes and wraps the entire ring buffer
    so that the head page is back to what was originally read as the head page,
    the page to be swapped will have a corrupted next pointer.

    Simple solution is to wrap the assignment of the next pointer with a
    rb_list_head().

    Signed-off-by: Steven Rostedt

    Steven Rostedt
     
  • This reference at the end of rb_get_reader_page() was causing off-by-one
    writes to the prev pointer of the page after the reader page when that
    page is the head page, and therefore the reader page has the RB_PAGE_HEAD
    flag in its list.next pointer. This eventually results in a GPF in a
    subsequent call to rb_set_head_page() (usually from rb_get_reader_page())
    when that prev pointer is dereferenced. The dereferenced register would
    characteristically have an address that appears shifted left by one byte
    (eg, ffxxxxxxxxxxxxyy instead of ffffxxxxxxxxxxxx) due to being written at
    an address one byte too high.

    Signed-off-by: David Sharp
    LKML-Reference:
    Signed-off-by: Steven Rostedt

    David Sharp
     

01 Jan, 2010

1 commit

  • …nel/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: Fix sign fields in ftrace_define_fields_##call()
    tracing/syscalls: Fix typo in SYSCALL_DEFINE0
    tracing/kprobe: Show sign of fields in trace_kprobe format files
    ksym_tracer: Remove trace_stat
    ksym_tracer: Fix race when incrementing count
    ksym_tracer: Fix to allow writing newline to ksym_trace_filter
    ksym_tracer: Fix to make the tracer work
    tracing: Kconfig spelling fixes and cleanups
    tracing: Fix setting tracer specific options
    Documentation: Update ftrace-design.txt
    Documentation: Update tracepoint-analysis.txt
    Documentation: Update mmiotrace.txt

    Linus Torvalds
     

30 Dec, 2009

6 commits

  • Add is_signed_type() call to trace_define_field() in ftrace macros.

    The code previously just passed in 0 (false), disregarding whether
    or not the field was actually a signed type.

    Signed-off-by: Lai Jiangshan
    LKML-Reference:
    Signed-off-by: Steven Rostedt

    Lai Jiangshan
     
  • The format files of trace_kprobe do not show the sign of the fields.
    The other format files show the field signed type of the fields and
    this patch makes the trace_kprobe formats consistent with the others.

    Signed-off-by: Lai Jiangshan
    LKML-Reference:
    Acked-by: Masami Hiramatsu
    Signed-off-by: Steven Rostedt

    Lai Jiangshan
     
  • trace_stat is problematic. Don't use it, use seqfile instead.

    This fixes a race that reading the stat file is not protected by
    any lock, which can lead to use after free.

    Signed-off-by: Li Zefan
    Cc: Steven Rostedt
    Cc: K.Prasad
    Cc: Frederic Weisbecker
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Li Zefan
     
  • We are under rcu read section but not holding the write lock, so
    count++ is not atomic. Use atomic64_t instead.

    Signed-off-by: Li Zefan
    Cc: Steven Rostedt
    Cc: K.Prasad
    Cc: Frederic Weisbecker
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Li Zefan
     
  • It used to work, but now doesn't:

    # echo > ksym_filter
    bash: echo: write error: Invalid argument

    It's caused by d954fbf0ff6b5fdfb32350e85a2f15d3db976506
    ("tracing: Fix wrong usage of strstrip in trace_ksyms").

    Signed-off-by: Li Zefan
    Cc: Steven Rostedt
    Cc: K.Prasad
    Cc: Frederic Weisbecker
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Li Zefan
     
  • ksym tracer doesn't work:

    # echo tasklist_lock:rw- > ksym_trace_filter
    -bash: echo: write error: No such device

    It's because we pass to perf_event_create_kernel_counter()
    a cpu number which is not present.

    Signed-off-by: Li Zefan
    Cc: Steven Rostedt
    Cc: K.Prasad
    Cc: Frederic Weisbecker
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Li Zefan
     

28 Dec, 2009

1 commit

  • Fix filename reference (ftrace-implementation.txt ->
    ftrace-design.txt).

    Fix spelling, punctuation, grammar.

    Fix help text indentation and line lengths to reduce need for
    horizontal scrolling or larger window sizes.

    Signed-off-by: Randy Dunlap
    Cc: Steven Rostedt
    Cc: Frederic Weisbecker
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Randy Dunlap
     

22 Dec, 2009

1 commit

  • The function __set_tracer_option() takes as its last parameter a
    "neg" value. If set it should negate the value of the option.

    The trace_options_write() passed the value written to the file
    which is what the new value needs to be set as. But since this
    is not the negative, it never sets the value.

    Reported-by: Peter Zijlstra
    Cc: Li Zefan
    Signed-off-by: Steven Rostedt

    Steven Rostedt
     

20 Dec, 2009

1 commit

  • …/git/tip/linux-2.6-tip

    * 'perf-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    perf session: Make events_stats u64 to avoid overflow on 32-bit arches
    hw-breakpoints: Fix hardware breakpoints -> perf events dependency
    perf events: Dont report side-band events on each cpu for per-task-per-cpu events
    perf events, x86/stacktrace: Fix performance/softlockup by providing a special frame pointer-only stack walker
    perf events, x86/stacktrace: Make stack walking optional
    perf events: Remove unused perf_counter.h header file
    perf probe: Check new event name
    kprobe-tracer: Check new event/group name
    perf probe: Check whether debugfs path is correct
    perf probe: Fix libdwarf include path for Debian

    Linus Torvalds
     

17 Dec, 2009

4 commits

  • * 'for-33' of git://repo.or.cz/linux-kbuild: (29 commits)
    net: fix for utsrelease.h moving to generated
    gen_init_cpio: fixed fwrite warning
    kbuild: fix make clean after mismerge
    kbuild: generate modules.builtin
    genksyms: properly consider EXPORT_UNUSED_SYMBOL{,_GPL}()
    score: add asm/asm-offsets.h wrapper
    unifdef: update to upstream revision 1.190
    kbuild: specify absolute paths for cscope
    kbuild: create include/generated in silentoldconfig
    scripts/package: deb-pkg: use fakeroot if available
    scripts/package: add KBUILD_PKG_ROOTCMD variable
    scripts/package: tar-pkg: use tar --owner=root
    Kbuild: clean up marker
    net: add net_tstamp.h to headers_install
    kbuild: move utsrelease.h to include/generated
    kbuild: move autoconf.h to include/generated
    drop explicit include of autoconf.h
    kbuild: move compile.h to include/generated
    kbuild: drop include/asm
    kbuild: do not check for include/asm-$ARCH
    ...

    Fixed non-conflicting clean merge of modpost.c as per comments from
    Stephen Rothwell (modpost.c had grown an include of linux/autoconf.h
    that needed to be changed to generated/autoconf.h)

    Linus Torvalds
     
  • The current print_context_stack helper that does the stack
    walking job is good for usual stacktraces as it walks through
    all the stack and reports even addresses that look unreliable,
    which is nice when we don't have frame pointers for example.

    But we have users like perf that only require reliable
    stacktraces, and those may want a more adapted stack walker, so
    lets make this function a callback in stacktrace_ops that users
    can tune for their needs.

    Signed-off-by: Frederic Weisbecker
    Cc: Peter Zijlstra
    Cc: Arnaldo Carvalho de Melo
    Cc: Paul Mackerras
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Frederic Weisbecker
     
  • Check new event/group name is same syntax as a C symbol. In other
    words, checking the name is as like as other tracepoint events.

    This can prevent user to create an event with useless name (e.g.
    foo|bar, foo*bar).

    Signed-off-by: Masami Hiramatsu
    Cc: Frederic Weisbecker
    Cc: Paul Mackerras
    Cc: Arnaldo Carvalho de Melo
    Cc: Steven Rostedt
    Cc: Jim Keniston
    Cc: Ananth N Mavinakayanahalli
    Cc: Christoph Hellwig
    Cc: Jason Baron
    Cc: K.Prasad
    Cc: Peter Zijlstra
    Cc: Srikar Dronamraju
    Cc: systemtap
    Cc: DLE
    LKML-Reference:
    [ v2: minor cleanups ]
    Signed-off-by: Ingo Molnar

    Masami Hiramatsu
     
  • …nel/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: Fix return of trace_dump_stack()
    ksym_tracer: Fix bad cast
    tracing/power: Remove two exports
    tracing: Change event->profile_count to be int type
    tracing: Simplify trace_option_write()
    tracing: Remove useless trace option
    tracing: Use seq file for trace_clock
    tracing: Use seq file for trace_options
    function-graph: Allow writing the same val to set_graph_function
    ftrace: Call trace_parser_clear() properly
    ftrace: Return EINVAL when writing invalid val to set_ftrace_filter
    tracing: Move a printk out of ftrace_raw_reg_event_foo()
    tracing: Pull up calls to trace_define_common_fields()
    tracing: Extract duplicate ftrace_raw_init_event_foo()
    ftrace.h: Use common pr_info fmt string
    tracing: Add stack trace to irqsoff tracer
    tracing: Add trace_dump_stack()
    ring-buffer: Move resize integrity check under reader lock
    ring-buffer: Use sync sched protection on ring buffer resizing
    tracing: Fix wrong usage of strstrip in trace_ksyms

    Linus Torvalds
     

16 Dec, 2009

1 commit


15 Dec, 2009

6 commits

  • The trace_dump_stack() returned a value for a void function.

    Also, added the missing stub for trace_dump_stack() when tracing is
    not configured.

    Reported-by: Ingo Molnar
    LKML-Reference:
    Signed-off-by: Steven Rostedt
    Signed-off-by: Ingo Molnar

    Steven Rostedt
     
  • Name space cleanup. No functional change.

    Signed-off-by: Thomas Gleixner
    Acked-by: Peter Zijlstra
    Acked-by: David S. Miller
    Acked-by: Ingo Molnar
    Cc: linux-arch@vger.kernel.org

    Thomas Gleixner
     
  • Further name space cleanup. No functional change

    Signed-off-by: Thomas Gleixner
    Acked-by: Peter Zijlstra
    Acked-by: David S. Miller
    Acked-by: Ingo Molnar
    Cc: linux-arch@vger.kernel.org

    Thomas Gleixner
     
  • The raw_spin* namespace was taken by lockdep for the architecture
    specific implementations. raw_spin_* would be the ideal name space for
    the spinlocks which are not converted to sleeping locks in preempt-rt.

    Linus suggested to convert the raw_ to arch_ locks and cleanup the
    name space instead of using an artifical name like core_spin,
    atomic_spin or whatever

    No functional change.

    Signed-off-by: Thomas Gleixner
    Acked-by: Peter Zijlstra
    Acked-by: David S. Miller
    Acked-by: Ingo Molnar
    Cc: linux-arch@vger.kernel.org

    Thomas Gleixner
     
  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu: (34 commits)
    m68k: rename global variable vmalloc_end to m68k_vmalloc_end
    percpu: add missing per_cpu_ptr_to_phys() definition for UP
    percpu: Fix kdump failure if booted with percpu_alloc=page
    percpu: make misc percpu symbols unique
    percpu: make percpu symbols in ia64 unique
    percpu: make percpu symbols in powerpc unique
    percpu: make percpu symbols in x86 unique
    percpu: make percpu symbols in xen unique
    percpu: make percpu symbols in cpufreq unique
    percpu: make percpu symbols in oprofile unique
    percpu: make percpu symbols in tracer unique
    percpu: make percpu symbols under kernel/ and mm/ unique
    percpu: remove some sparse warnings
    percpu: make alloc_percpu() handle array types
    vmalloc: fix use of non-existent percpu variable in put_cpu_var()
    this_cpu: Use this_cpu_xx in trace_functions_graph.c
    this_cpu: Use this_cpu_xx for ftrace
    this_cpu: Use this_cpu_xx in nmi handling
    this_cpu: Use this_cpu operations in RCU
    this_cpu: Use this_cpu ops for VM statistics
    ...

    Fix up trivial (famous last words) global per-cpu naming conflicts in
    arch/x86/kvm/svm.c
    mm/slab.c

    Linus Torvalds
     
  • …/rostedt/linux-2.6-trace into tracing/urgent

    Ingo Molnar
     

14 Dec, 2009

11 commits

  • Conflicts:
    kernel/trace/trace_kprobe.c

    Merge reason: resolve the conflict.

    Signed-off-by: Ingo Molnar

    Ingo Molnar
     
  • Fix this warning:

    kernel/trace/trace_ksym.c: In function 'ksym_trace_filter_read':
    kernel/trace/trace_ksym.c:239: warning: cast to pointer from integer of different size

    Signed-off-by: Li Zefan
    Acked-by: Steven Rostedt
    Cc: "K.Prasad"
    LKML-Reference:
    [remove the strstrip fix as tglx already fixed that]
    Signed-off-by: Frederic Weisbecker

    Li Zefan
     
  • trace_power_start and trace_power_end are used in
    arch/x86/kernel/power.c, and this file can't be compiled
    as a module, so these two tracepoints don't need to be
    exported.

    Signed-off-by: Li Zefan
    Acked-by: Arjan van de Ven
    Acked-by: Steven Rostedt
    LKML-Reference:
    Signed-off-by: Frederic Weisbecker

    Li Zefan
     
  • Like total_profile_count, struct ftrace_event_call::profile_count
    is protected by event_mutex, so it doesn't need to be atomic_t.

    Signed-off-by: Li Zefan
    Acked-by: Steven Rostedt
    Cc: Jason Baron
    Cc: Masami Hiramatsu
    Cc: Peter Zijlstra
    LKML-Reference:
    Signed-off-by: Frederic Weisbecker

    Li Zefan
     
  • - remove duplicate code inside trace_options_write()
    - extract duplicate code in trace_options_write() and set_tracer_option()

    Signed-off-by: Li Zefan
    Acked-by: Steven Rostedt
    LKML-Reference:
    Signed-off-by: Frederic Weisbecker

    Li Zefan
     
  • Since commit 4d9493c90f8e6e1b164aede3814010a290161abb
    ("ftrace: remove add-hoc code"), option "sched-tree"
    has become useless.

    Signed-off-by: Li Zefan
    Acked-by: Steven Rostedt
    LKML-Reference:
    Signed-off-by: Frederic Weisbecker

    Li Zefan
     
  • The buffer for the output is as small as 64 bytes, so it'll
    overflow if we add more clock type. Use seq file instead.

    Signed-off-by: Li Zefan
    Acked-by: Steven Rostedt
    LKML-Reference:
    Signed-off-by: Frederic Weisbecker

    Li Zefan
     
  • Code simplification for reading trace_options.

    Signed-off-by: Li Zefan
    Acked-by: Steven Rostedt
    LKML-reference:
    Signed-off-by: Frederic Weisbecker

    Li Zefan
     
  • # echo 'do_open' > set_graph_function
    # echo 'do_open' >> set_graph_function
    bash: echo: write error: Invalid argument

    Make it valid to write the same value to set_graph_function,
    which is consistent with set_ftrace_filter interface.

    Signed-off-by: Li Zefan
    Acked-by: Steven Rostedt
    LKML-reference:
    Signed-off-by: Frederic Weisbecker

    Li Zefan
     
  • I found a weird behavior:

    # echo 'fuse:*' > set_ftrace_filter
    bash: echo: write error: Invalid argument
    # cat set_ftrace_filter
    fuse_dev_fasync
    fuse_dev_poll
    fuse_copy_do

    We should call trace_parser_clear() no matter ftrace_process_regex()
    returns 0 or -errno, otherwise we will actually take the unaccepted
    records from ftrace_regex_release().

    Signed-off-by: Li Zefan
    Acked-by: Steven Rostedt
    LKML-Reference:
    Signed-off-by: Frederic Weisbecker

    Li Zefan
     
  • Currently it doesn't warn user on invald value:

    # echo nonexist_symbol > set_ftrace_filter
    or:
    # echo 'nonexist_symbol:mod:fuse' > set_ftrace_filter

    Better make it return failure.

    Signed-off-by: Li Zefan
    Acked-by: Steven Rostedt
    LKML-Reference:
    Signed-off-by: Frederic Weisbecker

    Li Zefan