10 Mar, 2011

1 commit

  • kallsyms has a virtual file name [kernel.kallsyms]. Currently, it can't
    be added to buildid cache successfully because the code
    (build_id_cache__add_s) tries to resolve [kernel.kallsyms] to a real
    absolute pathname and that fails.

    Fixes it by not resolving it and just use the name [kernel.kallsyms].
    So dir ~/.debug/[kernel.kallsyms] is created.

    Original bug report at:
    https://lkml.org/lkml/2011/3/1/524

    Tested-by: Han Pingtian
    Cc: Han Pingtian
    Cc: Ingo Molnar
    Cc: Peter Zijlstra
    LKML-Reference:
    Signed-off-by: Lin Ming
    Signed-off-by: Arnaldo Carvalho de Melo

    Lin Ming
     

01 Mar, 2011

1 commit

  • The ec5761e cset introduced the symfs feature with a bug for loading vmlinux
    files that ended up causing this failure:

    [root@emilia v2.6.38-rc5+]# strace -e trace=open perf top --vmlinux ./vmlinux 2>&1 | tail -3
    open("/./vmlinux", O_RDONLY) = -1 ENOENT (No such file or directory)
    ./vmlinux with build id b9266bf40e98dadb5d43a2f3e95d3c5d4aff46dc not found, continuing without symbols
    The ./vmlinux file can't be used
    [root@emilia v2.6.38-rc5+]#

    Remove the extra slash, just like is done in the DSO__ORIG_DSO handling in
    dso__load() and other parts of the ec5761e cset.

    Reported-by: Ingo Molnar
    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
     

28 Feb, 2011

2 commits

  • Currently numcpus is determined in pid_put_sample which is only
    called on sched_switch/sched_wakeup sample processing.

    On a machine with a lot cpus I often saw the last cpu missing.

    Check for (max) numcpus on every event happening and in the
    beginning. -> fixes the issue for me.

    Signed-off-by: Thomas Renninger
    Cc: Arjan van de Ven
    Cc: Arnaldo Carvalho de Melo
    Cc: lenb@kernel.org
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Thomas Renninger
     
  • This fix is needed for eye of gnome and firefox svg viewers.
    Only Inkscape can handle the broken case.

    Compare with the other svg_legenda_box declarations, looks
    like a typo slipped in at this place.

    Signed-off-by: Thomas Renninger
    Cc: Arjan van de Ven
    Cc: Arnaldo Carvalho de Melo
    Cc: lenb@kernel.org
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Thomas Renninger
     

25 Feb, 2011

1 commit

  • So that we match the header where we state the number of events with the
    "Samples" column when using 'perf report -n/--show-nr-samples':

    [root@emilia ~]# perf record -a sleep 1
    [ perf record: Woken up 1 times to write data ]
    [ perf record: Captured and wrote 0.111 MB perf.data (~4860 samples) ]
    [root@emilia ~]# perf report --stdio --show-nr-samples
    # Events: 11 cycles
    #
    # Overhead Samples Command Shared Object Symbol
    # ........ .......... ........... .................. ............................
    #
    16.65% 1 sleep [kernel.kallsyms] [k] unmap_vmas
    16.10% 1 perf libpthread-2.12.so [.] __pthread_cleanup_push_defer
    15.79% 2 perf [kernel.kallsyms] [k] format_decode
    12.88% 1 kworker/1:2 [kernel.kallsyms] [k] cache_reap
    10.69% 1 swapper [kernel.kallsyms] [k] _raw_spin_lock
    7.55% 1 sleep [kernel.kallsyms] [k] prepare_exec_creds
    6.00% 1 perf [jbd2] [k] start_this_handle
    5.29% 1 perf [kernel.kallsyms] [k] seq_read
    4.75% 1 perf [kernel.kallsyms] [k] get_pid_task
    4.30% 1 perf [kernel.kallsyms] [k] _raw_spin_unlock_irqrestore

    #
    # (For a higher level overview, try: perf report --sort comm,dso)
    #
    [root@emilia ~]#

    Reported-by: Stephane Eranian
    Reported-by: Cliff Wickman
    Acked-by: Stephane Eranian
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Mike Galbraith
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Cc: Tom Zanussi
    Cc:
    LKML-Reference:
    Signed-off-by: Arnaldo Carvalho de Melo
    [ cherry-picked it from perf/core, as it has been reported by others as well. ]
    Signed-off-by: Ingo Molnar

    Arnaldo Carvalho de Melo
     

16 Feb, 2011

1 commit


11 Feb, 2011

2 commits


10 Feb, 2011

1 commit

  • Jeff Moyer reported these messages:

    Warning: ... trying to fall back to cpu-clock-ticks

    couldn't open /proc/-1/status
    couldn't open /proc/-1/maps
    [ls output]
    [ perf record: Woken up 1 times to write data ]
    [ perf record: Captured and wrote 0.008 MB perf.data (~363 samples) ]

    That lead me and David Ahern to see that something was fishy on the thread
    synthesizing routines, at least for the case where the workload is started
    from 'perf record', as -1 is the default for target_tid in 'perf record --tid'
    parameter, so somehow we were trying to synthesize the PERF_RECORD_MMAP and
    PERF_RECORD_COMM events for the thread -1, a bug.

    So I investigated this and noticed that when we introduced support for
    recording a process and its threads using --pid some bugs were introduced and
    that the way to fix it was to instead of passing the target_tid to the event
    synthesizing routines we should better pass the thread_map that has the list of
    threads for a --pid or just the single thread for a --tid.

    Checked in the following ways:

    On a 8-way machine run cyclictest:

    [root@emilia ~]# perf record cyclictest -a -t -n -p99 -i100 -d50
    policy: fifo: loadavg: 0.00 0.13 0.31 2/139 28798

    T: 0 (28791) P:99 I:100 C: 25072 Min: 4 Act: 5 Avg: 6 Max: 122
    T: 1 (28792) P:98 I:150 C: 16715 Min: 4 Act: 6 Avg: 5 Max: 27
    T: 2 (28793) P:97 I:200 C: 12534 Min: 4 Act: 5 Avg: 4 Max: 8
    T: 3 (28794) P:96 I:250 C: 10028 Min: 4 Act: 5 Avg: 5 Max: 96
    T: 4 (28795) P:95 I:300 C: 8357 Min: 5 Act: 6 Avg: 5 Max: 12
    T: 5 (28796) P:94 I:350 C: 7163 Min: 5 Act: 6 Avg: 5 Max: 12
    T: 6 (28797) P:93 I:400 C: 6267 Min: 4 Act: 5 Avg: 5 Max: 9
    T: 7 (28798) P:92 I:450 C: 5571 Min: 4 Act: 5 Avg: 5 Max: 9
    ^C[ perf record: Woken up 1 times to write data ]
    [ perf record: Captured and wrote 0.108 MB perf.data (~4719 samples) ]

    [root@emilia ~]#

    This will create one extra thread per CPU:

    [root@emilia ~]# tuna -t cyclictest -CP
    thread ctxt_switches
    pid SCHED_ rtpri affinity voluntary nonvoluntary cmd
    28825 OTHER 0 0xff 2169 671 cyclictest
    28832 FIFO 93 6 52338 1 cyclictest
    28833 FIFO 92 7 46524 1 cyclictest
    28826 FIFO 99 0 209360 1 cyclictest
    28827 FIFO 98 1 139577 1 cyclictest
    28828 FIFO 97 2 104686 0 cyclictest
    28829 FIFO 96 3 83751 1 cyclictest
    28830 FIFO 95 4 69794 1 cyclictest
    28831 FIFO 94 5 59825 1 cyclictest
    [root@emilia ~]#

    So we should expect only samples for the above 9 threads when using the
    --dump-raw-trace|-D perf report switch to look at the column with the tid:

    [root@emilia ~]# perf report -D | grep RECORD_SAMPLE | cut -d/ -f2 | cut -d: -f1 | sort | uniq -c
    629 28825
    110 28826
    491 28827
    308 28828
    198 28829
    621 28830
    225 28831
    203 28832
    89 28833
    [root@emilia ~]#

    So for workloads started by 'perf record' seems to work, now for existing workloads,
    just run cyclictest first, without 'perf record':

    [root@emilia ~]# tuna -t cyclictest -CP
    thread ctxt_switches
    pid SCHED_ rtpri affinity voluntary nonvoluntary cmd
    28859 OTHER 0 0xff 594 200 cyclictest
    28864 FIFO 95 4 16587 1 cyclictest
    28865 FIFO 94 5 14219 1 cyclictest
    28866 FIFO 93 6 12443 0 cyclictest
    28867 FIFO 92 7 11062 1 cyclictest
    28860 FIFO 99 0 49779 1 cyclictest
    28861 FIFO 98 1 33190 1 cyclictest
    28862 FIFO 97 2 24895 1 cyclictest
    28863 FIFO 96 3 19918 1 cyclictest
    [root@emilia ~]#

    and then later did:

    [root@emilia ~]# perf record --pid 28859 sleep 3
    [ perf record: Woken up 1 times to write data ]
    [ perf record: Captured and wrote 0.027 MB perf.data (~1195 samples) ]
    [root@emilia ~]#

    To collect 3 seconds worth of samples for pid 28859 and its children:

    [root@emilia ~]# perf report -D | grep RECORD_SAMPLE | cut -d/ -f2 | cut -d: -f1 | sort | uniq -c
    15 28859
    33 28860
    19 28861
    13 28862
    13 28863
    10 28864
    11 28865
    9 28866
    255 28867
    [root@emilia ~]#

    Works, last thing is to check if looking at just one of those threads also works:

    [root@emilia ~]# perf record --tid 28866 sleep 3
    [ perf record: Woken up 1 times to write data ]
    [ perf record: Captured and wrote 0.006 MB perf.data (~242 samples) ]
    [root@emilia ~]# perf report -D | grep RECORD_SAMPLE | cut -d/ -f2 | cut -d: -f1 | sort | uniq -c
    3 28866
    [root@emilia ~]#

    Works too.

    Reported-by: Jeff Moyer
    Cc: David Ahern
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Jeff Moyer
    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
     

04 Feb, 2011

1 commit

  • Introduced in: c52b12ed, when this sequence:

    count[0] = count[1] = count[2] = 0;

    Was replaced with:

    aggr->val = 0;

    Which is equivalent to zeroing just the first entry in the 'count'
    array.

    Fix it by zeroing the three entries with:

    aggr->val = aggr->ena = aggr->run = 0;

    Reported-by: Ingo Molnar
    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
     

23 Jan, 2011

6 commits

  • It's enough to include the local "debug.h" file to trigger it.

    man time reveals this is already declared in glibc:

    time - get time in seconds
    -> rename the variable.

    Cc: Ingo Molnar
    Cc: arjan@infradead.org
    LPU-Reference:
    Signed-off-by: Thomas Renninger
    Signed-off-by: Arnaldo Carvalho de Melo

    Thomas Renninger
     
  • The -Wstack-protector and -Wvolatile-register-var warnings, for
    instance, are not supported by gcc 3.4.6.

    So fix by doing the same check we already do for -fstack-protector-all.

    With this and the other patches in this series, perf builds unmodified
    on, for instance, RHEL4.

    Cc: Eric Dumazet
    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
     
  • [acme@localhost linux]$ make O=~acme/git/build/perf -C tools/perf
    make: Entering directory `/home/acme/git/linux/tools/perf'
    Makefile:526: No libdw.h found or old libdw.h found or elfutils is older than 0.138, disables dwarf support. Please install new elfutils-devel/libdw-dev
    Makefile:582: newt not found, disables TUI support. Please install newt-devel or libnewt-dev
    CC /home/acme/git/build/perf/builtin-annotate.o
    In file included from builtin-annotate.c:23:
    util/parse-events.h:26: warning: declaration of 'evsel_list' shadows a global declaration
    util/parse-events.h:12: warning: shadowed declaration is here
    make: *** [/home/acme/git/build/perf/builtin-annotate.o] Error 1
    make: Leaving directory `/home/acme/git/linux/tools/perf'
    [acme@localhost linux]$ gcc --version | head -1
    gcc (GCC) 3.4.6 20060404 (Red Hat 3.4.6-11)
    [acme@localhost linux]$

    Fix it by renaming the parameter to evlist.

    Cc: Eric Dumazet
    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
     
  • We need the definiton for __always_inline in bitops.h to fix the build
    on distros where it isn't available or compiler.h doesn't get included
    indirectly.

    One of the fixes needed to build perf on RHEL4 systems, for instance.

    Cc: Eric Dumazet
    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
     
  • Using %L[uxd] has issues in some architectures, like on ppc64. Fix it
    by making our 64 bit integers typedefs of stdint.h types and using
    PRI[ux]64 like, for instance, git does.

    Reported by Denis Kirjanov that provided a patch for one case, I went
    and changed all cases.

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

    Arnaldo Carvalho de Melo
     
  • Where we don't have CPU_ALLOC & friends. As the tools are being used in older
    distros where the only allowed change are to replace the kernel, like RHEL4 and
    5.

    Reported-by: Eric Dumazet
    Cc: Eric Dumazet
    Cc: Frederic Weisbecker
    Cc: Mike Galbraith
    Cc: Peter Zijlstra
    Cc: Paul Mackerras
    Cc: Stephane Eranian
    LKML-Reference:
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     

22 Jan, 2011

2 commits

  • When some of CPUs are offline:

    # cat /sys/devices/system/cpu/online
    0,6-31

    perf test will fail on #3 testcase:

    3: detect open syscall event on all cpus:
    --- start ---
    perf_evsel__read_on_cpu: expected to intercept 111 calls on cpu 0, got 681
    perf_evsel__read_on_cpu: expected to intercept 112 calls on cpu 1, got 117
    perf_evsel__read_on_cpu: expected to intercept 113 calls on cpu 2, got 118
    perf_evsel__read_on_cpu: expected to intercept 114 calls on cpu 3, got 119
    perf_evsel__read_on_cpu: expected to intercept 115 calls on cpu 4, got 120
    perf_evsel__read_on_cpu: expected to intercept 116 calls on cpu 5, got 121
    perf_evsel__read_on_cpu: expected to intercept 117 calls on cpu 6, got 122
    perf_evsel__read_on_cpu: expected to intercept 118 calls on cpu 7, got 123
    perf_evsel__read_on_cpu: expected to intercept 119 calls on cpu 8, got 124
    perf_evsel__read_on_cpu: expected to intercept 120 calls on cpu 9, got 125
    perf_evsel__read_on_cpu: expected to intercept 121 calls on cpu 10, got 126
    ....

    This patch try to use 'cpus->map[cpu]' when setting cpu affinity, and
    will check the return code of sched_setaffinity()

    LKML-Reference:
    Signed-off-by: Han Pingtian
    Signed-off-by: Arnaldo Carvalho de Melo

    Han Pingtian
     
  • In ARM's Thumb mode the bottom bit of the symbol address is set to mark
    the function as Thumb; the instructions are in reality 2 or 4 byte on 2
    byte alignments, and when the +1 address is used in annotate it causes
    objdump to disassemble invalid instructions.

    The patch removes that bottom bit during symbol loading.

    Many thinks to Dave Martin for comments on an initial version of the
    patch.

    (For reference this corresponds to this bug
    https://bugs.launchpad.net/linux-linaro/+bug/677547 )

    Cc: Ingo Molnar
    Cc: Dave Martin
    LKML-Reference:
    Signed-off-by: Dr. David Alan Gilbert
    Signed-off-by: Arnaldo Carvalho de Melo

    Dr. David Alan Gilbert
     

19 Jan, 2011

1 commit


18 Jan, 2011

2 commits

  • It was broken by f006d25 that passed just the event name, not the complete
    sys:event that it expected to open the /sys/.../sys/sys:event/id file to get
    the id.

    Fix it by moving it to after parse_events in cmd_record, as at that point
    we can just traverse the evsel_list and use evsel->attr.config +
    event_name(evsel) instead of re-opening the /id file.

    Reported-by: Franck Bui-Huu
    Cc: Franck Bui-Huu
    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
     
  • It wasn't accounting the ':' when consuming bytes in the the event
    selector string, so parse_events() would fail in this test:

    if (!(*str == 0 || *str == ',' || isspace(*str)))
    return -1;

    as *str would be pointing to '*', the last character in the '-e' arg in:

    $ perf record -q -a -D -e sched:sched_* | perf script -i - -s perf-script.py

    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
     

16 Jan, 2011

1 commit

  • …linus' and 'perf-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip

    * 'core-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    rcu: avoid pointless blocked-task warnings
    rcu: demote SRCU_SYNCHRONIZE_DELAY from kernel-parameter status
    rtmutex: Fix comment about why new_owner can be NULL in wake_futex_pi()

    * 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    x86, olpc: Add missing Kconfig dependencies
    x86, mrst: Set correct APB timer IRQ affinity for secondary cpu
    x86: tsc: Fix calibration refinement conditionals to avoid divide by zero
    x86, ia64, acpi: Clean up x86-ism in drivers/acpi/numa.c

    * 'timers-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    timekeeping: Make local variables static
    time: Rename misnamed minsec argument of clocks_calc_mult_shift()

    * 'perf-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    tracing: Remove syscall_exit_fields
    tracing: Only process module tracepoints once
    perf record: Add "nodelay" mode, disabled by default
    perf sched: Fix list of events, dropping unsupported ':r' modifier
    Revert "perf tools: Emit clearer message for sys_perf_event_open ENOENT return"
    perf top: Fix annotate segv
    perf evsel: Fix order of event list deletion

    Linus Torvalds
     

13 Jan, 2011

4 commits

  • Sometimes there is a need to use perf in "live-log" mode. The problem
    is, for seldom events, actual info output is largely delayed because
    perf-record reads sample data in whole pages.

    So for such scenarious, add flag for perf-record to go in "nodelay"
    mode. To track e.g. what's going on in icmp_rcv while ping is running
    Use it with something like this:

    (1) $ perf probe -L icmp_rcv | grep -U8 '^ *43\>'
    goto error;
    }
    38 if (!pskb_pull(skb, sizeof(*icmph)))
    goto error;
    icmph = icmp_hdr(skb);

    43 ICMPMSGIN_INC_STATS_BH(net, icmph->type);
    /*
    * 18 is the highest 'known' ICMP type. Anything else is a mystery
    *
    * RFC 1122: 3.2.2 Unknown ICMP messages types MUST be silently
    * discarded.
    */
    50 if (icmph->type > NR_ICMP_TYPES)
    goto error;

    $ perf probe icmp_rcv:43 'type=icmph->type'

    (2) $ cat trace-icmp.py
    [...]
    def trace_begin():
    print "in trace_begin"

    def trace_end():
    print "in trace_end"

    def probe__icmp_rcv(event_name, context, common_cpu,
    common_secs, common_nsecs, common_pid, common_comm,
    __probe_ip, type):
    print_header(event_name, common_cpu, common_secs, common_nsecs,
    common_pid, common_comm)

    print "__probe_ip=%u, type=%u\n" % \
    (__probe_ip, type),
    [...]

    (3) $ perf record -a -D -e probe:icmp_rcv -o - | \
    perf script -i - -s trace-icmp.py

    Thanks to Peter Zijlstra for pointing how to do it.

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

    Kirill Smelkov
     
  • Looks to me like the :r modifier is not supported anymore, so remove it from
    the list of events.

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

    Stephane Eranian
     
  • * '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

6 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
     
  • This reverts commit aa7bc7ef73efc46d7c3a0e185eefaf85744aec98.

    It removed the fallback from hardware profiling to software profiling.
    .e.g., in a VM with no PMU.

    Reported-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: Tom Zanussi
    LKML-Reference:
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • …/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
     
  • Before we had sym_counter, it was initialized to zero and we used that
    as an index in the global attrs variable, now we have a list of evsel
    entries, and sym_counter became sym_evsel, that remained initialized to
    zero (NULL): b00m.

    Fix it by initializing it to the first entry in the evsel list.

    Bug-introduced: 69aad6f
    Reported-by: Kirill Smelkov
    Tested-by: Kirill Smelkov
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Kirill Smelkov
    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
     

11 Jan, 2011

5 commits

  • We need to defer calling perf_evsel_list__delete() till after atexit
    registered routines, because we need to traverse the events being
    recorded at that time at least on 'perf record'.

    This fixes the problem reported by Thomas Renninger where cmd_record
    called by cmd_timechart would not write the tracing data to the perf.data
    file header because the evsel_list at atexit (control+C on 'perf timechart
    record') time would be empty, being already deleted by run_builtin(),
    and thus 'perf timechart' when trying to process such perf.data file would
    die with:

    "no trace data in the file"

    Problem introduced in 70d544d.

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

    Arnaldo Carvalho de Melo
     
  • 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