28 Feb, 2010

1 commit

  • I've forgot to add 'perf lock' line to command-list.txt,
    so users of perf could not find perf lock when they type 'perf'.

    Fixing command-list.txt requires document
    (tools/perf/Documentation/perf-lock.txt).
    But perf lock is too much "under construction" to write a
    stable document, so this is something like pseudo document for now.

    And I wrote description of perf lock at help section of
    CONFIG_LOCK_STAT, this will navigate users of lock trace events.

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

    Hitoshi Mitake
     

27 Feb, 2010

4 commits

  • Add __percpu sparse annotations to hw_breakpoint.

    These annotations are to make sparse consider percpu variables to be
    in a different address space and warn if accessed without going
    through percpu accessors. This patch doesn't affect normal builds.

    In kernel/hw_breakpoint.c, per_cpu(nr_task_bp_pinned, cpu)'s will
    trigger spurious noderef related warnings from sparse. Changing it to
    &per_cpu(nr_task_bp_pinned[0], cpu) will work around the problem but
    deemed to ugly by the maintainer. Leave it alone until better
    solution can be found.

    Signed-off-by: Tejun Heo
    Cc: Stephen Rothwell
    Cc: K.Prasad
    LKML-Reference:
    Signed-off-by: Frederic Weisbecker

    Tejun Heo
     
  • Merge reason:
    __percpu annotations need the corresponding sparse address
    space definition upstream.

    Conflicts:
    tools/perf/util/probe-event.c (trivial)

    Frederic Weisbecker
     
  • Avoid kernels from exploding on AMD machines when they have any
    lock debugging bits enabled.

    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     
  • A recent commit introduced a preemption warning for
    perf_clock(), use raw_smp_processor_id() to avoid this, it
    really doesn't matter which cpu we use here.

    Signed-off-by: Peter Zijlstra
    LKML-Reference:
    Cc:
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     

26 Feb, 2010

9 commits

  • Even though we don't register the counters until the child is right about
    to exec(), we're still going to get at least a few events while the
    fork()'d child is still executing 'perf' and in particular we're going to
    get the MMAP events.

    We can't distinguish the ones in the newly executed process because the
    PID will be the same.

    One way to solve this would be to have a PERF_RECORD_EXEC event, and when
    this is seen 'perf' can flush it's map cache. We can't use
    PERF_RECORD_COMM since that's generated by other things, not just exec().

    Actually, thinking about it some more, using PERF_RECORD_COMM might be a
    good enough approximation.

    Signed-off-by: David S. Miller
    Signed-off-by: Arnaldo Carvalho de Melo
    Cc: Frédéric Weisbecker
    Cc: Mike Galbraith
    Cc: Peter Zijlstra
    Cc: Paul Mackerras
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    David S. Miller
     
  • Split amd,p6,intel into separate files so that we can easily deal with
    CONFIG_CPU_SUP_* things, needed to make things build now that perf_event.c
    relies on symbols from amd.c

    Signed-off-by: Peter Zijlstra
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     
  • Without this patch we get this for need_resched:

    [root@mica ~]# perf annotate need_resched

    ------------------------------------------------
    Percent | Source code & Disassembly of vmlinux
    ------------------------------------------------
    :
    :
    : Disassembly of section .text:
    :
    : ffffffff810095ed :
    : return (state & TASK_INTERRUPTIBLE) || __fatal_signal_pending(p);
    : }
    :
    : static inline int need_resched(void)
    : {
    0.00 : ffffffff810095ed: 55 push %rbp
    : return unlikely(test_thread_flag(TIF_NEED_RESCHED));
    0.00 : ffffffff810095ee: be 03 00 00 00 mov $0x3,%esi
    :
    : static inline struct thread_info *current_thread_info(void)
    : {
    : struct thread_info *ti;
    : ti = (void *)(percpu_read_stable(kernel_stack) +
    0.00 : ffffffff810095f3: 65 48 8b 3c 25 48 b5 mov %gs:0xb548,%rdi
    0.00 : ffffffff810095fa: 00 00
    : return (state & TASK_INTERRUPTIBLE) || __fatal_signal_pending(p);
    : }
    :
    : static inline int need_resched(void)
    : {
    0.00 : ffffffff810095fc: 48 89 e5 mov %rsp,%rbp
    : return unlikely(test_thread_flag(TIF_NEED_RESCHED));
    0.00 : ffffffff810095ff: 48 81 ef d8 1f 00 00 sub $0x1fd8,%rdi
    0.00 : ffffffff81009606: e8 9d ff ff ff callq ffffffff810095a8
    : }
    0.00 : ffffffff8100960b: c9 leaveq
    0.00 : ffffffff8100960c: 85 c0 test %eax,%eax
    0.00 : ffffffff8100960e: 0f 95 c0 setne %al
    0.00 : ffffffff81009611: 0f b6 c0 movzbl %al,%eax
    : Disassembly of section .vsyscall_0:
    : Disassembly of section .vsyscall_fn:
    : Disassembly of section .vsyscall_1:
    : Disassembly of section .vsyscall_2:
    : Disassembly of section .init.text:
    : Disassembly of section .altinstr_replacement:
    : Disassembly of section .exit.text:
    [root@mica ~]#

    But from the 'perf report' result we know that there are hits
    for need_resched on a 4 way machine mostly doing nothing, so
    after adding code to show what is in each hist offset and
    collapsing IP hits for what happens between objdump lines we
    get, for the same perf.data file:

    [root@mica ~]# perf annotate -v need_resched

    ------------------------------------------------
    Percent | Source code & Disassembly of vmlinux
    ------------------------------------------------
    :
    :
    : Disassembly of section .text:
    :
    : ffffffff810095ed :
    : return (state & TASK_INTERRUPTIBLE) || __fatal_signal_pending(p);
    : }
    :
    : static inline int need_resched(void)
    : {
    0.00 : ffffffff810095ed: 55 push %rbp
    : return unlikely(test_thread_flag(TIF_NEED_RESCHED));
    52.78 : ffffffff810095ee: be 03 00 00 00 mov $0x3,%esi
    :
    : static inline struct thread_info *current_thread_info(void)
    : {
    : struct thread_info *ti;
    : ti = (void *)(percpu_read_stable(kernel_stack) +
    0.00 : ffffffff810095f3: 65 48 8b 3c 25 48 b5 mov %gs:0xb548,%rdi
    0.00 : ffffffff810095fa: 00 00
    : return (state & TASK_INTERRUPTIBLE) || __fatal_signal_pending(p);
    : }
    :
    : static inline int need_resched(void)
    : {
    0.00 : ffffffff810095fc: 48 89 e5 mov %rsp,%rbp
    : return unlikely(test_thread_flag(TIF_NEED_RESCHED));
    9.72 : ffffffff810095ff: 48 81 ef d8 1f 00 00 sub $0x1fd8,%rdi
    0.00 : ffffffff81009606: e8 9d ff ff ff callq ffffffff810095a8
    : }
    0.00 : ffffffff8100960b: c9 leaveq
    0.00 : ffffffff8100960c: 85 c0 test %eax,%eax
    37.50 : ffffffff8100960e: 0f 95 c0 setne %al
    0.00 : ffffffff81009611: 0f b6 c0 movzbl %al,%eax
    : Disassembly of section .vsyscall_0:
    : Disassembly of section .vsyscall_fn:
    : Disassembly of section .vsyscall_1:
    : Disassembly of section .vsyscall_2:
    : Disassembly of section .init.text:
    : Disassembly of section .altinstr_replacement:
    : Disassembly of section .exit.text:
    [root@mica ~]#

    And now 'perf annotate -v', verbose mode, will show the hits per
    precise IP, so that one can make sense of the attribution to
    each objdumop line:

    [root@mica ~]# perf annotate -v need_resched
    Looking at the vmlinux_path (5 entries long)
    Using /lib/modules/2.6.33-rc8-tip-00784-g3471df5-dirty/build/vmlinux
    for symbols annotate_sym: filename=/lib/modules/2.6.33-rc8-tip-00784-g3471df5-dirty/build/vmlinux, sym=need_resched, start=0xffffffff810095ed, end=0xffffffff81009614

    ------------------------------------------------
    Percent | Source code & Disassembly of vmlinux
    ------------------------------------------------
    ffffffff810095f1: 152
    ffffffff81009603: 28
    ffffffff8100960f: 55
    ffffffff81009610: 53
    h->sum: 288

    Signed-off-by: Arnaldo Carvalho de Melo
    Cc: David Miller
    Cc: Frédéric Weisbecker
    Cc: Mike Galbraith
    Cc: Peter Zijlstra
    Cc: Paul Mackerras
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Arnaldo Carvalho de Melo
     
  • We re-program the event control register every time we reset the count,
    this appears to be superflous, hence remove it.

    Signed-off-by: Peter Zijlstra
    Cc: Arjan van de Ven
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     
  • Since the cpu argument to hw_perf_group_sched_in() is always
    smp_processor_id(), simplify the code a little by removing this argument
    and using the current cpu where needed.

    Signed-off-by: Peter Zijlstra
    Cc: David Miller
    Cc: Paul Mackerras
    Cc: Benjamin Herrenschmidt
    Cc: Frederic Weisbecker
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     
  • This patch adds correct AMD NorthBridge event scheduling.

    NB events are events measuring L3 cache, Hypertransport traffic. They are
    identified by an event code >= 0xe0. They measure events on the
    Northbride which is shared by all cores on a package. NB events are
    counted on a shared set of counters. When a NB event is programmed in a
    counter, the data actually comes from a shared counter. Thus, access to
    those counters needs to be synchronized.

    We implement the synchronization such that no two cores can be measuring
    NB events using the same counters. Thus, we maintain a per-NB allocation
    table. The available slot is propagated using the event_constraint
    structure.

    Signed-off-by: Stephane Eranian
    Signed-off-by: Peter Zijlstra
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Stephane Eranian
     
  • In certain situations, the kernel may need to stop and start the same
    event rapidly. The current PMU callbacks do not distinguish between stop
    and release (i.e., stop + free the resource). Thus, a counter may be
    released, then it will be immediately re-acquired. Event scheduling will
    again take place with no guarantee to assign the same counter. On some
    processors, this may event yield to failure to assign the event back due
    to competion between cores.

    This patch is adding a new pair of callback to stop and restart a counter
    without actually release the underlying counter resource. On stop, the
    counter is stopped, its values saved and that's it. On start, the value
    is reloaded and counter is restarted (on x86, actual restart is delayed
    until perf_enable()).

    Signed-off-by: Stephane Eranian
    [ added fallback to ->enable/->disable for all other PMUs
    fixed x86_pmu_start() to call x86_pmu.enable()
    merged __x86_pmu_disable into x86_pmu_stop() ]
    Signed-off-by: Peter Zijlstra
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Stephane Eranian
     
  • DaveM reported that currently perf interprets the pgoff value reported by
    the MMAP events as a byte range, but the kernel reports it as a page
    offset.

    Since its broken (and unusable) anyway, change the kernel behaviour (ABI)
    to report bytes indeed, avoiding the need for userspace to deal with
    PAGE_SIZE things.

    Reported-by: David Miller
    Signed-off-by: Peter Zijlstra
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     
  • Because symbol->end is not fixed up at symbol_filter time, only
    after all symbols for a DSO are loaded, and that, for asm
    symbols, may be bogus, causing segfaults when hits happen in
    these symbols.

    Reported-by: David Miller
    Reported-by: Anton Blanchard
    Acked-by: David Miller
    Signed-off-by: Arnaldo Carvalho de Melo
    Cc: Frédéric Weisbecker
    Cc: Mike Galbraith
    Cc: Peter Zijlstra
    Cc: Paul Mackerras
    Cc: # for .33.x. Does not apply cleanly, needs backport.
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Arnaldo Carvalho de Melo
     

25 Feb, 2010

12 commits

  • Be more clear about DSO long names and tell from which file
    kernel symbols were obtained, all in --verbose mode:

    [root@mica ~]# perf report -v > /dev/null
    Looking at the vmlinux_path (5 entries long)
    Using /lib/modules/2.6.33-rc8-tip-00777-g0918527-dirty/build/vmlinux for symbols
    [root@mica ~]# mv /lib/modules/2.6.33-rc8-tip-00777-g0918527-dirty/build/vmlinux /tmp/dd
    [root@mica ~]# perf report -v > /dev/null
    Looking at the vmlinux_path (5 entries long)
    Using /proc/kallsyms for symbols
    [root@mica ~]#

    Signed-off-by: Arnaldo Carvalho de Melo
    Cc: Frédéric Weisbecker
    Cc: Mike Galbraith
    Cc: Peter Zijlstra
    Cc: Paul Mackerras
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Arnaldo Carvalho de Melo
     
  • To overcome a silly gcc warning:

    cc1: warnings being treated as errors
    builtin-top.c: In function ‘lookup_sym_source’:
    builtin-top.c:291: warning: not protecting local variables:
    variable length buffer make: *** [builtin-top.o] Error 1
    make: *** Waiting for unfinished jobs....

    That is emitted for this:

    const size_t pattern_len = BITS_PER_LONG / 4 + 2;
    char pattern[pattern_len + 1];

    Signed-off-by: Arnaldo Carvalho de Melo
    Cc: Frédéric Weisbecker
    Cc: Mike Galbraith
    Cc: Peter Zijlstra
    Cc: Paul Mackerras
    LKML-Reference:
    [ -v2: macroify the naming style ]
    Signed-off-by: Ingo Molnar

    Arnaldo Carvalho de Melo
     
  • In function dso__split_kallsyms(), curr_map saves the return value
    of map__new2. So check it instead of var map after the call returns.

    Signed-off-by: Zhang Yanmin
    Acked-by: David S. Miller
    Cc: # for .33.x
    Cc: Peter Zijlstra
    Cc: Mike Galbraith
    Cc: Paul Mackerras
    Cc: Arnaldo Carvalho de Melo
    Cc: Frederic Weisbecker
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Zhang, Yanmin
     
  • syscall_name() helper, which resolves a syscall arch number to
    its name, is not yet available as we first need to implement
    event injection for it to work.

    Remove it from the documentation or tag its references as
    unavailable yet. Once it's implemented, we can just revert
    the current patch.

    Signed-off-by: Frederic Weisbecker
    Cc: Tom Zanussi
    Cc: Ingo Molnar
    Cc: Steven Rostedt
    Cc: Keiichi KII
    Cc: Peter Zijlstra
    Cc: Paul Mackerras
    Cc: Arnaldo Carvalho de Melo

    Frederic Weisbecker
     
  • Also small update to perf-trace-perl and perf-trace docs.

    Signed-off-by: Tom Zanussi
    Cc: Ingo Molnar
    Cc: Steven Rostedt
    Cc: Keiichi KII
    Cc: Peter Zijlstra
    Cc: Paul Mackerras
    Cc: Arnaldo Carvalho de Melo
    LKML-Reference:
    Signed-off-by: Frederic Weisbecker

    Tom Zanussi
     
  • If we know the size of a tuple in advance, there's no need to resize
    it - start out with the known size in the first place.

    Signed-off-by: Tom Zanussi
    Cc: Ingo Molnar
    Cc: Steven Rostedt
    Cc: Keiichi KII
    Cc: Peter Zijlstra
    Cc: Paul Mackerras
    Cc: Arnaldo Carvalho de Melo
    LKML-Reference:
    Signed-off-by: Frederic Weisbecker

    Tom Zanussi
     
  • Adds a set of scripts that aggregate system call totals and system
    call errors. Most are Python scripts that also test basic
    functionality of the new Python engine, but there's also one Perl
    script added for comparison and for reference in some new
    Documentation contained in a later patch.

    Signed-off-by: Tom Zanussi
    Cc: Ingo Molnar
    Cc: Steven Rostedt
    Cc: Keiichi KII
    Cc: Peter Zijlstra
    Cc: Paul Mackerras
    Cc: Arnaldo Carvalho de Melo
    LKML-Reference:
    Signed-off-by: Frederic Weisbecker

    Tom Zanussi
     
  • Add base support for Python scripting to perf trace.

    Signed-off-by: Tom Zanussi
    Cc: Ingo Molnar
    Cc: Steven Rostedt
    Cc: Keiichi KII
    Cc: Peter Zijlstra
    Cc: Paul Mackerras
    Cc: Arnaldo Carvalho de Melo
    LKML-Reference:
    Signed-off-by: Frederic Weisbecker

    Tom Zanussi
     
  • Linus Torvalds
     
  • * 'urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/kyle/parisc-2.6:
    parisc: Set PCI CLS early in boot.

    Linus Torvalds
     
  • * 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6:
    [IA64] Fix broken sn2 build

    Linus Torvalds
     
  • Set the PCI CLS early in the boot process to prevent
    device failures. In pcibios_set_master use the new
    pci_cache_line_size instead of a hard-coded value.

    Signed-off-by: Carlos O'Donell
    Reviewed-by: Grant Grundler
    Signed-off-by: Kyle McMartin

    Carlos O'Donell
     

24 Feb, 2010

14 commits

  • * 'for-linus' of git://git.monstr.eu/linux-2.6-microblaze:
    microblaze: Fix out_le32() macro
    microblaze: Fix cache loop function for cache range

    Linus Torvalds
     
  • * 'for-linus' of git://git.kernel.dk/linux-2.6-block:
    Revert "block: improve queue_should_plug() by looking at IO depths"

    Linus Torvalds
     
  • Trailing semicolon causes compilation involving out_le32() to fail.

    Signed-off-by: Steven J. Magnani
    Signed-off-by: Michal Simek

    Steven J. Magnani
     
  • I create wrong asm code but none test shows that this part of code is wrong.
    I am not convinces that were good idea to create asm optimized macros
    for caches. The reason is that there is not optimization with previous code
    that's why make sense to add old code and do some benchmarking which
    functions are faster.

    Signed-off-by: Michal Simek

    Michal Simek
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6:
    net: bug fix for vlan + gro issue
    tc35815: Remove a wrong netif_wake_queue() call which triggers BUG_ON
    cdc_ether: new PID for Ericsson C3607w to the whitelist (resubmit)
    IPv6: better document max_addresses parameter
    MAINTAINERS: update mv643xx_eth maintenance status
    e1000: Fix DMA mapping error handling on RX
    iwlwifi: sanity check before counting number of tfds can be free
    iwlwifi: error checking for number of tfds in queue
    iwlwifi: set HT flags after channel in rxon

    Linus Torvalds
     
  • Traffic (tcp) doesnot start on a vlan interface when gro is enabled.
    Even the tcp handshake was not taking place.
    This is because, the eth_type_trans call before the netif_receive_skb
    in napi_gro_finish() resets the skb->dev to napi->dev from the previously
    set vlan netdev interface. This causes the ip_route_input to drop the
    incoming packet considering it as a packet coming from a martian source.

    I could repro this on 2.6.32.7 (stable) and 2.6.33-rc7.
    With this fix, the traffic starts and the test runs fine on both vlan
    and non-vlan interfaces.

    CC: Herbert Xu
    CC: Patrick McHardy
    Signed-off-by: Ajit Khaparde
    Signed-off-by: Herbert Xu
    Signed-off-by: David S. Miller

    Ajit Khaparde
     
  • * 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6:
    ACPI: Be in TS_POLLING state during mwait based C-state entry
    ACPI: Fix regression where _PPC is not read at boot even when ignore_ppc=0
    acer-wmi: Respect current backlight level when loading

    Linus Torvalds
     
  • * 'drm-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6:
    drm/vmwgfx: Fix queries if no dma buffer thrashing is occuring.
    drm/nv50: fix vram ptes on IGPs to point at stolen system memory
    drm/nv50: fix instmem binding on IGPs to point at stolen system memory
    drm/nv50: improve vram page table construction
    drm/nv50: more efficient clearing of gpu page table entries
    drm/nv50: make nv50_mem_vm_{bind,unbind} operate only on vram
    drm/nouveau: Fix up pre-nv17 analog load detection.

    Linus Torvalds
     
  • Revert the change made to arch/ia64/sn/kernel/setup.c by commit
    204fba4aa303ea4a7bb726a539bf4a5b9e3203d0 as it breaks the build.

    Fixing the build the b94b08081fcecf83fa690d6c5664f6316fe72208 way
    breaks xpc because genksyms then fails to generate an CRC for
    per_cpu____sn_cnodeid_to_nasid because of limitations in the
    generic genksyms code.

    Signed-off-by: Hedi Berriche
    Signed-off-by: Tony Luck

    Hedi Berriche
     
  • The check-perf-trace script only checks Perl functionality, and
    doesn't really need to be listed as as user script anyway.

    This only removes the '-report' shell script, so although it doesn't
    appear in the listing, the '-record' shell script and the check perf
    trace perl script itself is still available and can still be run
    manually as such:

    $ libexec/perf-core/scripts/perl/bin/check-perf-trace-record
    $ perf trace -s libexec/perf-core/scripts/perl/check-perf-trace.pl

    Signed-off-by: Tom Zanussi
    Cc: Ingo Molnar
    Cc: Steven Rostedt
    Cc: Keiichi KII
    Cc: Peter Zijlstra
    Cc: Paul Mackerras
    Cc: Arnaldo Carvalho de Melo
    LKML-Reference:
    Signed-off-by: Frederic Weisbecker

    Tom Zanussi
     
  • Create a scripting-engines directory to contain scripting engine
    implementation code, in anticipation of the addition of new scripting
    support. Also removes trace-event-perl.h.

    Signed-off-by: Tom Zanussi
    Cc: Ingo Molnar
    Cc: Steven Rostedt
    Cc: Keiichi KII
    Cc: Peter Zijlstra
    Cc: Paul Mackerras
    Cc: Arnaldo Carvalho de Melo
    LKML-Reference:
    Signed-off-by: Frederic Weisbecker

    Tom Zanussi
     
  • This stuff is needed by all scripting engines; move it from the Perl
    engine source to a more common place.

    Signed-off-by: Tom Zanussi
    Cc: Ingo Molnar
    Cc: Steven Rostedt
    Cc: Keiichi KII
    Cc: Peter Zijlstra
    Cc: Paul Mackerras
    Cc: Arnaldo Carvalho de Melo
    LKML-Reference:
    Signed-off-by: Frederic Weisbecker

    Tom Zanussi
     
  • Fix bogus calculation.

    Signed-off-by: Tom Zanussi
    Cc: Ingo Molnar
    Cc: Steven Rostedt
    Cc: Keiichi KII
    Cc: Peter Zijlstra
    Cc: Paul Mackerras
    Cc: Arnaldo Carvalho de Melo
    LKML-Reference:
    Signed-off-by: Frederic Weisbecker

    Tom Zanussi
     
  • 'perf trace -s list' prints a list of the supported scripting
    languages. One problem with it is that it falls through and prints
    the trace as well. The use of 'list' for this also makes it easy to
    confuse with 'perf trace -l', used for listing available scripts. So
    change 'perf trace -s list' to 'perf trace -s lang' and fixes the
    fall-through problem.

    Signed-off-by: Tom Zanussi
    Cc: Ingo Molnar
    Cc: Steven Rostedt
    Cc: Keiichi KII
    Cc: Peter Zijlstra
    Cc: Paul Mackerras
    Cc: Arnaldo Carvalho de Melo
    LKML-Reference:
    Signed-off-by: Frederic Weisbecker

    Tom Zanussi