08 Apr, 2011

2 commits

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

    * 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    x86-32, fpu: Fix FPU exception handling on non-SSE systems
    x86, hibernate: Initialize mmu_cr4_features during boot
    x86-32, NUMA: Fix ACPI NUMA init broken by recent x86-64 change
    x86: visws: Fixup irq overhaul fallout

    * 'sched-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    sched: Clean up rebalance_domains() load-balance interval calculation

    * 'timers-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    x86/mrst/vrtc: Fix boot crash in mrst_rtc_init()
    rtc, x86/mrst/vrtc: Fix boot crash in rtc_read_alarm()

    * 'irq-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    genirq: Fix cpumask leak in __setup_irq()

    * 'perf-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    perf probe: Fix listing incorrect line number with inline function
    perf probe: Fix to find recursively inlined function
    perf probe: Fix multiple --vars options behavior
    perf probe: Fix to remove redundant close
    perf probe: Fix to ensure function declared file

    Linus Torvalds
     
  • * 'for-linus2' of git://git.profusion.mobi/users/lucas/linux-2.6:
    Fix common misspellings

    Linus Torvalds
     

06 Apr, 2011

5 commits

  • Fix a bug showing incorrect line number when a probe is put on the head of an
    inline function. This patch updates find_perf_probe_point() and introduces new
    rules to get correct line number.

    - If debuginfo doesn't have a correct file name, we shouldn't return line
    number too, because, without file name, line number is meaningless.

    - If the address is in a function, it stores the function name and the offset
    from the function entry.

    - If the address is on a line, it tries to get the relative line number from
    the function entry line, except for the address is same as the entry
    address of the function (in this case, the relative line number should
    be 0).

    - If the address is in an inline function entry (call-site), it uses the
    inline function call line number as the line on which the address is.

    - If the address is in an inline function body, it stores the inline
    function name and offset from the inline function call site instead of the
    (non-inlined) function.

    Cc: 2nddept-manager@sdl.hitachi.co.jp
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Lin Ming
    Cc: Peter Zijlstra
    LKML-Reference:
    Signed-off-by: Masami Hiramatsu
    Signed-off-by: Arnaldo Carvalho de Melo

    Masami Hiramatsu
     
  • Fix die_find_inlinefunc() to return correct innermost inlined function
    at given address. Without this fix, it returns the outermost inlined
    function.

    Cc: 2nddept-manager@sdl.hitachi.co.jp
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Lin Ming
    Cc: Peter Zijlstra
    LKML-Reference:
    Signed-off-by: Masami Hiramatsu
    Signed-off-by: Arnaldo Carvalho de Melo

    Masami Hiramatsu
     
  • Fix a bug that perf-probe fails to initialize libdwfl and shows incorrect error
    when user gives multiple --vars options.

    Cc: 2nddept-manager@sdl.hitachi.co.jp
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Lin Ming
    Cc: Peter Zijlstra
    LKML-Reference:
    Signed-off-by: Masami Hiramatsu
    Signed-off-by: Arnaldo Carvalho de Melo

    Masami Hiramatsu
     
  • Since dwfl_end() closes given fd with dwfl, caller doesn't need to close its fd
    when finishing process.

    Cc: 2nddept-manager@sdl.hitachi.co.jp
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Lin Ming
    Cc: Peter Zijlstra
    LKML-Reference:
    Signed-off-by: Masami Hiramatsu
    Signed-off-by: Arnaldo Carvalho de Melo

    Masami Hiramatsu
     
  • Fix to ensure function declared file matches given file name. This fixes
    a potential bug.

    As I've commented on Lin Ming's fastpath enhancement, decl_file should
    be checked on each probe point if user gives a probe point as func@file.

    Cc: 2nddept-manager@sdl.hitachi.co.jp
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Lin Ming
    Cc: Peter Zijlstra
    LKML-Reference:
    Signed-off-by: Masami Hiramatsu
    Signed-off-by: Arnaldo Carvalho de Melo

    Masami Hiramatsu
     

31 Mar, 2011

2 commits

  • Fixes generated by 'codespell' and manually reviewed.

    Signed-off-by: Lucas De Marchi

    Lucas De Marchi
     
  • The default setting of perf record is to mmap 128 pages if the user
    did not override with -m.

    However the page size may vary accross different architecture
    settings, giving different default size between each.

    Moreover the kernel side still has a default max number of mlocked
    pages of 512 kiB + 1 page for unprivileged users. 128 + 1 pages
    with page size > 4096 overlaps this threshold.

    Thus, better adapt to this limitation and set the default number of
    pages to fit those 512 kiB + 1 page.

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

    Frederic Weisbecker
     

30 Mar, 2011

5 commits

  • Pick up these two commits from Arnaldo's perf/core tree:

    ca6a42586fae: perf tools: Emit clearer message for sys_perf_event_open ENOENT return
    c286c419c784: perf tools: Fixup exit path when not able to open events

    As they are really fixes we want to have sooner than laer.

    Signed-off-by: Ingo Molnar

    Ingo Molnar
     
  • Fix the following build error:

    GEN python/perf.so
    In file included from util/evsel.h:10,
    from util/python.c:6:
    util/hist.h:106:18: error: newt.h: No such file or directory
    error: command 'x86_64-pc-linux-gnu-gcc' failed with exit status 1
    make: *** [python/perf.so] Error 1

    by passing BASIC_CFLAGS to setup.py. BASIC_CFLAGS variable contains
    the -DNO_NEWT_SUPPORT switch which prevents building python c
    extension with newt.

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

    Robert Richter
     
  • If symbol_conf.priv_size is not a multiple of "sizeof(u64)" we'll bus
    error on sparc64 in symbol__new because the "struct symbol *" pointer
    is computed by adding symbol_conf.priv_size to the memory allocated.

    We cannot isolate the fix to symbol__new and symbol__delete since the
    private area is computed by subtracting the priv_size value from a
    "struct symbol" pointer, so then the private area can still be
    potentially unaligned.

    So, simply align the symbol_conf.priv_size value in symbol__init()

    Cc: Ingo Molnar
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    LKML-Reference:
    Signed-off-by: David S. Miller
    Signed-off-by: Arnaldo Carvalho de Melo

    David S. Miller
     
  • Resend of patch sent back in January 2011 in light of recent confusion around
    unsupported events for a given platform.

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

    Retry of Arnaldo's patch using ui_warning instead of die which allows the
    fallback from hardware cycles to software clock.

    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: linux-kernel@vger.kernel.org
    LKML-Reference:
    Signed-off-by: David Ahern
    [ committer note: Some adjustments to make it apply to newer codebase ]
    Signed-off-by: Arnaldo Carvalho de Melo

    David Ahern
     
  • We have to deal with the TUI mode in perf top, so that we don't end up
    with a garbled screen when, say, a non root user on a machine with a
    paranoid setting (the default) tries to use 'perf top'.

    Introduce a ui__warning_paranoid() routine shared by top and record that
    tells the user the valid values for /proc/sys/kernel/perf_event_paranoid.

    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
     

29 Mar, 2011

1 commit

  • Perf can't currently trace into the vsyscall page. It looks like it was
    meant to work.

    Tested on 2.6.38 and today's -git.

    The bug is easy to reproduce. Compile this:

    int main()
    {
    int i;
    struct timespec t;
    for(i = 0; i < 10000000; i++)
    clock_gettime(CLOCK_MONOTONIC, &t);
    return 0;
    }

    and run it through perf record; perf report. The top entry shows
    "[unknown]" and you can't zoom in.

    It looks like there are two issues. The first is a that a test for user
    mode executing in kernel space is backwards. (That's the first hunk
    below). The second (I think) is that something's wrong with the code
    that generates lots of little struct dso objects for different sections
    -- when it runs on vmlinux it results in bogus long_name values which
    cause objdump to fail.

    Cc: Ingo Molnar
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    LPU-Reference:
    Signed-off-by: Andy Lutomirski
    Signed-off-by: Arnaldo Carvalho de Melo

    Andrew Lutomirski
     

26 Mar, 2011

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, x86: Complain louder about BIOSen corrupting CPU/PMU state and continue
    perf, x86: P4 PMU - Read proper MSR register to catch unflagged overflows
    perf symbols: Look at .dynsym again if .symtab not found
    perf build-id: Add quirk to deal with perf.data file format breakage
    perf session: Pass evsel in event_ops->sample()
    perf: Better fit max unprivileged mlock pages for tools needs
    perf_events: Fix stale ->cgrp pointer in update_cgrp_time_from_cpuctx()
    perf top: Fix uninitialized 'counter' variable
    tracing: Fix set_ftrace_filter probe function display
    perf, x86: Fix Intel fixed counters base initialization

    Linus Torvalds
     

24 Mar, 2011

3 commits

  • The original intent of the code was to repeat the search with
    want_symtab = 0. But as the code stands now, we never hit the "default"
    case of the switch statement. Which means we never repeat the search.

    Tested-by: Srikar Dronamraju
    Reported-by: Arun Sharma
    Reported-by: Srikar Dronamraju
    Cc: Dave Martin
    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
     
  • The a1645ce1 changeset:

    "perf: 'perf kvm' tool for monitoring guest performance from host"

    Added a field to struct build_id_event that broke the file format.

    Since the kernel build-id is the first entry, process the table using
    the old format if the well known '[kernel.kallsyms]' string for the
    kernel build-id has the first 4 characters chopped off (where the pid_t
    sits).

    Reported-by: Han Pingtian
    Cc: Avi Kivity
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Mike Galbraith
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Cc: Tom Zanussi
    Cc: Zhang Yanmin
    Cc: stable@kernel.org
    LKML-Reference:
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • Resolving the sample->id to an evsel since the most advanced tools,
    report and annotate, and the others will too when they evolve to
    properly support multi-event perf.data files.

    Good also because it does an extra validation, checking that the ID is
    valid when present. When that is not the case, the overhead is just a
    branch + function call (perf_evlist__id2evsel).

    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 Mar, 2011

1 commit

  • builtin-top.c has an uninitialized variable.
    gcc(version 4.5.1) warns about it and it results in build failure:

    builtin-top.c: In function 'display_thread':
    builtin-top.c:518:9: error: 'counter' may be used uninitialized

    This situation can indeed trigger, if the getline() call in
    prompt_integer() fails.

    Signed-off-by: Akihiro Nagai
    Cc: Arnaldo Carvalho de Melo
    Cc: Masami Hiramatsu
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Akihiro Nagai
     

22 Mar, 2011

1 commit

  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-ktest:
    ktest: Add STOP_TEST_AFTER to stop the test after a period of time
    ktest: Monitor kernel while running of user tests
    ktest: Fix bug where the test would not end after failure
    ktest: Add BISECT_FILES to run git bisect on paths
    ktest: Add BISECT_SKIP
    ktest: Add manual bisect
    ktest: Handle kernels before make oldnoconfig
    ktest: Start failure timeout on panic too
    ktest: Print logfile name on failure

    Linus Torvalds
     

19 Mar, 2011

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: (30 commits)
    trace, filters: Initialize the match variable in process_ops() properly
    trace, documentation: Fix branch profiling location in debugfs
    oprofile, s390: Cleanups
    oprofile, s390: Remove hwsampler_files.c and merge it into init.c
    perf: Fix tear-down of inherited group events
    perf: Reorder & optimize perf_event_context to remove alignment padding on 64 bit builds
    perf: Handle stopped state with tracepoints
    perf: Fix the software events state check
    perf, powerpc: Handle events that raise an exception without overflowing
    perf, x86: Use INTEL_*_CONSTRAINT() for all PEBS event constraints
    perf, x86: Clean up SandyBridge PEBS events
    perf lock: Fix sorting by wait_min
    perf tools: Version incorrect with some versions of grep
    perf evlist: New command to list the names of events present in a perf.data file
    perf script: Add support for H/W and S/W events
    perf script: Add support for dumping symbols
    perf script: Support custom field selection for output
    perf script: Move printing of 'common' data from print_event and rename
    perf tracing: Remove print_graph_cpu and print_graph_proc from trace-event-parse
    perf script: Change process_event prototype
    ...

    Linus Torvalds
     

17 Mar, 2011

1 commit

  • * 'usb-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6: (172 commits)
    USB: Add support for SuperSpeed isoc endpoints
    xhci: Clean up cycle bit math used during stalls.
    xhci: Fix cycle bit calculation during stall handling.
    xhci: Update internal dequeue pointers after stalls.
    USB: Disable auto-suspend for USB 3.0 hubs.
    USB: Remove bogus USB_PORT_STAT_SUPER_SPEED symbol.
    xhci: Return canceled URBs immediately when host is halted.
    xhci: Fixes for suspend/resume of shared HCDs.
    xhci: Fix re-init on power loss after resume.
    xhci: Make roothub functions deal with device removal.
    xhci: Limit roothub ports to 15 USB3 & 31 USB2 ports.
    xhci: Return a USB 3.0 hub descriptor for USB3 roothub.
    xhci: Register second xHCI roothub.
    xhci: Change xhci_find_slot_id_by_port() API.
    xhci: Refactor bus suspend state into a struct.
    xhci: Index with a port array instead of PORTSC addresses.
    USB: Set usb_hcd->state and flags for shared roothubs.
    usb: Make core allocate resources per PCI-device.
    usb: Store bus type in usb_hcd, not in driver flags.
    usb: Change usb_hcd->bandwidth_mutex to a pointer.
    ...

    Linus Torvalds
     

16 Mar, 2011

5 commits

  • If lock was uncontended, wait_time_min == ULLONG_MAX, so we need to
    handle this case differently to show high wait times first

    Acked-by: Hitoshi Mitake
    Cc: Hitoshi Mitake
    Cc: Ingo Molnar
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    LKML-Reference:
    Signed-off-by: Marcin Slusarz
    Signed-off-by: Arnaldo Carvalho de Melo

    Marcin Slusarz
     
  • Some versions of grep don't treat '\s' properly. When building perf on such
    systems and using a kernel tarball the perf version is unable to be determined
    from the main kernel Makefile and the user is left with a version of '..'.
    Replacing the use of '\s' with '[[:space:]]', which should work in all grep
    versions, gives a usable version number.

    Reported-by: Tapan Dhimant
    Cc: Ingo Molnar
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Tapan Dhimant
    Cc: linux-kernel@vger.kernel.org
    Cc: stable@kernel.org
    LKML-Reference:
    Signed-off-by: Josh Hunt
    Signed-off-by: Arnaldo Carvalho de Melo

    Josh Hunt
     
  • …inux-2.6 into perf/urgent

    Ingo Molnar
     
  • …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: (184 commits)
    perf probe: Clean up probe_point_lazy_walker() return value
    tracing: Fix irqoff selftest expanding max buffer
    tracing: Align 4 byte ints together in struct tracer
    tracing: Export trace_set_clr_event()
    tracing: Explain about unstable clock on resume with ring buffer warning
    ftrace/graph: Trace function entry before updating index
    ftrace: Add .ref.text as one of the safe areas to trace
    tracing: Adjust conditional expression latency formatting.
    tracing: Fix event alignment: skb:kfree_skb
    tracing: Fix event alignment: mce:mce_record
    tracing: Fix event alignment: kvm:kvm_hv_hypercall
    tracing: Fix event alignment: module:module_request
    tracing: Fix event alignment: ftrace:context_switch and ftrace:wakeup
    tracing: Remove lock_depth from event entry
    perf header: Stop using 'self'
    perf session: Use evlist/evsel for managing perf.data attributes
    perf top: Don't let events to eat up whole header line
    perf top: Fix events overflow in top command
    ring-buffer: Remove unused #include <linux/trace_irq.h>
    tracing: Add an 'overwrite' trace_option.
    ...

    Linus Torvalds
     
  • Newer compilers (gcc 4.6) complains about:

    return ret < 0 ?: 0;

    For the following reason:

    util/probe-finder.c: In function ‘probe_point_lazy_walker’:
    util/probe-finder.c:1331:18: error: the omitted middle operand in ?: will always be ‘true’, suggest explicit middle operand [-Werror=parentheses]

    And indeed the return value is a somewhat obscure (but correct) value
    of 'true', so return 'ret' instead - this is cleaner and unconfuses
    GCC as well.

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

    Ingo Molnar
     

15 Mar, 2011

8 commits

  • [root@emilia ~]# perf record -a -e sched:* -e timer:timer* sleep 5
    [ perf record: Woken up 1 times to write data ]
    [ perf record: Captured and wrote 0.172 MB perf.data (~7530 samples) ]
    [root@emilia ~]# perf evlist
    sched:sched_kthread_stop
    sched:sched_kthread_stop_ret
    sched:sched_wakeup
    sched:sched_wakeup_new
    sched:sched_switch
    sched:sched_migrate_task
    sched:sched_process_free
    sched:sched_process_exit
    sched:sched_wait_task
    sched:sched_process_wait
    sched:sched_process_fork
    sched:sched_stat_wait
    sched:sched_stat_sleep
    sched:sched_stat_iowait
    sched:sched_stat_runtime
    sched:sched_pi_setprio
    timer:timer_init
    timer:timer_start
    timer:timer_expire_entry
    timer:timer_expire_exit
    timer:timer_cancel
    [root@emilia ~]#

    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
     
  • Custom fields set for each type by prepending field argument with type.
    For file with multiple event types (e.g., trace and S/W) display of an
    event type suppressed by setting output fields to "".

    e.g.,
    perf record -ga -e sched:sched_switch -e cpu-clock -c 10000000 -R -- sleep 1
    perf script

    openssl 11496 [000] 9711.807107: cpu-clock-msecs:
    ffffffff810c22dc arch_local_irq_restore ([kernel.kallsyms])
    ffffffff810c518c __alloc_pages_nodemask ([kernel.kallsyms])
    ffffffff810297b2 pte_alloc_one ([kernel.kallsyms])
    ffffffff810d8b98 __pte_alloc ([kernel.kallsyms])
    ffffffff810daf07 handle_mm_fault ([kernel.kallsyms])
    ffffffff8138763a do_page_fault ([kernel.kallsyms])
    ffffffff81384a65 page_fault ([kernel.kallsyms])
    7f6130507d70 asn1_check_tlen (/lib64/libcrypto.so.1.0.0c)
    0 ()

    openssl 11496 [000] 9711.808042: sched_switch: prev_comm=openssl ...
    kworker/0:0 4 [000] 9711.808067: sched_switch: prev_comm=kworker/...
    swapper 0 [001] 9711.808090: sched_switch: prev_comm=kworker/...
    sshd 11451 [001] 9711.808185: sched_switch: prev_comm=sshd pre...
    swapper 0 [001] 9711.816155: cpu-clock-msecs:
    ffffffff81023609 native_safe_halt ([kernel.kallsyms])
    ffffffff8100132a cpu_idle ([kernel.kallsyms])
    ffffffff8137cf9b start_secondary ([kernel.kallsyms])

    openssl 11496 [000] 9711.817104: cpu-clock-msecs:
    7f61304ad723 AES_cbc_encrypt (/lib64/libcrypto.so.1.0.0c)
    7fff3402f950 ()
    12f0debc9a785634 ()

    swapper 0 [001] 9711.826155: cpu-clock-msecs:
    ffffffff81023609 native_safe_halt ([kernel.kallsyms])
    ffffffff8100132a cpu_idle ([kernel.kallsyms])
    ffffffff8137cf9b start_secondary ([kernel.kallsyms])

    To suppress trace events within the file and use default output for S/W events:
    perf script -f trace:

    or to suppress S/W events and do default display for trace events:
    perf script -f sw:

    Custom field selections:
    perf script -f sw:comm,tid,time -f trace:time,trace

    openssl 11496 9711.797162:
    swapper 0 9711.807071:
    openssl 11496 9711.807107:
    9711.808042: prev_comm=openssl prev_pid=11496 prev_prio=120 prev_state=R ...
    9711.808067: prev_comm=kworker/0:0 prev_pid=4 prev_prio=120 prev_state=S ...
    9711.808090: prev_comm=kworker/0:0 prev_pid=0 prev_prio=120 prev_state=R ...
    9711.808185: prev_comm=sshd prev_pid=11451 prev_prio=120 prev_state=S ==>...
    swapper 0 9711.816155:
    openssl 11496 9711.817104:
    swapper 0 9711.826155:

    Acked-by: Frederic Weisbecker
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    LKML-Reference:
    Signed-off-by: David Ahern
    Signed-off-by: Arnaldo Carvalho de Melo

    David Ahern
     
  • Add option to dump symbols found in events.

    e.g., perf script -f comm,pid,tid,time,trace,sym

    swapper 0/0 537.037184: prev_comm=swapper prev_pid=0 prev_prio=120...
    ffffffff81030350 perf_trace_sched_switch ([kernel.kallsyms])
    ffffffff81382ac5 schedule ([kernel.kallsyms])
    ffffffff8100134a cpu_idle ([kernel.kallsyms])
    ffffffff81370b39 rest_init ([kernel.kallsyms])
    ffffffff81696c23 start_kernel ([kernel.kallsyms].init.text)
    ffffffff816962af x86_64_start_reservations ([kernel.kallsyms].init.text)
    ffffffff816963b9 x86_64_start_kernel ([kernel.kallsyms].init.text)

    sshd 1675/1675 537.037309: prev_comm=sshd prev_pid=1675 prev_prio=120...
    ffffffff81030350 perf_trace_sched_switch ([kernel.kallsyms])
    ffffffff81382ac5 schedule ([kernel.kallsyms])
    ffffffff813837aa schedule_hrtimeout_range_clock ([kernel.kallsyms])
    ffffffff81383886 schedule_hrtimeout_range ([kernel.kallsyms])
    ffffffff8110c4f9 poll_schedule_timeout ([kernel.kallsyms])
    ffffffff8110cd20 do_select ([kernel.kallsyms])
    ffffffff8110ced8 core_sys_select ([kernel.kallsyms])
    ffffffff8110d00d sys_select ([kernel.kallsyms])
    ffffffff81002bc2 system_call ([kernel.kallsyms])
    7f1647e56e93 __GI_select (/lib64/libc-2.12.90.so)

    netstat 1692/1692 537.038664: prev_comm=netstat prev_pid=1692 prev_prio=...
    ffffffff81030350 perf_trace_sched_switch ([kernel.kallsyms])
    ffffffff81382ac5 schedule ([kernel.kallsyms])
    ffffffff81002c3a sysret_careful ([kernel.kallsyms])
    7f7a6cd1b210 __GI___libc_read (/lib64/libc-2.12.90.so)

    Acked-by: Frederic Weisbecker
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    LKML-Reference:
    Signed-off-by: David Ahern
    Signed-off-by: Arnaldo Carvalho de Melo

    David Ahern
     
  • Allow a user to select which fields to print to stdout for event data.
    Options include comm (command name), tid (thread id), pid (process id),
    time (perf timestamp), cpu, event (for event name), and trace (for
    trace data).

    Default is set to maintain compatibility with current output; this
    feature does alter output format slightly -- no '-' between command
    and pid/tid.

    Thanks to Frederic Weisbecker for detailed suggestions on this approach.

    Examples (output compressed)

    1. trace, default format

    perf record -ga -e sched:sched_switch
    perf script

    swapper 0 [000] 537.037184: sched_switch: prev_comm=swapper prev_pid=0...
    sshd 1675 [000] 537.037309: sched_switch: prev_comm=sshd prev_pid=1675...
    netstat 1692 [001] 537.038664: sched_switch: prev_comm=netstat prev_pid=1692...

    2. trace, custom format

    perf record -ga -e sched:sched_switch
    perf script -f comm,pid,time,trace
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    LKML-Reference:
    Signed-off-by: David Ahern
    Signed-off-by: Arnaldo Carvalho de Melo

    David Ahern
     
  • This change does impact output: latency data is trace specific and is
    now printed after the common data - comm, tid, cpu, time and event name.

    Acked-by: Frederic Weisbecker
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    LKML-Reference:
    Signed-off-by: David Ahern
    Signed-off-by: Arnaldo Carvalho de Melo

    David Ahern
     
  • Next patch moves printing of 'common' data into perf-script which
    removes the need for these functions.

    Acked-by: Frederic Weisbecker
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    LKML-Reference:
    Signed-off-by: David Ahern
    Signed-off-by: Arnaldo Carvalho de Melo

    David Ahern
     
  • Prepare for handling of samples for any event type.

    Acked-by: Frederic Weisbecker
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    LKML-Reference:
    Signed-off-by: David Ahern
    Signed-off-by: Arnaldo Carvalho de Melo

    David Ahern
     
  • Now the --filter option is usable with perf stat too.

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

    Frederic Weisbecker
     

12 Mar, 2011

4 commits

  • While going thru each of the sym_entry fields looking to reduce it to
    the set of entries needed when in an active symbols list, 'skip' should
    really be in symbol, as we set it when loading the symtab.

    And the space used by the basic symbol allocation remains the same as
    we had 5 bytes of padding.

    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
     
  • And the DSO__ORIG_ enum to SYMTAB__, to clarify that this is about from
    where the symtab was obtained.

    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 can get it from syme->map->dso->kernel (that should be renamed to
    origin, but leave this for another patch).

    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 can get that counter index from perf_top->sym_evsel->idx instead.

    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