16 Dec, 2010

1 commit


01 Dec, 2010

1 commit

  • The file_ops struct for the "trace" special file defined llseek as seq_lseek().
    However, if the file was opened for writing only, seq_open() was not called,
    and the seek would dereference a null pointer, file->private_data.

    This patch introduces a new wrapper for seq_lseek() which checks if the file
    descriptor is opened for reading first. If not, it does nothing.

    Cc:
    Signed-off-by: Slava Pestov
    LKML-Reference:
    Signed-off-by: Steven Rostedt

    Slava Pestov
     

27 Nov, 2010

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 symbols: Remove incorrect open-coded container_of()
    perf record: Handle restrictive permissions in /proc/{kallsyms,modules}
    x86/kprobes: Prevent kprobes to probe on save_args()
    irq_work: Drop cmpxchg() result
    perf: Fix owner-list vs exit
    x86, hw_nmi: Move backtrace_mask declaration under ARCH_HAS_NMI_WATCHDOG
    tracing: Fix recursive user stack trace
    perf,hw_breakpoint: Initialize hardware api earlier
    x86: Ignore trap bits on single step exceptions
    tracing: Force arch_local_irq_* notrace for paravirt
    tracing: Fix module use of trace_bprintk()

    Linus Torvalds
     

18 Nov, 2010

2 commits


17 Nov, 2010

1 commit

  • * 'for-linus' of git://git390.marist.edu/pub/scm/linux-2.6:
    [S390] kprobes: Fix the return address of multiple kretprobes
    [S390] kprobes: disable interrupts throughout
    [S390] ftrace: build without frame pointers on s390
    [S390] mm: add devmem_is_allowed() for STRICT_DEVMEM checking
    [S390] vmlogrdr: purge after recording is switched off
    [S390] cio: fix incorrect ccw_device_init_count
    [S390] tape: add medium state notifications
    [S390] fix get_user_pages_fast

    Linus Torvalds
     

13 Nov, 2010

1 commit

  • The user stack trace can fault when examining the trace. Which
    would call the do_page_fault handler, which would trace again,
    which would do the user stack trace, which would fault and call
    do_page_fault again ...

    Thus this is causing a recursive bug. We need to have a recursion
    detector here.

    [ Resubmitted by Jiri Olsa ]

    [ Eric Dumazet recommended using __this_cpu_* instead of __get_cpu_* ]

    Cc: Eric Dumazet
    Signed-off-by: Jiri Olsa
    LKML-Reference:
    Signed-off-by: Steven Rostedt

    Steven Rostedt
     

10 Nov, 2010

2 commits

  • REQ_HARDBARRIER is dead now, so remove the leftovers. What's left
    at this point is:

    - various checks inside the block layer.
    - sanity checks in bio based drivers.
    - now unused bio_empty_barrier helper.
    - Xen blockfront use of BLKIF_OP_WRITE_BARRIER - it's dead for a while,
    but Xen really needs to sort out it's barrier situaton.
    - setting of ordered tags in uas - dead code copied from old scsi
    drivers.
    - scsi different retry for barriers - it's dead and should have been
    removed when flushes were converted to FS requests.
    - blktrace handling of barriers - removed. Someone who knows blktrace
    better should add support for REQ_FLUSH and REQ_FUA, though.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Jens Axboe

    Christoph Hellwig
     
  • s390 doesn't need FRAME_POINTERS in order to have a working function tracer.
    We don't need frame pointers in order to get strack traces since we always
    have valid backchains by using the -mkernel-backchain gcc option.

    Signed-off-by: Heiko Carstens
    Signed-off-by: Martin Schwidefsky

    Heiko Carstens
     

28 Oct, 2010

2 commits

  • …/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: (50 commits)
    perf python scripting: Add futex-contention script
    perf python scripting: Fixup cut'n'paste error in sctop script
    perf scripting: Shut up 'perf record' final status
    perf record: Remove newline character from perror() argument
    perf python scripting: Support fedora 11 (audit 1.7.17)
    perf python scripting: Improve the syscalls-by-pid script
    perf python scripting: print the syscall name on sctop
    perf python scripting: Improve the syscalls-counts script
    perf python scripting: Improve the failed-syscalls-by-pid script
    kprobes: Remove redundant text_mutex lock in optimize
    x86/oprofile: Fix uninitialized variable use in debug printk
    tracing: Fix 'faild' -> 'failed' typo
    perf probe: Fix format specified for Dwarf_Off parameter
    perf trace: Fix detection of script extension
    perf trace: Use $PERF_EXEC_PATH in canned report scripts
    perf tools: Document event modifiers
    perf tools: Remove direct slang.h include
    perf_events: Fix for transaction recovery in group_sched_in()
    perf_events: Revert: Fix transaction recovery in group_sched_in()
    perf, x86: Use NUMA aware allocations for PEBS/BTS/DS allocations
    ...

    Linus Torvalds
     
  • Signed-off-by: Zimny Lech
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Zimny Lech
     

26 Oct, 2010

1 commit


25 Oct, 2010

1 commit

  • * 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (39 commits)
    Update broken web addresses in arch directory.
    Update broken web addresses in the kernel.
    Revert "drivers/usb: Remove unnecessary return's from void functions" for musb gadget
    Revert "Fix typo: configuation => configuration" partially
    ida: document IDA_BITMAP_LONGS calculation
    ext2: fix a typo on comment in ext2/inode.c
    drivers/scsi: Remove unnecessary casts of private_data
    drivers/s390: Remove unnecessary casts of private_data
    net/sunrpc/rpc_pipe.c: Remove unnecessary casts of private_data
    drivers/infiniband: Remove unnecessary casts of private_data
    drivers/gpu/drm: Remove unnecessary casts of private_data
    kernel/pm_qos_params.c: Remove unnecessary casts of private_data
    fs/ecryptfs: Remove unnecessary casts of private_data
    fs/seq_file.c: Remove unnecessary casts of private_data
    arm: uengine.c: remove C99 comments
    arm: scoop.c: remove C99 comments
    Fix typo configue => configure in comments
    Fix typo: configuation => configuration
    Fix typo interrest[ing|ed] => interest[ing|ed]
    Fix various typos of valid in comments
    ...

    Fix up trivial conflicts in:
    drivers/char/ipmi/ipmi_si_intf.c
    drivers/usb/gadget/rndis.c
    net/irda/irnet/irnet_ppp.c

    Linus Torvalds
     

24 Oct, 2010

1 commit


23 Oct, 2010

3 commits

  • Now that include/linux/kdb.h properly exports all the functions
    required to dynamically add a kdb shell command, the reference to the
    private kdb header can be removed.

    Signed-off-by: Jason Wessel

    Jason Wessel
     
  • * 'llseek' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/bkl:
    vfs: make no_llseek the default
    vfs: don't use BKL in default_llseek
    llseek: automatically add .llseek fop
    libfs: use generic_file_llseek for simple_attr
    mac80211: disallow seeks in minstrel debug code
    lirc: make chardev nonseekable
    viotape: use noop_llseek
    raw: use explicit llseek file operations
    ibmasmfs: use generic_file_llseek
    spufs: use llseek in all file operations
    arm/omap: use generic_file_llseek in iommu_debug
    lkdtm: use generic_file_llseek in debugfs
    net/wireless: use generic_file_llseek in debugfs
    drm: use noop_llseek

    Linus Torvalds
     
  • * 'config' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/bkl:
    BKL: introduce CONFIG_BKL.
    dabusb: remove the BKL
    sunrpc: remove the big kernel lock
    init/main.c: remove BKL notations
    blktrace: remove the big kernel lock
    rtmutex-tester: make it build without BKL
    dvb-core: kill the big kernel lock
    dvb/bt8xx: kill the big kernel lock
    tlclk: remove big kernel lock
    fix rawctl compat ioctls breakage on amd64 and itanic
    uml: kill big kernel lock
    parisc: remove big kernel lock
    cris: autoconvert trivial BKL users
    alpha: kill big kernel lock
    isapnp: BKL removal
    s390/block: kill the big kernel lock
    hpet: kill BKL, add compat_ioctl

    Linus Torvalds
     

22 Oct, 2010

3 commits

  • …rostedt/linux-2.6-trace into perf/urgent

    Ingo Molnar
     
  • * 'devel' of master.kernel.org:/home/rmk/linux-2.6-arm: (278 commits)
    arm: remove machine_desc.io_pg_offst and .phys_io
    arm: use addruart macro to establish debug mappings
    arm: return both physical and virtual addresses from addruart
    arm/debug: consolidate addruart macros for CONFIG_DEBUG_ICEDCC
    ARM: make struct machine_desc definition coherent with its comment
    eukrea_mbimxsd-baseboard: Pass the correct GPIO to gpio_free
    cpuimx27: fix compile when ULPI is selected
    mach-pcm037_eet: fix compile errors
    Fixing ethernet driver compilation error for i.MX31 ADS board
    cpuimx51: update board support
    mx5: add cpuimx51sd module and its baseboard
    iomux-mx51: fix GPIO_1_xx 's IOMUX configuration
    imx-esdhc: update devices registration
    mx51: add resources for SD/MMC on i.MX51
    iomux-mx51: fix SD1 and SD2's iomux configuration
    clock-mx51: rename CLOCK1 to CLOCK_CCGR for better readability
    clock-mx51: factorize clk_set_parent and clk_get_rate
    eukrea_mbimxsd: add support for DVI displays
    cpuimx25 & cpuimx35: fix OTG port registration in host mode
    i.MX31 and i.MX35 : fix errate TLSbo65953 and ENGcm09472
    ...

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

    * 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (163 commits)
    tracing: Fix compile issue for trace_sched_wakeup.c
    [S390] hardirq: remove pointless header file includes
    [IA64] Move local_softirq_pending() definition
    perf, powerpc: Fix power_pmu_event_init to not use event->ctx
    ftrace: Remove recursion between recordmcount and scripts/mod/empty
    jump_label: Add COND_STMT(), reducer wrappery
    perf: Optimize sw events
    perf: Use jump_labels to optimize the scheduler hooks
    jump_label: Add atomic_t interface
    jump_label: Use more consistent naming
    perf, hw_breakpoint: Fix crash in hw_breakpoint creation
    perf: Find task before event alloc
    perf: Fix task refcount bugs
    perf: Fix group moving
    irq_work: Add generic hardirq context callbacks
    perf_events: Fix transaction recovery in group_sched_in()
    perf_events: Fix bogus AMD64 generic TLB events
    perf_events: Fix bogus context time tracking
    tracing: Remove parent recording in latency tracer graph options
    tracing: Use one prologue for the preempt irqs off tracer function tracers
    ...

    Linus Torvalds
     

21 Oct, 2010

6 commits

  • The tracing per_cpu buffers were limited to 999 CPUs for a mear
    savings in stack space of a char array. Up the array to 30 characters
    which is more than enough to hold a 64 bit number.

    Reported-by: Robin Holt
    Suggested-by: Ingo Molnar
    Signed-off-by: Steven Rostedt

    Steven Rostedt
     
  • With the binding of time extends to events we no longer need to use
    the macro RB_TIMESTAMPS_PER_PAGE. Remove it.

    Signed-off-by: Steven Rostedt

    Steven Rostedt
     
  • By using inline and noinline, we are able to make the fast path of
    recording an event 4% faster.

    Signed-off-by: Steven Rostedt

    Steven Rostedt
     
  • There's a condition to check if we should add a time extend or
    not in the fast path. But this condition is racey (in the sense
    that we can add a unnecessary time extend, but nothing that
    can break anything). We later check if the time or event time
    delta should be zero or have real data in it (not racey), making
    this first check redundant.

    This check may help save space once in a while, but really is
    not worth the hassle to try to save some space that happens at
    most 134 ms at a time.

    Signed-off-by: Steven Rostedt

    Steven Rostedt
     
  • When the time between two timestamps is greater than
    2^27 nanosecs (~134 ms) a time extend event is added that extends
    the time difference to 59 bits (~18 years). This is due to
    events only having a 27 bit field to store time.

    Currently this time extend is a separate event. We add it just before
    the event data that is being written to the buffer. But before
    the event data is committed, the event data can also be discarded (as
    with the case of filters). But because the time extend has already been
    committed, it will stay in the buffer.

    If lots of events are being filtered and no event is being
    written, then every 134ms a time extend can be added to the buffer
    without any data attached. To keep from filling the entire buffer
    with time extends, a time extend will never be the first event
    in a page because the page timestamp can be used. Time extends can
    only fill the rest of a page with some data at the beginning.

    This patch binds the time extend with the data. The difference here
    is that the time extend is not committed before the data is added.
    Instead, when a time extend is needed, the space reserved on
    the ring buffer is the time extend + the data event size. The
    time extend is added to the first part of the reserved block and
    the data is added to the second. The time extend event is passed
    back to the reserver, but since the reserver also uses a function
    to find the data portion of the reserved block, no changes to the
    ring buffer interface need to be made.

    When a commit is discarded, we now remove both the time extend and
    the event. With this approach no more than one time extend can
    be in the buffer in a row. Data must always follow a time extend.

    Thanks to Mathieu Desnoyers for suggesting this idea.

    Suggested-by: Mathieu Desnoyers
    Cc: Thomas Gleixner
    Signed-off-by: Steven Rostedt

    Steven Rostedt
     
  • The delta between events is passed to the timestamp code by reference
    and the timestamp code will reset the value. But it can be reset
    from the caller. No need to pass it in by reference.

    By changing the call to pass by value, lets gcc optimize the code
    a bit more where it can store the delta in a register and not
    worry about updating the reference.

    Signed-off-by: Steven Rostedt

    Steven Rostedt
     

20 Oct, 2010

3 commits


19 Oct, 2010

3 commits


18 Oct, 2010

7 commits

  • Even though the parent is recorded with the normal function tracing
    of the latency tracers (irqsoff and wakeup), the function graph
    recording is bogus.

    This is due to the function graph messing with the return stack.
    The latency tracers pass in as the parent CALLER_ADDR0, which
    works fine for plain function tracing. But this causes bogus output
    with the graph tracer:

    3) -0 | d.s3. 0.000 us | return_to_handler();
    3) -0 | d.s3. 0.000 us | _raw_spin_unlock_irqrestore();
    3) -0 | d.s3. 0.000 us | return_to_handler();
    3) -0 | d.s3. 0.000 us | trace_hardirqs_on();

    The "return_to_handle()" call is the trampoline of the
    function graph tracer, and is meaningless in this context.

    Cc: Jiri Olsa
    Signed-off-by: Steven Rostedt

    Steven Rostedt
     
  • The preempt and irqsoff tracers have three types of function tracers.
    Normal function tracer, function graph entry, and function graph return.
    Each of these use a complex dance to prevent recursion and whether
    to trace the data or not (depending if interrupts are enabled or not).

    This patch moves the duplicate code into a single routine, to
    prevent future mistakes with modifying duplicate complex code.

    Cc: Jiri Olsa
    Signed-off-by: Steven Rostedt

    Steven Rostedt
     
  • The wakeup tracer has three types of function tracers. Normal
    function tracer, function graph entry, and function graph return.
    Each of these use a complex dance to prevent recursion and whether
    to trace the data or not (depending on the wake_task variable).

    This patch moves the duplicate code into a single routine, to
    prevent future mistakes with modifying duplicate complex code.

    Cc: Jiri Olsa
    Signed-off-by: Steven Rostedt

    Steven Rostedt
     
  • Add function graph support for wakeup latency tracer.
    The graph output is enabled by setting the 'display-graph'
    trace option.

    Signed-off-by: Jiri Olsa
    LKML-Reference:
    Signed-off-by: Steven Rostedt

    Jiri Olsa
     
  • Move trace_graph_function() and print_graph_headers_flags() functions
    to the trace_function_graph.c to be globaly available.

    Signed-off-by: Jiri Olsa
    LKML-Reference:
    Signed-off-by: Steven Rostedt

    Jiri Olsa
     
  • The check_irq_entry and check_irq_return could be called
    from graph event context. In such case there's no graph
    private data allocated. Adding checks to handle this case.

    Signed-off-by: Jiri Olsa
    LKML-Reference:

    [ Fixed some grammar in the comments ]

    Signed-off-by: Steven Rostedt

    Jiri Olsa
     
  • Unnecessary cast from void* in assignment.

    Signed-off-by: matt mooney
    Signed-off-by: Steven Rostedt

    matt mooney
     

15 Oct, 2010

1 commit

  • All file_operations should get a .llseek operation so we can make
    nonseekable_open the default for future file operations without a
    .llseek pointer.

    The three cases that we can automatically detect are no_llseek, seq_lseek
    and default_llseek. For cases where we can we can automatically prove that
    the file offset is always ignored, we use noop_llseek, which maintains
    the current behavior of not returning an error from a seek.

    New drivers should normally not use noop_llseek but instead use no_llseek
    and call nonseekable_open at open time. Existing drivers can be converted
    to do the same when the maintainer knows for certain that no user code
    relies on calling seek on the device file.

    The generated code is often incorrectly indented and right now contains
    comments that clarify for each added line why a specific variant was
    chosen. In the version that gets submitted upstream, the comments will
    be gone and I will manually fix the indentation, because there does not
    seem to be a way to do that using coccinelle.

    Some amount of new code is currently sitting in linux-next that should get
    the same modifications, which I will do at the end of the merge window.

    Many thanks to Julia Lawall for helping me learn to write a semantic
    patch that does all this.

    ===== begin semantic patch =====
    // This adds an llseek= method to all file operations,
    // as a preparation for making no_llseek the default.
    //
    // The rules are
    // - use no_llseek explicitly if we do nonseekable_open
    // - use seq_lseek for sequential files
    // - use default_llseek if we know we access f_pos
    // - use noop_llseek if we know we don't access f_pos,
    // but we still want to allow users to call lseek
    //
    @ open1 exists @
    identifier nested_open;
    @@
    nested_open(...)
    {

    }

    @ open exists@
    identifier open_f;
    identifier i, f;
    identifier open1.nested_open;
    @@
    int open_f(struct inode *i, struct file *f)
    {

    }

    @ read disable optional_qualifier exists @
    identifier read_f;
    identifier f, p, s, off;
    type ssize_t, size_t, loff_t;
    expression E;
    identifier func;
    @@
    ssize_t read_f(struct file *f, char *p, size_t s, loff_t *off)
    {

    }

    @ read_no_fpos disable optional_qualifier exists @
    identifier read_f;
    identifier f, p, s, off;
    type ssize_t, size_t, loff_t;
    @@
    ssize_t read_f(struct file *f, char *p, size_t s, loff_t *off)
    {
    ... when != off
    }

    @ write @
    identifier write_f;
    identifier f, p, s, off;
    type ssize_t, size_t, loff_t;
    expression E;
    identifier func;
    @@
    ssize_t write_f(struct file *f, const char *p, size_t s, loff_t *off)
    {

    }

    @ write_no_fpos @
    identifier write_f;
    identifier f, p, s, off;
    type ssize_t, size_t, loff_t;
    @@
    ssize_t write_f(struct file *f, const char *p, size_t s, loff_t *off)
    {
    ... when != off
    }

    @ fops0 @
    identifier fops;
    @@
    struct file_operations fops = {
    ...
    };

    @ has_llseek depends on fops0 @
    identifier fops0.fops;
    identifier llseek_f;
    @@
    struct file_operations fops = {
    ...
    .llseek = llseek_f,
    ...
    };

    @ has_read depends on fops0 @
    identifier fops0.fops;
    identifier read_f;
    @@
    struct file_operations fops = {
    ...
    .read = read_f,
    ...
    };

    @ has_write depends on fops0 @
    identifier fops0.fops;
    identifier write_f;
    @@
    struct file_operations fops = {
    ...
    .write = write_f,
    ...
    };

    @ has_open depends on fops0 @
    identifier fops0.fops;
    identifier open_f;
    @@
    struct file_operations fops = {
    ...
    .open = open_f,
    ...
    };

    // use no_llseek if we call nonseekable_open
    ////////////////////////////////////////////
    @ nonseekable1 depends on !has_llseek && has_open @
    identifier fops0.fops;
    identifier nso ~= "nonseekable_open";
    @@
    struct file_operations fops = {
    ... .open = nso, ...
    +.llseek = no_llseek, /* nonseekable */
    };

    @ nonseekable2 depends on !has_llseek @
    identifier fops0.fops;
    identifier open.open_f;
    @@
    struct file_operations fops = {
    ... .open = open_f, ...
    +.llseek = no_llseek, /* open uses nonseekable */
    };

    // use seq_lseek for sequential files
    /////////////////////////////////////
    @ seq depends on !has_llseek @
    identifier fops0.fops;
    identifier sr ~= "seq_read";
    @@
    struct file_operations fops = {
    ... .read = sr, ...
    +.llseek = seq_lseek, /* we have seq_read */
    };

    // use default_llseek if there is a readdir
    ///////////////////////////////////////////
    @ fops1 depends on !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
    identifier fops0.fops;
    identifier readdir_e;
    @@
    // any other fop is used that changes pos
    struct file_operations fops = {
    ... .readdir = readdir_e, ...
    +.llseek = default_llseek, /* readdir is present */
    };

    // use default_llseek if at least one of read/write touches f_pos
    /////////////////////////////////////////////////////////////////
    @ fops2 depends on !fops1 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
    identifier fops0.fops;
    identifier read.read_f;
    @@
    // read fops use offset
    struct file_operations fops = {
    ... .read = read_f, ...
    +.llseek = default_llseek, /* read accesses f_pos */
    };

    @ fops3 depends on !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
    identifier fops0.fops;
    identifier write.write_f;
    @@
    // write fops use offset
    struct file_operations fops = {
    ... .write = write_f, ...
    + .llseek = default_llseek, /* write accesses f_pos */
    };

    // Use noop_llseek if neither read nor write accesses f_pos
    ///////////////////////////////////////////////////////////

    @ fops4 depends on !fops1 && !fops2 && !fops3 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
    identifier fops0.fops;
    identifier read_no_fpos.read_f;
    identifier write_no_fpos.write_f;
    @@
    // write fops use offset
    struct file_operations fops = {
    ...
    .write = write_f,
    .read = read_f,
    ...
    +.llseek = noop_llseek, /* read and write both use no f_pos */
    };

    @ depends on has_write && !has_read && !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
    identifier fops0.fops;
    identifier write_no_fpos.write_f;
    @@
    struct file_operations fops = {
    ... .write = write_f, ...
    +.llseek = noop_llseek, /* write uses no f_pos */
    };

    @ depends on has_read && !has_write && !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
    identifier fops0.fops;
    identifier read_no_fpos.read_f;
    @@
    struct file_operations fops = {
    ... .read = read_f, ...
    +.llseek = noop_llseek, /* read uses no f_pos */
    };

    @ depends on !has_read && !has_write && !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
    identifier fops0.fops;
    @@
    struct file_operations fops = {
    ...
    +.llseek = noop_llseek, /* no read or write fn */
    };
    ===== End semantic patch =====

    Signed-off-by: Arnd Bergmann
    Cc: Julia Lawall
    Cc: Christoph Hellwig

    Arnd Bergmann