11 Jul, 2013

1 commit

  • 765532c8 (perf script: Finish the rename from trace to script,
    2010-12-23) made a mistake during find-and-replace replacing
    "../../../util/trace-event.h" with "../../../util/script-event.h", a
    non-existent file. Fix this include.

    Signed-off-by: Ramkumar Ramachandra
    Cc: Namhyung Kim
    Link: http://lkml.kernel.org/r/1373364033-7918-3-git-send-email-artagnon@gmail.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Ramkumar Ramachandra
     

23 May, 2013

5 commits


07 Feb, 2013

1 commit

  • Fixing rwtop script race. The issue is caused by rwtop script triggering
    SIGALRM and underneath pipe reading layer reporting error when
    interrupted.

    Fixing this by setting SA_RESTART for rwtop SIGALRM handler, which
    avoids interruption of the pipe reading layer.

    The discussion for this issue & fix is here:
    https://lkml.org/lkml/2012/9/18/123

    Signed-off-by: Jiri Olsa
    Original-patch-by: Andrew Jones
    Cc: Andrew Jones
    Cc: Corey Ashford
    Cc: David Ahern
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1360080351-3246-2-git-send-email-jolsa@redhat.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Jiri Olsa
     

25 Jan, 2013

1 commit

  • The tracepoints used by the workqueue-stats script no longer exist so
    trying to run the script results in:

    # perf script record workqueue-stats
    invalid or unsupported event: 'workqueue:workqueue_creation'
    Run 'perf list' for a list of valid events

    So remove the script until it can be reworked using the new workqueue
    tracepoints.

    Signed-off-by: Tom Zanussi
    Link: http://lkml.kernel.org/r/e7a7637d5df9df86887c3bff7683574665ec5360.1358527965.git.tom.zanussi@linux.intel.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Tom Zanussi
     

18 Sep, 2012

1 commit

  • So that event_analyzing_sample.py can be shown by "perf script -l"

    Signed-off-by: Feng Tang
    Cc: Andi Kleen
    Cc: David Ahern
    Cc: Ingo Molnar
    Cc: Namhyung Kim
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1347007349-3102-4-git-send-email-feng.tang@intel.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Feng Tang
     

10 Aug, 2012

1 commit

  • Correct the checking for handler returned by PyDict_GetItemString(),
    also fix some spelling error and remove some data code in
    event_analyzing_sample.py, as suggested by Namhyung Kim.

    v2: restore back the wrongly removed trace_unhandled() func

    Signed-off-by: Feng Tang
    Acked-by: Namhyung Kim
    Cc: Andi Kleen
    Cc: David Ahern
    Cc: Ingo Molnar
    Cc: Namhyung Kim
    Cc: Peter Zijlstra
    Cc: Robert Richter
    Cc: Stephane Eranian
    Link: http://lkml.kernel.org/r/20120809134613.067104c4@feng-i7
    Signed-off-by: Arnaldo Carvalho de Melo

    Feng Tang
     

08 Aug, 2012

2 commits

  • Currently only trace point events are supported in perf/python script,
    the first 3 patches of this serie add the support for all types of
    events. This script is just a simple sample to show how to gather the
    basic information of the events and analyze them.

    This script will create one object for each event sample and insert them
    into a table in a database, then leverage the simple SQL commands to
    sort/group them. User can modify or write their brand new functions
    according to their specific requirment.

    Here is the sample of how to use the script:

    $ perf record -a tree
    $ perf script -s process_event.py

    There is 100 records in gen_events table
    Statistics about the general events grouped by thread/symbol/dso:

    comm number histgram
    ==========================================
    swapper 56 ######
    tree 20 #####
    perf 10 ####
    sshd 8 ####
    kworker/7:2 4 ###
    ksoftirqd/7 1 #
    plugin-containe 1 #

    symbol number histgram
    ==========================================================
    native_write_msr_safe 40 ######
    __lock_acquire 8 ####
    ftrace_graph_caller 4 ###
    prepare_ftrace_return 4 ###
    intel_idle 3 ##
    native_sched_clock 3 ##
    Unknown_symbol 2 ##
    do_softirq 2 ##
    lock_release 2 ##
    lock_release_holdtime 2 ##
    trace_graph_entry 2 ##
    _IO_putc 1 #
    __d_lookup_rcu 1 #
    __do_fault 1 #
    __schedule 1 #
    _raw_spin_lock 1 #
    delay_tsc 1 #
    generic_exec_single 1 #
    generic_fillattr 1 #

    dso number histgram
    ==================================================================
    [kernel.kallsyms] 95 #######
    /lib/libc-2.12.1.so 5 ###

    Signed-off-by: Feng Tang
    Cc: Andi Kleen
    Cc: David Ahern
    Cc: Ingo Molnar
    Cc: Peter Zijlstra
    Cc: Robert Richter
    Cc: Stephane Eranian
    Link: http://lkml.kernel.org/r/1344419875-21665-6-git-send-email-feng.tang@intel.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Feng Tang
     
  • This library defines several class types for perf events which could
    help to better analyze the event samples. Currently there are just a few
    classes, PerfEvent is the base class for all perf events, PebsEvent is
    a HW base Intel x86 PEBS event, and user could add more SW/HW event
    classes based on requriements.

    Signed-off-by: Feng Tang
    Cc: Andi Kleen
    Cc: David Ahern
    Cc: Ingo Molnar
    Cc: Peter Zijlstra
    Cc: Robert Richter
    Cc: Stephane Eranian
    Link: http://lkml.kernel.org/r/1344419875-21665-5-git-send-email-feng.tang@intel.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Feng Tang
     

30 Sep, 2011

1 commit

  • A while back I created the dropmonitor protocol, which allowed users to get
    reports of dropped frames communicated to them via a netlink socket.

    While useful, several people have now asked that I integrate the ability
    to do drop monitoring with perf, so they don't have to run additional
    tools.

    This patch adds a drop monitor script to the perf suite, and provides
    the same output that the netlink socket does.

    Cc: Ingo Molnar
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1309801217-22450-1-git-send-email-nhorman@tuxdriver.com
    Signed-off-by: Neil Horman
    Signed-off-by: Arnaldo Carvalho de Melo

    Neil Horman
     

25 Dec, 2010

1 commit

  • The scripts have calls to 'perf trace' that need to be converted to 'perf script', do it.

    This problem was introduced in 133dc4c.

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

    Arnaldo Carvalho de Melo
     

17 Nov, 2010

1 commit


10 Nov, 2010

1 commit


27 Oct, 2010

2 commits

  • The equivalent to this SystemTAP script:

    http://sourceware.org/systemtap/wiki/WSFutexContention

    [root@doppio ~]# perf trace futex-contention
    Press control+C to stop and show the summary
    ^Cnpviewer.bin[15242] lock 7f0a8be19104 contended 29 times, 72806 avg ns
    npviewer.bin[15242] lock 7f0a8be19130 contended 2 times, 1355 avg ns
    synergyc[17245] lock f127f4 contended 1 times, 1830569 avg ns
    firefox[15116] lock 7f2b7238af0c contended 168 times, 1230390 avg ns
    synergyc[17245] lock f2fc20 contended 1 times, 33149 avg ns
    npviewer.bin[15255] lock 7f0a8be19074 contended 155 times, 73047 avg ns
    npviewer.bin[15255] lock 7f0a8be190a0 contended 127 times, 7088 avg ns
    synergyc[17247] lock f12854 contended 1 times, 46741 avg ns
    synergyc[17245] lock f12610 contended 1 times, 7358 avg ns
    [root@doppio ~]#

    Cc: Frederic Weisbecker
    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
     

26 Oct, 2010

5 commits

  • Where we don't have the audit.MACH_ARMEB constant.

    Cc: David S. Miller
    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
     
  • . Print message at script start telling how to get te summary
    . Print the syscall names
    . Accept both pid (if numeric) or COMM name

    Now it looks like this:

    [root@emilia tmp]# perf trace syscall-counts-by-pid
    Press control+C to stop and show the summary
    ^C
    syscall events by comm/pid:

    comm [pid]/syscalls count
    ---------------------------------------- ----------

    automount [1670]
    futex 2

    sshd [2322]
    rt_sigprocmask 4
    select 2
    write 1
    read 1

    perf [15178]
    read 2506
    open 794
    close 769
    write 240
    getdents 112
    lseek 16
    stat 9
    perf_counter_open 5
    fcntl 5
    mmap 5
    statfs 2

    perf [15179]
    read 56701
    open 499
    stat 176
    fstat 149
    close 109
    mmap 98
    brk 75
    rt_sigaction 66
    munmap 42
    mprotect 24
    lstat 7
    lseek 5
    getdents 4
    ioctl 3
    readlink 2
    futex 1
    statfs 1
    getegid 1
    geteuid 1
    getgid 1
    getuid 1
    getrlimit 1
    fcntl 1
    uname 1
    write 1
    [root@emilia tmp]# fg
    -bash: fg: current: no such job
    [root@emilia tmp]# perf trace syscall-counts-by-pid 2322
    Press control+C to stop and show the summary
    ^C
    syscall events by comm/pid:

    comm [pid]/syscalls count
    ---------------------------------------- ----------

    sshd [2322]
    rt_sigprocmask 4
    select 2
    write 1
    read 1
    [root@emilia tmp]# perf trace syscall-counts-by-pid sshd
    Press control+C to stop and show the summary
    ^C
    syscall events for sshd:

    comm [pid]/syscalls count
    ---------------------------------------- ----------

    sshd [2322]
    rt_sigprocmask 4
    select 2
    write 1
    read 1
    [root@emilia tmp]#

    Cc: David S. Miller
    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
     
  • [root@emilia tmp]# perf trace sctop 1
    syscall events:

    event count
    ---------------------------------------- ----------
    read 215400
    futex 4029
    write 376
    brk 33
    rt_sigprocmask 24
    select 17
    lseek 2
    fsync 1
    ^C[root@emilia tmp]#

    Cc: David S. Miller
    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
     
  • . Print message at script start telling how to get te summary
    . Print the syscall name

    Now it looks like this:

    [root@emilia ~]# perf trace syscall-counts
    Press control+C to stop and show the summary
    ^C
    syscall events:

    event count
    ---------------------------------------- -----------
    read 102752
    open 1293
    close 878
    write 319
    stat 185
    fstat 149
    getdents 116
    mmap 98
    brk 80
    rt_sigaction 66
    munmap 42
    mprotect 24
    lseek 21
    lstat 7
    rt_sigprocmask 4
    futex 3
    statfs 3
    ioctl 3
    readlink 2
    select 2
    getegid 1
    geteuid 1
    getgid 1
    getuid 1
    getrlimit 1
    fcntl 1
    uname 1
    [root@emilia ~]#

    Cc: David S. Miller
    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
     
  • . Print message at script start telling how to get te summary
    . Print the syscall name using the audit-lib-python package, if
    installed
    . Print the errno string
    . Accept both pid (if numeric) or COMM name

    Now it looks like this:

    [root@emilia ~]# perf trace failed-syscalls-by-pid
    Press control+C to stop and show the summary
    ^C
    syscall errors:

    comm [pid] count
    ------------------------------ ----------

    automount [1670]
    syscall: futex
    err = ETIMEDOUT 39

    irqbalance [1462]
    syscall: openat
    err = ENOENT 4

    perf [7888]
    syscall: lseek
    err = ESPIPE 1
    syscall: open
    err = ENOENT 24

    perf [7889]
    syscall: ioctl
    err = EINVAL 1
    syscall: readlink
    err = EINVAL 2
    syscall: open
    err = ENOENT 389
    syscall: stat
    err = ENOENT 141
    syscall: lseek
    err = ESPIPE 3
    [root@emilia ~]#

    [root@emilia ~]# perf trace failed-syscalls-by-pid 1670
    Press control+C to stop and show the summary
    ^C
    syscall errors:

    comm [pid] count
    ------------------------------ ----------

    automount [1670]
    syscall: futex
    err = ETIMEDOUT 2
    [root@emilia ~]#
    [root@emilia ~]#
    [root@emilia ~]#
    [root@emilia ~]# perf trace failed-syscalls-by-pid automount
    Press control+C to stop and show the summary
    ^C
    syscall errors for automount:

    comm [pid] count
    ------------------------------ ----------

    automount [1669]
    syscall: futex
    err = ETIMEDOUT 1

    automount [1670]
    syscall: futex
    err = ETIMEDOUT 5
    [root@emilia ~]#

    Cc: David S. Miller
    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
     

24 Oct, 2010

1 commit


08 Sep, 2010

1 commit

  • Add a perf script which shows packets processing and processed
    time. It helps us to investigate networking or network devices.

    If you want to use it, install perf and record perf.data like
    following.

    If you set script, perf gathers records until it ends.
    If not, you must Ctrl-C to stop recording.

    And if you want a report from record,

    If you use some options, you can limit the output.
    Option is below.

    tx: show only tx packets processing
    rx: show only rx packets processing
    dev=: show processing on this device
    debug: work with debug mode. It shows buffer status.

    For example, if you want to show received packets processing
    associated with eth4,

    106133.171439sec cpu=0
    irq_entry(+0.000msec irq=24:eth4)
    |
    softirq_entry(+0.006msec)
    |
    |---netif_receive_skb(+0.010msec skb=f2d15900 len=100)
    | |
    | skb_copy_datagram_iovec(+0.039msec 10291::10291)
    |
    napi_poll_exit(+0.022msec eth4)

    This perf script helps us to analyze the processing time of a
    transmit/receive sequence.

    Signed-off-by: Koki Sanagi
    Acked-by: David S. Miller
    Cc: Neil Horman
    Cc: Mathieu Desnoyers
    Cc: Kaneshige Kenji
    Cc: Izumo Taku
    Cc: Kosaki Motohiro
    Cc: Lai Jiangshan
    Cc: Scott Mcmillan
    Cc: Steven Rostedt
    Cc: Eric Dumazet
    Cc: Tom Zanussi
    LKML-Reference:
    Signed-off-by: Frederic Weisbecker

    Koki Sanagi
     

02 Aug, 2010

9 commits

  • Librarize the task state and event headers helpers as they can
    be generally useful.

    Signed-off-by: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Peter Zijlstra
    Cc: Arnaldo Carvalho de Melo
    Cc: Paul Mackerras
    Cc: Nikhil Rao
    Cc: Tom Zanussi

    Frederic Weisbecker
     
  • Export the GUI facility in the common library path. It is
    going to be useful for other scheduler views.

    Signed-off-by: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Peter Zijlstra
    Cc: Arnaldo Carvalho de Melo
    Cc: Paul Mackerras
    Cc: Nikhil Rao
    Cc: Tom Zanussi

    Frederic Weisbecker
     
  • Make the perf migration GUI generic so that it can be reused for
    other kinds of trace painting. No more notion of CPUs or runqueue
    from the GUI class, it's now used as a library by the trace parser.

    Signed-off-by: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Peter Zijlstra
    Cc: Arnaldo Carvalho de Melo
    Cc: Paul Mackerras
    Cc: Nikhil Rao
    Cc: Tom Zanussi

    Frederic Weisbecker
     
  • With scheduler traces covering more than two cpus, rectangles
    of the CPUs 3 and more are not visibles.

    This makes the vertical navigation scrollable so that all of the
    CPUs rectangles are available.

    We also want to be able to zoom vertically, so that we can fit at
    best the screen with CPU rectangles, but that's for later.

    Signed-off-by: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Peter Zijlstra
    Cc: Arnaldo Carvalho de Melo
    Cc: Paul Mackerras
    Cc: Nikhil Rao
    Cc: Tom Zanussi

    Frederic Weisbecker
     
  • Without vertical zoom, it is not possible to see all CPUs in a trace
    taken on a larger machine. This patch parameterizes the height and
    spacing of CPUs so that you can fit more cpus into the screen.

    Ideally we should dynamically size/space the CPU rectangles with some
    minimum threshold. Until then, this patch is a stop-gap.

    Signed-off-by: Nikhil Rao
    Cc: Ingo Molnar
    Cc: Peter Zijlstra
    Cc: Arnaldo Carvalho de Melo
    Cc: Paul Mackerras
    Cc: Tom Zanussi
    Signed-off-by: Frederic Weisbecker

    Nikhil Rao
     
  • EVT_KEY_DOWN and EVT_LEFT_DOWN events are not bound to the RootFrame
    event handler. As a result, zoom/scroll via keyboard events do not
    work. This patch adds the missing bindings.

    Signed-off-by: Nikhil Rao
    Cc: Ingo Molnar
    Cc: Peter Zijlstra
    Cc: Arnaldo Carvalho de Melo
    Cc: Paul Mackerras
    Cc: Tom Zanussi
    Signed-off-by: Frederic Weisbecker

    Nikhil Rao
     
  • Stop printing an error message when we don't have the letter
    for a given task state. All we need to know is if the task is
    in the TASK_RUNNING state.

    Signed-off-by: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Peter Zijlstra
    Cc: Arnaldo Carvalho de Melo
    Cc: Paul Mackerras
    Cc: Nikhil Rao
    Cc: Tom Zanussi

    Frederic Weisbecker
     
  • Migrate out events may happen on tasks that are not in the
    runqueue, for example this is the case for tasks that are
    sleeping. In this case, we don't want to log the migrate out
    event in the source runqueue because the task is not eventually
    in the runqueue and we have already logged its sleep event.

    This fixes timeslices that spuriously propagate a sleep event
    from the previous timeslice.

    Signed-off-by: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Peter Zijlstra
    Cc: Arnaldo Carvalho de Melo
    Cc: Paul Mackerras
    Cc: Nikhil Rao
    Cc: Tom Zanussi

    Frederic Weisbecker
     
  • This brings a GUI tool that displays an overview of the load
    of tasks proportion in each CPUs.

    The CPUs forward progress is cut in timeslices. A new timeslice
    is created for every runqueue event: a task gets pushed out or
    pulled in the runqueue.

    For each timeslice, every CPUs rectangle is colored with a red
    power that describes the local load against the total load.
    This more red is the rectangle, the higher is the given CPU load.
    This load is the number of tasks running on the CPU, without
    any distinction against the scheduler policy of the tasks, for
    now.

    Also for each timeslice, the event origin is depicted on the
    CPUs that triggered it using a thin colored line on top of the
    rectangle timeslice.

    These events are:

    * sleep: a task went to sleep and has then been pulled out the
    runqueue. The origin color in the thin line is dark blue.

    * wake up: a task woke up and has then been pushed in the
    runqueue. The origin color is yellow.

    * wake up new: a new task woke up and has then been pushed in the
    runqueue. The origin color is green.

    * migrate in: a task migrated in the runqueue due to a load
    balancing operation. The origin color is violet.

    * migrate out: reverse of the previous one. Migrate in events
    usually have paired migrate out events in another runqueue.
    The origin color is light blue.

    Clicking on a timeslice provides the runqueue event details
    and the runqueue state.

    The CPU rectangles can be navigated using the usual arrow
    controls. Horizontal zooming in/out is possible with the
    "+" and "-" buttons.

    Signed-off-by: Frederic Weisbecker
    Cc: Peter Zijlstra
    Cc: Arnaldo Carvalho de Melo
    Cc: Li Zefan
    Cc: Steven Rostedt
    Cc: Tom Zanussi
    Cc: Mike Galbraith
    Cc: Venkatesh Pallipadi
    Cc: Pierre Tardy
    Cc: Nikhil Rao
    Cc: Li Zefan

    Frederic Weisbecker
     

01 Jun, 2010

1 commit

  • trace_unhandled() callback does not allow to access event fields, this patch
    resolves the problem.

    It can also been used as a more pythonic and flexible way for script writters
    to demux event types

    This will for example greatly simplify pytimechart event demux.

    Acked-by: Frederic Weisbecker
    Acked-by: Tom Zanussi
    Cc: Ingo Molnar ,
    Cc: Frederic Weisbecker
    Cc: Tom Zanussi
    LKML-Reference:
    Signed-off-by: Pierre Tardy
    Signed-off-by: Arnaldo Carvalho de Melo

    Pierre Tardy
     

11 May, 2010

5 commits