19 Sep, 2009

1 commit

  • * 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4: (64 commits)
    ext4: Update documentation about quota mount options
    ext4: replace MAX_DEFRAG_SIZE with EXT_MAX_BLOCK
    ext4: Fix the alloc on close after a truncate hueristic
    ext4: Add a tracepoint for ext4_alloc_da_blocks()
    ext4: store EXT4_EXT_MIGRATE in i_state instead of i_flags
    ext4: limit block allocations for indirect-block files to < 2^32
    ext4: Fix different block exchange issue in EXT4_IOC_MOVE_EXT
    ext4: Add null extent check to ext_get_path
    ext4: Replace BUG_ON() with ext4_error() in move_extents.c
    ext4: Replace get_ext_path macro with an inline funciton
    ext4: Fix include/trace/events/ext4.h to work with Systemtap
    ext4: Fix initalization of s_flex_groups
    ext4: Always set dx_node's fake_dirent explicitly.
    ext4: Fix async commit mode to be safe by using a barrier
    ext4: Don't update superblock write time when filesystem is read-only
    ext4: Clarify the locking details in mballoc
    ext4: check for need init flag in ext4_mb_load_buddy
    ext4: move ext4_mb_init_group() function earlier in the mballoc.c
    ext4: Make non-journal fsync work properly
    ext4: Assure that metadata blocks are written during fsync in no journal mode
    ...

    Linus Torvalds
     

18 Sep, 2009

2 commits


17 Sep, 2009

3 commits


16 Sep, 2009

1 commit


15 Sep, 2009

3 commits

  • Using relative pathnames in #include statements interacts badly with
    SystemTap, since the fs/ext4/*.h header files are not packaged up as
    part of a distribution kernel's header files. Since systemtap doesn't
    use TP_fast_assign(), we can use a blind structure definition and then
    make sure the needed header files are defined before the ext4 source
    files #include the trace/events/ext4.h header file.

    https://bugzilla.redhat.com/show_bug.cgi?id=512478

    Signed-off-by: "Theodore Ts'o"

    Theodore Ts'o
     
  • * 'kvm-updates/2.6.32' of git://git.kernel.org/pub/scm/virt/kvm/kvm: (202 commits)
    MAINTAINERS: update KVM entry
    KVM: correct error-handling code
    KVM: fix compile warnings on s390
    KVM: VMX: Check cpl before emulating debug register access
    KVM: fix misreporting of coalesced interrupts by kvm tracer
    KVM: x86: drop duplicate kvm_flush_remote_tlb calls
    KVM: VMX: call vmx_load_host_state() only if msr is cached
    KVM: VMX: Conditionally reload debug register 6
    KVM: Use thread debug register storage instead of kvm specific data
    KVM guest: do not batch pte updates from interrupt context
    KVM: Fix coalesced interrupt reporting in IOAPIC
    KVM guest: fix bogus wallclock physical address calculation
    KVM: VMX: Fix cr8 exiting control clobbering by EPT
    KVM: Optimize kvm_mmu_unprotect_page_virt() for tdp
    KVM: Document KVM_CAP_IRQCHIP
    KVM: Protect update_cr8_intercept() when running without an apic
    KVM: VMX: Fix EPT with WP bit change during paging
    KVM: Use kvm_{read,write}_guest_virt() to read and write segment descriptors
    KVM: x86 emulator: Add adc and sbb missing decoder flags
    KVM: Add missing #include
    ...

    Linus Torvalds
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6: (1623 commits)
    netxen: update copyright
    netxen: fix tx timeout recovery
    netxen: fix file firmware leak
    netxen: improve pci memory access
    netxen: change firmware write size
    tg3: Fix return ring size breakage
    netxen: build fix for INET=n
    cdc-phonet: autoconfigure Phonet address
    Phonet: back-end for autoconfigured addresses
    Phonet: fix netlink address dump error handling
    ipv6: Add IFA_F_DADFAILED flag
    net: Add DEVTYPE support for Ethernet based devices
    mv643xx_eth.c: remove unused txq_set_wrr()
    ucc_geth: Fix hangs after switching from full to half duplex
    ucc_geth: Rearrange some code to avoid forward declarations
    phy/marvell: Make non-aneg speed/duplex forcing work for 88E1111 PHYs
    drivers/net/phy: introduce missing kfree
    drivers/net/wan: introduce missing kfree
    net: force bridge module(s) to be GPL
    Subject: [PATCH] appletalk: Fix skb leak when ipddp interface is not loaded
    ...

    Fixed up trivial conflicts:

    - arch/x86/include/asm/socket.h

    converted to in the x86 tree. The generic
    header has the same new #define's, so that works out fine.

    - drivers/net/tun.c

    fix conflict between 89f56d1e9 ("tun: reuse struct sock fields") that
    switched over to using 'tun->socket.sk' instead of the redundantly
    available (and thus removed) 'tun->sk', and 2b980dbd ("lsm: Add hooks
    to the TUN driver") which added a new 'tun->sk' use.

    Noted in 'next' by Stephen Rothwell.

    Linus Torvalds
     

14 Sep, 2009

2 commits


13 Sep, 2009

1 commit

  • Booting 2.6.31 and executing
    echo 1 >/sys/kernel/debug/tracing/events/enable
    leads to
    BUG: unable to handle kernel NULL pointer dereference at (null)
    IP: [] ftrace_raw_event_block_bio_bounce+0x4b/0xb9

    Apparently,
    bio = bio_map_user(q, NULL, uaddr, len, reading, gfp_mask);
    is called in block/blk-map.c:58 where bio->bi_bdev in set to NULL and
    still is NULL when an attempt is made to evaluate bio->bi_bdev->bd_dev
    in include/trace/events/block.h:189.

    The tracepoint should ensure bio->bi_bdev is not dereferenced, if NULL.

    Signed-off-by: Carsten Emde
    LKML-Reference:
    Signed-off-by: Steven Rostedt

    Carsten Emde
     

12 Sep, 2009

1 commit

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

    * 'tracing-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (105 commits)
    ring-buffer: only enable ring_buffer_swap_cpu when needed
    ring-buffer: check for swapped buffers in start of committing
    tracing: report error in trace if we fail to swap latency buffer
    tracing: add trace_array_printk for internal tracers to use
    tracing: pass around ring buffer instead of tracer
    tracing: make tracing_reset safe for external use
    tracing: use timestamp to determine start of latency traces
    tracing: Remove mentioning of legacy latency_trace file from documentation
    tracing/filters: Defer pred allocation, fix memory leak
    tracing: remove users of tracing_reset
    tracing: disable buffers and synchronize_sched before resetting
    tracing: disable update max tracer while reading trace
    tracing: print out start and stop in latency traces
    ring-buffer: disable all cpu buffers when one finds a problem
    ring-buffer: do not count discarded events
    ring-buffer: remove ring_buffer_event_discard
    ring-buffer: fix ring_buffer_read crossing pages
    ring-buffer: remove unnecessary cpu_relax
    ring-buffer: do not swap buffers during a commit
    ring-buffer: do not reset while in a commit
    ...

    Linus Torvalds
     

10 Sep, 2009

4 commits


05 Sep, 2009

1 commit

  • The latency tracers (irqsoff and wakeup) can swap trace buffers
    on the fly. If an event is happening and has reserved data on one of
    the buffers, and the latency tracer swaps the global buffer with the
    max buffer, the result is that the event may commit the data to the
    wrong buffer.

    This patch changes the API to the trace recording to be recieve the
    buffer that was used to reserve a commit. Then this buffer can be passed
    in to the commit.

    Signed-off-by: Steven Rostedt

    Steven Rostedt
     

02 Sep, 2009

1 commit

  • Add 3 schedstat tracepoints to help account for wait-time,
    sleep-time and iowait-time.

    They can also be used as a perf-counter source to profile tasks
    on these clocks.

    Signed-off-by: Peter Zijlstra
    Cc: Steven Rostedt
    Cc: Frederic Weisbecker
    Cc: Arjan van de Ven
    LKML-Reference:
    [ build fix for the !CONFIG_SCHEDSTATS case ]
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     

01 Sep, 2009

1 commit


31 Aug, 2009

1 commit

  • init_preds() allocates about 5392 bytes of memory (on x86_32) for
    a TRACE_EVENT. With my config, at system boot total memory occupied
    is:

    5392 * (642 + 15) == 3459KB

    642 == cat available_events | wc -l
    15 == number of dirs in events/ftrace

    That's quite a lot, so we'd better defer memory allocation util
    it's needed, that's when filter is used.

    Signed-off-by: Li Zefan
    Cc: Steven Rostedt
    Cc: Frederic Weisbecker
    Cc: Tom Zanussi
    Cc: Masami Hiramatsu
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Li Zefan
     

28 Aug, 2009

2 commits

  • TRACE_EVENT_FN relays on TRACE_EVENT by reprocessing its parameters
    into the ftrace events CPP macro. This leads to a double substitution
    in some cases.

    For example, a bad consequence is a format always prefixed by
    "%s, %s\n" for every TRACE_EVENT_FN based events.

    Eg:
    cat /debug/tracing/events/syscalls/sys_enter/format
    [...]
    print fmt: "%s, %s\n", "\"NR %ld (%lx, %lx, %lx, %lx, %lx, %lx)\"",\
    "REC->id, REC->args[0], REC->args[1], REC->args[2], REC->args[3],\
    REC->args[4], REC->args[5]"

    This creates a failure in post-processing tools such as perf trace or
    trace-cmd.

    Then drop this double substitution and replace it by a new __cpparg()
    macro that relays CPP arguments containing commas.

    Signed-off-by: Frederic Weisbecker
    Cc: Josh Stone
    Cc: Li Zefan
    Cc: Steven Rostedt
    Cc: Jason Baron
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Frederic Weisbecker
     
  • The recent commit:

    tracing/events: fix the include file dependencies

    fixed a file dependency problem while including more than
    one trace event header file.

    This fix undefined TRACE_EVENT after an event header macro
    preprocessing in order to make tracepoint.h able to correctly declare
    the tracepoints necessary for the next event header file.

    But now we also need to undefine TRACE_EVENT_FN at the end of an event
    header file preprocessing for the same reason.

    This fixes the following build error:

    In file included from include/trace/events/napi.h:5,
    from net/core/net-traces.c:28:
    include/linux/tracepoint.h:285:1: warning: "TRACE_EVENT_FN" redefined
    In file included from include/trace/define_trace.h:61,
    from include/trace/events/skb.h:40,
    from net/core/net-traces.c:27:
    include/trace/ftrace.h:50:1: warning: this is the location of the previous definition
    In file included from include/trace/events/napi.h:5,
    from net/core/net-traces.c:28:
    include/linux/tracepoint.h:285:1: warning: "TRACE_EVENT_FN" redefined
    In file included from include/trace/define_trace.h:61,
    from include/trace/events/skb.h:40,
    from net/core/net-traces.c:27:
    include/trace/ftrace.h:50:1: warning: this is the location of the previous definition

    Reported-by: Ingo Molnar
    Signed-off-by: Frederic Weisbecker
    Cc: Masami Hiramatsu
    Cc: Xiao Guangrong
    Cc: Steven Rostedt
    Cc: Li Zefan
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Frederic Weisbecker
     

26 Aug, 2009

7 commits

  • …deric/random-tracing into tracing/core

    Conflicts:
    include/linux/tracepoint.h

    Signed-off-by: Ingo Molnar <mingo@elte.hu>

    Ingo Molnar
     
  • The TRACE_EVENT depends on the include/linux/tracepoint.h first
    and include/trace/ftrace.h later, if we include the ftrace.h early,
    a building error will occur.

    Both define TRACE_EVENT in trace_a.h and trace_b.h, if we include
    those in .c file, like this:

    #define CREATE_TRACE_POINTS
    include
    include

    The above will not work, because the TRACE_EVENT was re-defined by
    the previous .h file.

    Reported-by: Wei Yongjun
    Signed-off-by: Xiao Guangrong
    LKML-Reference:
    Signed-off-by: Steven Rostedt

    Xiao Guangrong
     
  • Add __field_ext(), so a field can be assigned to a specific
    filter_type, which matches a corresponding filter function.

    For example, a later patch will allow this:
    __field_ext(const char *, str, FILTER_PTR_STR);

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

    [
    Fixed a -1 to FILTER_OTHER
    Forward ported to latest kernel.
    ]

    Signed-off-by: Steven Rostedt

    Li Zefan
     
  • While debugging the scheduler push / pull algorithm, I found
    it very annoying that the sched wake up events did not show
    the CPU that the task was waking on. In order to analyze the
    scheduler, I needed that information.

    This patch adds recording of the CPU that a task is waking up
    on.

    Signed-off-by: Steven Rostedt

    Steven Rostedt
     
  • This converts the syscall_enter/exit tracepoints into TRACE_EVENTs, so
    you can have generic ftrace events that capture all system calls with
    arguments and return values. These generic events are also renamed to
    sys_enter/exit, so they're more closely aligned to the specific
    sys_enter_foo events.

    Signed-off-by: Josh Stone
    Cc: Jason Baron
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Li Zefan
    Cc: Steven Rostedt
    Cc: Peter Zijlstra
    Cc: Mathieu Desnoyers
    Cc: Jiaying Zhang
    Cc: Martin Bligh
    Cc: Lai Jiangshan
    Cc: Paul Mundt
    Cc: Martin Schwidefsky
    Cc: Heiko Carstens
    LKML-Reference:
    Signed-off-by: Frederic Weisbecker

    Josh Stone
     
  • It's not strictly correct for the tracepoint reg/unreg callbacks to
    occur when a client is hooking up, because the actual tracepoint may not
    be present yet. This happens to be fine for syscall, since that's in
    the core kernel, but it would cause problems for tracepoints defined in
    a module that hasn't been loaded yet. It also means the reg/unreg has
    to be EXPORTed for any modules to use the tracepoint (as in SystemTap).

    This patch removes DECLARE_TRACE_WITH_CALLBACK, and instead introduces
    DEFINE_TRACE_FN which stores the callbacks in struct tracepoint. The
    callbacks are used now when the active state of the tracepoint changes
    in set_tracepoint & disable_tracepoint.

    This also introduces TRACE_EVENT_FN, so ftrace events can also provide
    registration callbacks if needed.

    Signed-off-by: Josh Stone
    Cc: Jason Baron
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Li Zefan
    Cc: Steven Rostedt
    Cc: Peter Zijlstra
    Cc: Mathieu Desnoyers
    Cc: Jiaying Zhang
    Cc: Martin Bligh
    Cc: Lai Jiangshan
    Cc: Paul Mundt
    Cc: Martin Schwidefsky
    Cc: Heiko Carstens
    LKML-Reference:
    Signed-off-by: Frederic Weisbecker

    Josh Stone
     
  • The syscall enter/exit tracepoints are only supported on archs that
    HAVE_SYSCALL_TRACEPOINTS, so the declarations should be #ifdef'ed.
    Also, the definition of syscall_regfunc and syscall_unregfunc should
    depend on this same config, rather than the ftrace-specific one.

    Signed-off-by: Josh Stone
    Cc: Jason Baron
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Li Zefan
    Cc: Steven Rostedt
    Cc: Peter Zijlstra
    Cc: Mathieu Desnoyers
    Cc: Jiaying Zhang
    Cc: Martin Bligh
    Cc: Lai Jiangshan
    LKML-Reference:
    Signed-off-by: Frederic Weisbecker

    Josh Stone
     

19 Aug, 2009

4 commits

  • Add filtering support for syscall events:

    # echo 'mode == 0666' > events/syscalls/sys_enter_open
    # echo 'ret == 0' > events/syscalls/sys_exit_open
    # echo 1 > events/syscalls/sys_enter_open
    # echo 1 > events/syscalls/sys_exit_open
    # cat trace
    ...
    modprobe-3084 [001] 117.463140: sys_open(filename: 917d3e8, flags: 0, mode: 1b6)
    modprobe-3084 [001] 117.463176: sys_open -> 0x0
    less-3086 [001] 117.510455: sys_open(filename: 9c6bdb8, flags: 8000, mode: 1b6)
    sendmail-2574 [001] 122.145840: sys_open(filename: b807a365, flags: 0, mode: 1b6)
    ...

    Signed-off-by: Li Zefan
    Cc: Jason Baron
    Cc: Steven Rostedt
    Cc: Frederic Weisbecker
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Li Zefan
     
  • Extract duplicate code. Also prepare for the later patch.

    Signed-off-by: Li Zefan
    Cc: Jason Baron
    Cc: Steven Rostedt
    Cc: Frederic Weisbecker
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Li Zefan
     
  • This parameter is needed by syscall events to add define_fields()
    handler.

    Signed-off-by: Li Zefan
    Cc: Jason Baron
    Cc: Steven Rostedt
    Cc: Frederic Weisbecker
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Li Zefan
     
  • Add "format" file for syscall exit events:

    # cat events/syscalls/sys_exit_open/format
    name: sys_exit_open
    ID: 344
    format:
    field:unsigned short common_type; offset:0; size:2;
    field:unsigned char common_flags; offset:2; size:1;
    field:unsigned char common_preempt_count; offset:3; size:1;
    field:int common_pid; offset:4; size:4;
    field:int common_tgid; offset:8; size:4;

    field:int nr; offset:12; size:4;
    field:unsigned long ret; offset:16; size:4;

    Signed-off-by: Li Zefan
    Cc: Jason Baron
    Cc: Steven Rostedt
    Cc: Frederic Weisbecker
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Li Zefan
     

17 Aug, 2009

1 commit

  • Add trace points to trace module_load, module_free, module_get,
    module_put and module_request, and use trace_event facility to
    get the trace output.

    Here's the sample output:

    TASK-PID CPU# TIMESTAMP FUNCTION
    | | | | |
    -42 [000] 1.758380: module_request: fb0 wait=1 call_site=fb_open
    ...
    -60 [000] 3.269403: module_load: scsi_wait_scan
    -60 [000] 3.269432: module_put: scsi_wait_scan call_site=sys_init_module refcnt=0
    -61 [001] 3.273168: module_free: scsi_wait_scan
    ...
    -1021 [000] 13.836081: module_load: sunrpc
    -1021 [000] 13.840589: module_put: sunrpc call_site=sys_init_module refcnt=-1
    -1027 [000] 13.848098: module_get: sunrpc call_site=try_module_get refcnt=0
    -1027 [000] 13.848308: module_get: sunrpc call_site=get_filesystem refcnt=1
    -1027 [000] 13.848692: module_put: sunrpc call_site=put_filesystem refcnt=0
    ...
    modprobe-2587 [001] 1088.437213: module_load: trace_events_sample F
    modprobe-2587 [001] 1088.437786: module_put: trace_events_sample call_site=sys_init_module refcnt=0

    Note:

    - the taints flag can be 'F', 'C' and/or 'P' if mod->taints != 0

    - the module refcnt is percpu, so it can be negative in a
    specific cpu

    Signed-off-by: Li Zefan
    Acked-by: Rusty Russell
    Cc: Steven Rostedt
    Cc: Frederic Weisbecker
    Cc: Rusty Russell
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Li Zefan
     

14 Aug, 2009

1 commit

  • skb allocation / cosumption tracer - Add consumption tracepoint

    This patch adds a tracepoint to skb_copy_datagram_iovec, which is called each
    time a userspace process copies a frame from a socket receive queue to a user
    space buffer. It allows us to hook in and examine each sk_buff that the system
    receives on a per-socket bases, and can be use to compile a list of which skb's
    were received by which processes.

    Signed-off-by: Neil Horman

    include/trace/events/skb.h | 20 ++++++++++++++++++++
    net/core/datagram.c | 3 +++
    2 files changed, 23 insertions(+)
    Signed-off-by: David S. Miller

    Neil Horman
     

12 Aug, 2009

3 commits

  • Define the format of the syscall trace fields to parse the binary
    values from a raw trace using the syscall events "format" file.

    This is defined dynamically using the syscalls metadata.
    It prepares the export of syscall event raw records to perf
    counters.

    Example:

    $ cat /debug/tracing/events/syscalls/sys_enter_sched_getparam/format
    name: sys_enter_sched_getparam
    ID: 39
    format:
    field:unsigned short common_type; offset:0; size:2;
    field:unsigned char common_flags; offset:2; size:1;
    field:unsigned char common_preempt_count; offset:3; size:1;
    field:int common_pid; offset:4; size:4;
    field:int common_tgid; offset:8; size:4;

    field:pid_t pid; offset:12; size:8;
    field:struct sched_param * param; offset:20; size:8;

    print fmt: "pid: 0x%08lx, param: 0x%08lx", ((unsigned long)(REC->pid)), ((unsigned long)(REC->param))

    Signed-off-by: Frederic Weisbecker
    Cc: Lai Jiangshan
    Cc: Steven Rostedt
    Cc: Peter Zijlstra
    Cc: Mathieu Desnoyers
    Cc: Jiaying Zhang
    Cc: Martin Bligh
    Cc: Li Zefan
    Cc: Masami Hiramatsu
    Cc: Jason Baron

    Frederic Weisbecker
     
  • Add the struct ftrace_event_call as a parameter of its show_format()
    callback. This way we can use it from the syscall trace events to
    retrieve the syscall name from the ftrace event call parameter and
    describe its fields using the syscalls metadata.

    Signed-off-by: Frederic Weisbecker
    Cc: Lai Jiangshan
    Cc: Steven Rostedt
    Cc: Peter Zijlstra
    Cc: Mathieu Desnoyers
    Cc: Jiaying Zhang
    Cc: Martin Bligh
    Cc: Li Zefan
    Cc: Masami Hiramatsu
    Cc: Jason Baron

    Frederic Weisbecker
     
  • The perf counter support is automated for usual trace events. But we
    have to define specific callbacks for this to handle syscalls trace
    events

    Make 'perf stat -e syscalls:sys_enter_blah' work with syscall style
    tracepoints.

    Signed-off-by: Jason Baron
    Cc: Lai Jiangshan
    Cc: Steven Rostedt
    Cc: Peter Zijlstra
    Cc: Mathieu Desnoyers
    Cc: Jiaying Zhang
    Cc: Martin Bligh
    Cc: Li Zefan
    Cc: Masami Hiramatsu
    Signed-off-by: Frederic Weisbecker

    Jason Baron