13 Jan, 2011

2 commits

  • * 'tools' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-idle-2.6:
    tools: create power/x86/x86_energy_perf_policy
    tools: create power/x86/turbostat

    Linus Torvalds
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-ktest: (30 commits)
    ktest: Ask for the manditory config options instead of just failing
    ktest: Copy the last good and bad configs in config_bisect
    ktest: For grub reboot, use run_ssh instead of run_command
    ktest: Added force stop after success and failure
    ktest: Parse off the directory name in useconfig for failures
    ktest: Use different temp config name for minconfig
    ktest: Updated the sample.conf for the latest options
    ktest: Added compare script to test ktest.pl to sample.conf
    ktest: Added config_bisect test type
    ktest/cleanups: Added version 0.2, ssh as options
    ktest: Output something easy to parse for failure or success
    ktest: Allow a test case to undefine a default value
    ktest: Use $output_config instead of typing $outputdir/.config
    ktest: Write to stdout if no log file is given
    ktest: Use oldnoconfig instead of yes command
    ktest: Update the sample config file with more documentation
    ktest: New TEST_START instead of using [], and use real SHA1s
    ktest: Add poweroff after halt and powercycle after reboot
    ktest: Add POST_INSTALL to allow initrds to be created
    ktest: Added sample.conf, new %default option format
    ...

    Linus Torvalds
     

12 Jan, 2011

4 commits

  • Len Brown
     
  • MSR_IA32_ENERGY_PERF_BIAS first became available on Westmere Xeon.
    It is implemented in all Sandy Bridge processors -- mobile, desktop and server.
    It is expected to become increasingly important in subsequent generations.

    x86_energy_perf_policy is a user-space utility to set the
    hardware energy vs performance policy hint in the processor.
    Most systems would benefit from "x86_energy_perf_policy normal"
    at system startup, as the hardware default is maximum performance
    at the expense of energy efficiency.

    See x86_energy_perf_policy.8 man page for more information.

    Background:

    Linux-2.6.36 added "epb" to /proc/cpuinfo to indicate
    if an x86 processor supports MSR_IA32_ENERGY_PERF_BIAS,
    without actually modifying the MSR.

    In March, 2010, Venkatesh Pallipadi proposed a small driver
    that programmed MSR_IA32_ENERGY_PERF_BIAS, based on
    the cpufreq governor in use. It also offered
    a boot-time cmdline option to override.
    http://lkml.org/lkml/2010/3/4/457
    But hiding the hardware policy behind the
    governor choice was deemed "kinda icky".

    In June, 2010, I proposed a generic user/kernel API to
    generalize the power/performance policy trade-off.
    "RFC: /sys/power/policy_preference"
    http://lkml.org/lkml/2010/6/16/399
    That is my preference for implementing this capability,
    but I received no support on the list.

    So in September, 2010, I sent x86_energy_perf_policy.c to LKML,
    a user-space utility that scribbles directly to the MSR.
    http://lkml.org/lkml/2010/9/28/246

    Here is that same utility, after responding to some review feedback,
    to live in tools/power/, where it is easily found.

    Signed-off-by: Len Brown

    Len Brown
     
  • turbostat is a Linux tool to observe proper operation
    of Intel(R) Turbo Boost Technology.

    turbostat displays the actual processor frequency
    on x86 processors that include APERF and MPERF MSRs.

    Note that turbostat is of limited utility on Linux
    kernels 2.6.29 and older, as acpi_cpufreq cleared
    APERF/MPERF up through that release.

    On Intel Core i3/i5/i7 (Nehalem) and newer processors,
    turbostat also displays residency in idle power saving states,
    which are necessary for diagnosing any cpuidle issues
    that may have an effect on turbo-mode.

    See the turbostat.8 man page for example usage.

    Signed-off-by: Len Brown

    Len Brown
     
  • …/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: (28 commits)
    perf session: Fix infinite loop in __perf_session__process_events
    perf evsel: Support perf_evsel__open(cpus > 1 && threads > 1)
    perf sched: Use PTHREAD_STACK_MIN to avoid pthread_attr_setstacksize() fail
    perf tools: Emit clearer message for sys_perf_event_open ENOENT return
    perf stat: better error message for unsupported events
    perf sched: Fix allocation result check
    perf, x86: P4 PMU - Fix unflagged overflows handling
    dynamic debug: Fix build issue with older gcc
    tracing: Fix TRACE_EVENT power tracepoint creation
    tracing: Fix preempt count leak
    tracepoint: Add __rcu annotation
    tracing: remove duplicate null-pointer check in skb tracepoint
    tracing/trivial: Add missing comma in TRACE_EVENT comment
    tracing: Include module.h in define_trace.h
    x86: Save rbp in pt_regs on irq entry
    x86, dumpstack: Fix unused variable warning
    x86, NMI: Clean-up default_do_nmi()
    x86, NMI: Allow NMI reason io port (0x61) to be processed on any CPU
    x86, NMI: Remove DIE_NMI_IPI
    x86, NMI: Add priorities to handlers
    ...

    Linus Torvalds
     

11 Jan, 2011

4 commits

  • In this if statement:

    if (head + event->header.size >= mmap_size) {
    if (mmaps[map_idx]) {
    munmap(mmaps[map_idx], mmap_size);
    mmaps[map_idx] = NULL;
    }

    page_offset = page_size * (head / page_size);
    file_offset += page_offset;
    head -= page_offset;
    goto remap;
    }

    With, for instance, these values:

    head=2992
    event->header.size=48
    mmap_size=3040

    We end up endlessly looping back to remap. Off by one.

    Problem introduced in 55b4462.

    Reported-by: Linus Torvalds
    Reported-by: Ingo Molnar
    Reported-by: David Ahern
    Bisected-by: David Ahern
    Tested-by: David Ahern
    Cc: David Ahern
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Mike Galbraith
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Cc: Thomas Gleixner
    Cc: Tom Zanussi
    LKML-Reference:
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • And a test for it:

    [acme@felicio linux]$ perf test
    1: vmlinux symtab matches kallsyms: Ok
    2: detect open syscall event: Ok
    3: detect open syscall event on all cpus: Ok
    [acme@felicio linux]$

    Translating C the test does:

    1. generates different number of open syscalls on each CPU
    by using sched_setaffinity
    2. Verifies that the expected number of events is generated
    on each CPU

    It works as expected.

    LKML-Reference:
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Mike Galbraith
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Cc: Tom Zanussi
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/penberg/slab-2.6:
    slub: Fix a crash during slabinfo -v
    tracing/slab: Move kmalloc tracepoint out of inline code
    slub: Fix slub_lock down/up imbalance
    slub: Fix build breakage in Documentation/vm
    slub tracing: move trace calls out of always inlined functions to reduce kernel code size
    slub: move slabinfo.c to tools/slub/slabinfo.c

    Linus Torvalds
     
  • on ppc64:
    /usr/include/bits/local_lim.h:#define PTHREAD_STACK_MIN 131072

    therefore following set of commands:

    gives:
    perf.2.6.37test: builtin-sched.c:493: create_tasks: Assertion `!(err)' failed.

    So make sure we do not set stack size lower than PTHREAD_STACK_MIN.

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

    Jiri Pirko
     

10 Jan, 2011

3 commits

  • Improve sys_perf_event_open ENOENT return handling in top and record, just
    like 5a3446b does for stat.

    Cc: David Ahern
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Mike Galbraith
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Cc: Tom Zanussi
    LKML-Reference:
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • For unsupported events (e.g., H/W events when running in a VM)
    perf stat currently fails with the error message:

    Error: open_counter returned with 2 (No such file or directory).
    /bin/dmesg may provide additional information.

    Fatal: Not all events could be opened.

    dmesg is of no help and it is not clear as to why it fails to
    open the counter. This patch changes the error message to

    Error: cache-misses event is not supported.
    Fatal: Not all events could be opened.

    Cc: Ingo Molnar
    Cc: Paul Mackerras
    Cc: a.p.zijlstra@chello.nl
    LPU-Reference:
    Signed-off-by: David Ahern
    Signed-off-by: Arnaldo Carvalho de Melo

    David Ahern
     
  • Bug introduced in ce47dc56.

    Reported-by: Mike Galbraith
    Cc: Chris Samuel
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Mike Galbraith
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Cc: Tom Zanussi
    LKML-Reference:
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     

09 Jan, 2011

1 commit


08 Jan, 2011

1 commit

  • * 'for-linus' of git://git390.marist.edu/pub/scm/linux-2.6: (65 commits)
    [S390] prevent unneccesary loops_per_jiffy recalculation
    [S390] cpuinfo: use get_online_cpus() instead of preempt_disable()
    [S390] smp: remove cpu hotplug messages
    [S390] mutex: enable spinning mutex on s390
    [S390] mutex: Introduce arch_mutex_cpu_relax()
    [S390] cio: fix ccwgroup unregistration race condition
    [S390] perf: add DWARF register lookup for s390
    [S390] cleanup ftrace backend functions
    [S390] ptrace cleanup
    [S390] smp/idle: call init_idle() before starting a new cpu
    [S390] smp: delay idle task creation
    [S390] dasd: Correct retry counter for terminated I/O.
    [S390] dasd: Add support for raw ECKD access.
    [S390] dasd: Prevent deadlock during suspend/resume.
    [S390] dasd: Improve handling of stolen DASD reservation
    [S390] dasd: do path verification for paths added at runtime
    [S390] dasd: add High Performance FICON multitrack support
    [S390] cio: reduce memory consumption of itcw structures
    [S390] nmi: enable machine checks early
    [S390] qeth: buffer count imbalance
    ...

    Linus Torvalds
     

07 Jan, 2011

4 commits

  • Since commit 69aad6f1(perf tools: Introduce event selectors), only
    perf_event_attr::type and ::config are passed to event selector, which
    makes perf tool not work correctly.

    For example, PEBS does not work because perf_event_attr::precise_ip is
    not passed to the syscall.

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

    Lin Ming
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6: (1436 commits)
    cassini: Use local-mac-address prom property for Cassini MAC address
    net: remove the duplicate #ifdef __KERNEL__
    net: bridge: check the length of skb after nf_bridge_maybe_copy_header()
    netconsole: clarify stopping message
    netconsole: don't announce stopping if nothing happened
    cnic: Fix the type field in SPQ messages
    netfilter: fix export secctx error handling
    netfilter: fix the race when initializing nf_ct_expect_hash_rnd
    ipv4: IP defragmentation must be ECN aware
    net: r6040: Return proper error for r6040_init_one
    dcb: use after free in dcb_flushapp()
    dcb: unlock on error in dcbnl_ieee_get()
    net: ixp4xx_eth: Return proper error for eth_init_one
    include/linux/if_ether.h: Add #define ETH_P_LINK_CTL for HPNA and wlan local tunnel
    net: add POLLPRI to sock_def_readable()
    af_unix: Avoid socket->sk NULL OOPS in stream connect security hooks.
    net_sched: pfifo_head_drop problem
    mac80211: remove stray extern
    mac80211: implement off-channel TX using hw r-o-c offload
    mac80211: implement hardware offload for remain-on-channel
    ...

    Linus Torvalds
     
  • It seems that some gcc versions build by default with frame pointers
    and some others omit them.

    Just build the tools with frame pointers as the callchains can be an
    important part of the perf workflow.

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

    Frederic Weisbecker
     
  • I found when specifying all tracepoints with -e to one of subcommand,
    such as 'stat', the program will trigger a buffer overflow error, like
    this:

    *** buffer overflow detected ***: ./perf terminated
    ======= Backtrace: =========
    /lib64/libc.so.6(__fortify_fail+0x37)[0x382cefb2c7]
    ....

    The tracepoints are separated by comma, something like this:

    $ perf stat -a -e `perf list |grep Tracepoint|awk -F'[' '{gsub(/[[:space:]]+/,"",$1);array[FNR]=$1}END{outputs=array[1];for (i=2;i
    Signed-off-by: Han Pingtian
    Signed-off-by: Arnaldo Carvalho de Melo

    Han Pingtian
     

06 Jan, 2011

5 commits

  • Not accessed outside builtin-script, so make them static.

    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Mike Galbraith
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Cc: Tom Zanussi
    LKML-Reference:
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • That already does what was being done here. The warning is now unconditionally
    given by __perf_session__process_pipe_events, just like for non pipe processing.

    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Mike Galbraith
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Cc: Tom Zanussi
    LKML-Reference:
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • Just like we do at __perf_session__process_events

    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Mike Galbraith
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Cc: Tom Zanussi
    LKML-Reference:
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • This patch fixes the usage of the perf_event.h header file
    between command modules and the supporting code in util.

    It is necessary to ensure that ALL files use the SAME
    perf_event.h header from the kernel source tree.

    There were a couple of #include mixed
    with #include "../../perf_event.h".

    This caused issues on some distros because of mismatch
    in the layout of struct perf_event_attr. That eventually
    led perf stat to segfault.

    Cc: David S. Miller
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Robert Richter
    Cc: Stephane Eranian
    LKML-Reference:
    Signed-off-by: Stephane Eranian
    Signed-off-by: Arnaldo Carvalho de Melo

    Stephane Eranian
     
  • Rebooted my devel machine, first thing I ran was perf test, that expects
    debugfs to be mounted, test fails. Be more clear about it.

    Also add missing newlines and add more informative message when
    sys_perf_event_open fails.

    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Mike Galbraith
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Cc: Tom Zanussi
    LKML-Reference:
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     

05 Jan, 2011

2 commits


04 Jan, 2011

14 commits

  • builtin-timechart must only pass -e power:xy events if they are supported by
    the running kernel, otherwise try to fetch the old power:power{start,end}
    events.

    For this I added the tiny helper function:

    int is_valid_tracepoint(const char *event_string)

    to parse-events.[hc], which could be more generic as an interface and support
    hardware/software/... events, not only tracepoints, but someone else could
    extend that if needed...

    Signed-off-by: Thomas Renninger
    Acked-by: Arjan van de Ven
    Acked-by: Jean Pihet
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Thomas Renninger
     
  • …inux-2.6 into perf/core

    Ingo Molnar
     
  • Merge reason: pick up latest -rc.

    Signed-off-by: Ingo Molnar

    Ingo Molnar
     
  • To test the use of the perf_evsel class on something other than
    the tools from where we refactored code to create it.

    It calls open() N times and then checks if the event created to
    monitor it returns N events.

    [acme@felicio linux]$ perf test
    1: vmlinux symtab matches kallsyms: Ok
    2: detect open syscall event: Ok
    [acme@felicio linux]$

    It does.

    Cc: Frederic Weisbecker
    Cc: Han Pingtian
    Cc: Ingo Molnar
    Cc: Mike Galbraith
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Cc: Tom Zanussi
    LKML-Reference:
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • While writing the first user of the routines created from the ad-hoc
    routines in the existing builtins I noticed that the resulting set of
    calls was too long, reduce it by doing some best effort allocations.

    Tools that need to operate on multiple threads and cpus should pre-allocate
    enough resources by explicitely calling the perf_evsel__alloc_{fd,counters}
    methods.

    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Mike Galbraith
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Cc: Tom Zanussi
    LKML-Reference:
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Mike Galbraith
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Cc: Tom Zanussi
    LKML-Reference:
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • So that later, we can pass the thread_map instance instead of
    (thread_num, thread_map) for things like perf_evsel__open and friends,
    just like was done with cpu_map.

    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Mike Galbraith
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Cc: Tom Zanussi
    LKML-Reference:
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • So that later, we can pass the cpu_map instance instead of (nr_cpus, cpu_map)
    for things like perf_evsel__open and friends.

    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Mike Galbraith
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Cc: Tom Zanussi
    LKML-Reference:
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • Abstracting away the loops needed to create the various event fd handlers.

    The users have to pass a confiruged perf->evsel.attr field, which is already
    usable after perf_evsel__new (constructor) time, using defaults.

    Comes out of the ad-hoc routines in builtin-stat, that now uses it.

    Fixed a small silly bug where we were die()ing before killing our
    children, dysfunctional family this one 8-)

    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Mike Galbraith
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Cc: Tom Zanussi
    LKML-Reference:
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • Making them hopefully generic enough to be used in 'perf test',
    well see.

    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Mike Galbraith
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Cc: Tom Zanussi
    LKML-Reference:
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • Freeing all the possibly allocated resources, reducing complexity
    on each tool exit path.

    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Mike Galbraith
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Cc: Tom Zanussi
    LKML-Reference:
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • Not really something to be exported from session.c. Rename it to
    'readn' as others did in the past.

    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Mike Galbraith
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Cc: Tom Zanussi
    LKML-Reference:
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Mike Galbraith
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Cc: Tom Zanussi
    LKML-Reference:
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • Out of ad-hoc code and global arrays with hard coded sizes.

    This is the first step on having a library that will be first
    used on regression tests in the 'perf test' tool.

    [acme@felicio linux]$ size /tmp/perf.before
    text data bss dec hex filename
    1273776 97384 5104416 6475576 62cf38 /tmp/perf.before
    [acme@felicio linux]$ size /tmp/perf.new
    text data bss dec hex filename
    1275422 97416 1392416 2765254 2a31c6 /tmp/perf.new

    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Mike Galbraith
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Cc: Tom Zanussi
    LKML-Reference:
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo