29 Oct, 2012

2 commits

  • As suggested by Arnaldo, many scripts have their own usages and need
    capture specific events or tracepoints, so only those scripts whose
    target events match the events in current perf data file should be
    listed in the script browser menu.

    This patch will add the event match checking, by opening "xxx-record"
    script to cherry pick out all events name and comparing them with
    those inside the perf data file.

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

    Feng Tang
     
  • Currently many perf commands annotate/evlist/report/script/lock etc all
    support "-i" option to chose a specific perf data, and all of them
    create a local "input_name" to save the file name for that perf data.

    Since most of these commands need it, we can add a global variable for
    it, also it can some other benefits:

    1. When calling script browser inside hists/annotation browser, it needs
    to know the perf data file name to run that script.

    2. For further feature like runtime switching to another perf data file,
    this variable can also help.

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

    Feng Tang
     

07 Oct, 2012

1 commit

  • When we were processing a PERF_RECORD_EXIT event we first used
    machine__findnew_thread for both the thread exiting and for its parent,
    only to use just the thread struct associated with the one exiting, and
    to just delete it.

    If it existed, i.e. not created at this very moment in
    machine__findnew_thread, it will be moved to the machine->dead_threads
    linked list, because we may have hist_entries pointing to it, but if it
    was created just do be deleted, it will just sit there with no
    references at all.

    Use the new machine__find_thread() method so that if it is not there, we
    don't create it.

    As a bonus the parent thread will also not be created at this point.

    Create process_fork() and process_exit() helpers to use this and make
    the builtins use it instead of the generic process_task(), ditched by
    this patch.

    Cc: David Ahern
    Cc: Frederic Weisbecker
    Cc: Jiri Olsa
    Cc: Mike Galbraith
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Link: http://lkml.kernel.org/n/tip-z7n2y98ebjyrvmytaope4vdl@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     

03 Oct, 2012

1 commit

  • Some variables were global but used in just one function, so move it to
    where it belongs.

    Cc: David Ahern
    Cc: Frederic Weisbecker
    Cc: Jiri Olsa
    Cc: Mike Galbraith
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Link: http://lkml.kernel.org/n/tip-eukt8bzp4t2n2z3s8ue5ofwb@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     

18 Sep, 2012

2 commits

  • So that other perf commands/browser has a way to dig out the available
    scripts info in system, this is a preparation for the script browser.

    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-5-git-send-email-feng.tang@intel.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Feng Tang
     
  • Since perf script no longer only handle the trace points, we can add the
    symbol filter option so that scripts can handle specified samples.

    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-3-git-send-email-feng.tang@intel.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Feng Tang
     

11 Sep, 2012

1 commit

  • perf defines both __used and __unused variables to use for marking
    unused variables. The variable __used is defined to
    __attribute__((__unused__)), which contradicts the kernel definition to
    __attribute__((__used__)) for new gcc versions. On Android, __used is
    also defined in system headers and this leads to warnings like: warning:
    '__used__' attribute ignored

    __unused is not defined in the kernel and is not a standard definition.
    If __unused is included everywhere instead of __used, this leads to
    conflicts with glibc headers, since glibc has a variables with this name
    in its headers.

    The best approach is to use __maybe_unused, the definition used in the
    kernel for __attribute__((unused)). In this way there is only one
    definition in perf sources (instead of 2 definitions that point to the
    same thing: __used and __unused) and it works on both Linux and Android.
    This patch simply replaces all instances of __used and __unused with
    __maybe_unused.

    Signed-off-by: Irina Tirdea
    Acked-by: Pekka Enberg
    Cc: David Ahern
    Cc: Ingo Molnar
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Steven Rostedt
    Link: http://lkml.kernel.org/r/1347315303-29906-7-git-send-email-irina.tirdea@intel.com
    [ committer note: fixed up conflict with a116e05 in builtin-sched.c ]
    Signed-off-by: Arnaldo Carvalho de Melo

    Irina Tirdea
     

06 Sep, 2012

1 commit

  • Allows perf to clean up properly on exit. Only exits left are exec
    failures which are appropriate and usage callbacks that list available
    options.

    Signed-off-by: David Ahern
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1346005487-62961-7-git-send-email-dsahern@gmail.com
    Signed-off-by: Arnaldo Carvalho de Melo

    David Ahern
     

12 Aug, 2012

1 commit

  • This brings the support for DWARF cfi unwinding on perf post
    processing. Call frame informations are retrieved and then passed
    to libunwind that requests memory and register content from the
    applications.

    Adding unwind object to handle the user stack backtrace based
    on the user register values and user stack dump.

    The unwind object access the libunwind via remote interface
    and provides to it all the necessary data to unwind the stack.

    The unwind interface provides following function:
    unwind__get_entries

    And callback (specified in above function) to retrieve
    the backtrace entries:
    typedef int (*unwind_entry_cb_t)(struct unwind_entry *entry,
    void *arg);

    Signed-off-by: Jiri Olsa
    Original-patch-by: Frederic Weisbecker
    Cc: "Frank Ch. Eigler"
    Cc: Arun Sharma
    Cc: Benjamin Redelings
    Cc: Corey Ashford
    Cc: Cyrill Gorcunov
    Cc: Frank Ch. Eigler
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Masami Hiramatsu
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Robert Richter
    Cc: Stephane Eranian
    Cc: Tom Zanussi
    Cc: Ulrich Drepper
    Link: http://lkml.kernel.org/r/1344345647-11536-12-git-send-email-jolsa@redhat.com
    [ Replaced use of perf_session by usage of perf_evsel ]
    Signed-off-by: Arnaldo Carvalho de Melo

    Jiri Olsa
     

08 Aug, 2012

3 commits

  • …for "process_event()"

    Both perl and python script start processing events other than trace
    points, and it's useful to pass the resolved symbol and the dso info to
    the event handler in script for better analysis and statistics.

    Struct thread is already a member of struct addr_location, using
    addr_location will keep the thread info, while providing additional
    symbol and dso info if exist, so that the script itself doesn't need to
    bother to do the symbol resolving and dso searching work.

    Tested-by: David Ahern <dsahern@gmail.com>
    Signed-off-by: Feng Tang <feng.tang@intel.com>
    Acked-by: David Ahern <dsahern@gmail.com>
    Cc: Andi Kleen <andi@firstfloor.org>
    Cc: David Ahern <dsahern@gmail.com>
    Cc: Ingo Molnar <mingo@elte.hu>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Robert Richter <robert.richter@amd.com>
    Cc: Stephane Eranian <eranian@google.com>
    Link: http://lkml.kernel.org/r/1344419875-21665-3-git-send-email-feng.tang@intel.com
    Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

    Feng Tang
     
  • We can get all that is needed using just event_format, that is available
    via evsel->tp_format now.

    Cc: David Ahern
    Cc: Frederic Weisbecker
    Cc: Jiri Olsa
    Cc: Mike Galbraith
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Link: http://lkml.kernel.org/n/tip-2hsr1686epa9f0vx4yg7z2zj@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • We already lookup the associated event_format when reading the perf.data
    header, so that we can cache the tracepoint name in evsel->name, so do
    it a little further and save the event_format itself, so that we can
    avoid relookups in tools that need to access it.

    Change the tools to take the most obvious advantage, when they were
    using pevent_find_event directly. More work is needed for further
    removing the need of a pointer to pevent, such as when asking for event
    field values ("common_pid" and the other common fields and per
    event_format fields).

    This is something that was planned but only got actually done when
    Andrey Wagin needed to do this lookup at perf_tool->sample() time, when
    we don't have access to pevent (session->pevent) to use with
    pevent_find_event().

    Cc: Andrey Wagin
    Cc: David Ahern
    Cc: Frederic Weisbecker
    Cc: Jiri Olsa
    Cc: Mike Galbraith
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Signed-off-by: Arnaldo Carvalho de Melo
    Link: http://lkml.kernel.org/n/tip-txkvew2ckko0b594ae8fbnyk@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     

28 Jun, 2012

1 commit

  • The pevent thing is per perf.data file, so I made it stop being static
    and become a perf_session member, so tools processing perf.data files
    use perf_session and _there_ we read the trace events description into
    session->pevent and then change everywhere to stop using that single
    global pevent variable and use the per session one.

    Note that it _doesn't_ fall backs to trace__event_id, as we're not
    interested at all in what is present in the
    /sys/kernel/debug/tracing/events in the workstation doing the analysis,
    just in what is in the perf.data file.

    This patch also introduces perf_session__set_tracepoints_handlers that
    is the perf perf.data/session way to associate handlers to tracepoint
    events by resolving their IDs using the events descriptions stored in a
    perf.data file. Make 'perf sched' use it.

    Reported-by: Dmitry Antipov
    Tested-by: Dmitry Antipov
    Cc: Frederic Weisbecker
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: linaro-dev@lists.linaro.org
    Cc: patches@linaro.org
    Link: http://lkml.kernel.org/r/20120625232016.GA28525@infradead.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     

20 Jun, 2012

2 commits

  • Removing unused evsel parameter from machine__resolve_callchain
    function. Plus related header file and callers changes.

    The evsel parameter is unused since following commit:
    perf callchain: Make callchain cursors TLS
    commit 472606458f3e1ced5fe3cc5f04e90a6b5a4732cf
    Author: Namhyung Kim
    Date: Thu May 31 14:43:26 2012 +0900

    Signed-off-by: Jiri Olsa
    Cc: Arun Sharma
    Cc: Benjamin Redelings
    Cc: Corey Ashford
    Cc: Cyrill Gorcunov
    Cc: Frank Ch. Eigler
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Masami Hiramatsu
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Robert Richter
    Cc: Stephane Eranian
    Cc: Tom Zanussi
    Cc: Ulrich Drepper
    Link: http://lkml.kernel.org/r/1339420814-7379-9-git-send-email-jolsa@redhat.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Jiri Olsa
     
  • No logic change, just remove one more user of __event_name().

    Cc: David Ahern
    Cc: Frederic Weisbecker
    Cc: Jiri Olsa
    Cc: Mike Galbraith
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Link: http://lkml.kernel.org/n/tip-e4f0vuy3283hmzfjjvkgm7fo@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     

25 Apr, 2012

1 commit

  • The event parsing code in perf was originally copied from trace-cmd
    but never was kept up-to-date with the changes that was done there.
    The trace-cmd libtraceevent.a code is much more mature than what is
    currently in perf.

    This updates the code to use wrappers to handle the calls to the
    new event parsing code. The new code requires a handle to be pass
    around, which removes the global event variables and allows
    more than one event structure to be read from different files
    (and different machines).

    But perf still has the old global events and the code throughout
    perf does not yet have a nice way to pass around a handle.
    A global 'pevent' has been made for perf and the old calls have
    been created as wrappers to the new event parsing code that uses
    the global pevent.

    With this change, perf can later incorporate the pevent handle into
    the perf structures and allow more than one file to be read and
    compared, that contains different events.

    Signed-off-by: Steven Rostedt
    Cc: Ingo Molnar
    Cc: Thomas Gleixner
    Cc: Peter Zijlstra
    Cc: Arnaldo Carvalho de Melo
    Cc: Steven Rostedt
    Cc: Borislav Petkov
    Cc: Jiri Olsa
    Cc: Arun Sharma
    Cc: Namhyung Kim
    Signed-off-by: Frederic Weisbecker

    Steven Rostedt
     

31 Jan, 2012

4 commits

  • Add the option get the path of [kernel.kallsyms].
    Specify '--show-kernel-path' option to use this function.
    This patch enables other applications to use this output easily.

    Without --show-kernel-path option

    ffffffff81467612 irq_return ([kernel.kallsyms])
    ffffffff81467612 irq_return ([kernel.kallsyms])
    7f24fc02a6b3 _start (/lib64/ld-2.14.so)
    [snip]

    With --show-kernel-path option

    ffffffff81467612 irq_return (/lib/modules/3.2.0+/build/vmlinux)
    ffffffff81467612 irq_return (/lib/modules/3.2.0+/build/vmlinux)
    7f24fc02a6b3 _start (/lib64/ld-2.14.so)
    [snip]

    Cc: David Ahern
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Masami Hiramatsu
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: yrl.pp-manager.tt@hitachi.com
    Link: http://lkml.kernel.org/r/20120130044320.2384.73322.stgit@linux3
    Signed-off-by: Akihiro Nagai
    Signed-off-by: Arnaldo Carvalho de Melo

    Akihiro Nagai
     
  • Add the offset field specifier 'symoff' to show the offset from
    the symbols in the output of perf-script. We can get the more
    detailed address information.

    Output sample:
    ffffffff81467612 irq_return+0x0 => 301ec016b0 _start+0x0
    ffffffff81467612 irq_return+0x0 => 301ec016b0 _start+0x0
    301ec016b3 _start+0x3 => 301ec04b70 _dl_start+0x0
    ffffffff81467612 irq_return+0x0 => 301ec04b70 _dl_start+0x0
    ffffffff81467612 irq_return+0x0 => 301ec04b96 _dl_start+0x26
    ffffffff81467612 irq_return+0x0 => 301ec04b9d _dl_start+0x2d
    301ec04beb _dl_start+0x7b => 301ec04c0d _dl_start+0x9d
    301ec04c11 _dl_start+0xa1 => 301ec04bf0 _dl_start+0x80
    [snip]

    Cc: David Ahern
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Masami Hiramatsu
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: yrl.pp-manager.tt@hitachi.com
    Link: http://lkml.kernel.org/r/20120130044314.2384.67094.stgit@linux3
    Signed-off-by: Akihiro Nagai
    Signed-off-by: Arnaldo Carvalho de Melo

    Akihiro Nagai
     
  • BTS records branch_from_addr and branch_to_addr in IP and ADDR field in perf_sample.
    This patch enables to print them in following format,

    () => ()

    Sample:
    ffffffff814675d2 irq_return ([kernel.kallsyms]) => 3f03e016b0 _start (/lib64/ld-2.14.so)
    ffffffff814675d2 irq_return ([kernel.kallsyms]) => 3f03e016b0 _start (/lib64/ld-2.14.so)
    3f03e016b3 _start (/lib64/ld-2.14.so) => 3f03e04b80 _dl_start (/lib64/ld-2.14.so)
    ffffffff814675d2 irq_return ([kernel.kallsyms]) => 3f03e04b80 _dl_start (/lib64/ld-2.14.so)
    ffffffff814675d2 irq_return ([kernel.kallsyms]) => 3f03e04ba6 _dl_start (/lib64/ld-2.14.so)
    ffffffff814675d2 irq_return ([kernel.kallsyms]) => 3f03e04bad _dl_start (/lib64/ld-2.14.so)
    3f03e04bfb _dl_start (/lib64/ld-2.14.so) => 3f03e04c1d _dl_start (/lib64/ld-2.14.so)
    [snip]

    Cc: David Ahern
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Masami Hiramatsu
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: yrl.pp-manager.tt@hitachi.com
    Link: http://lkml.kernel.org/r/20120130044309.2384.44252.stgit@linux3
    Signed-off-by: Akihiro Nagai
    Signed-off-by: Arnaldo Carvalho de Melo

    Akihiro Nagai
     
  • The perf script command uses various expressions to indicate "unknown".

    It is unfriendly for user scripts to parse it. So, this patch unifies
    the expressions to "[unknown]".

    Cc: David Ahern
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Masami Hiramatsu
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: yrl.pp-manager.tt@hitachi.com
    Link: http://lkml.kernel.org/r/20120130044257.2384.62905.stgit@linux3
    Signed-off-by: Akihiro Nagai
    Signed-off-by: Arnaldo Carvalho de Melo

    Akihiro Nagai
     

08 Jan, 2012

1 commit

  • The get_script_path() calls opendir() but misses corresponding
    closedir()'s. Add them.

    Cc: Ingo Molnar
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1325957132-10600-1-git-send-email-namhyung@gmail.com
    Signed-off-by: Namhyung Kim
    Signed-off-by: Arnaldo Carvalho de Melo

    Namhyung Kim
     

04 Jan, 2012

1 commit

  • As script_spec__delete() frees given struct script_spec it should not be
    called if we failed to allocate the struct. Also it's the only caller of
    the function, we can get rid of the function itself.

    Cc: Ingo Molnar
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1325000151-4463-4-git-send-email-namhyung@gmail.com
    Signed-off-by: Namhyung Kim
    Signed-off-by: Arnaldo Carvalho de Melo

    Namhyung Kim
     

24 Dec, 2011

2 commits

  • The default input file for perf report is not handled the same way as
    perf record does it for its output file. This leads to unexpected
    behavior of perf report, etc. E.g.:

    # perf record -a -e cpu-cycles sleep 2 | perf report | cat
    failed to open perf.data: No such file or directory (try 'perf record' first)

    While perf record writes to a fifo, perf report expects perf.data to be
    read. This patch changes this to accept fifos as input file.

    Applies to the following commands:

    perf annotate
    perf buildid-list
    perf evlist
    perf kmem
    perf lock
    perf report
    perf sched
    perf script
    perf timechart

    Also fixes char const* -> const char* type declaration for filename
    strings.

    v2:
    * Prevent potential null pointer access to input_name in
    builtin-report.c. Needed due to removal of patch "perf report: Setup
    browser if stdout is a pipe"

    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Link: http://lkml.kernel.org/r/1323248577-11268-5-git-send-email-robert.richter@amd.com
    Signed-off-by: Robert Richter
    Signed-off-by: Arnaldo Carvalho de Melo

    Robert Richter
     
  • This allows the thread name to be dispalyed when dumping
    events:
    myapp 25118 [000] 450385.538815: context-switches ...
    myapp:worker 25119 [000] 450385.538894: context-switches ...

    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1324578603-12762-4-git-send-email-dsahern@gmail.com
    Signed-off-by: David Ahern
    Signed-off-by: Arnaldo Carvalho de Melo

    David Ahern
     

12 Dec, 2011

2 commits

  • The option is documented in man perf-script but was not yet implemented:

    -a
    Force system-wide collection. Scripts run without a
    normally use -a by default, while scripts run
    with a normally don't - this option allows the
    latter to be run in system-wide mode.

    As with perf record you now can profile in system-wide mode for the
    runtime of a given command, e.g.:

    # perf script -a syscall-counts sleep 2

    Cc: Ingo Molnar
    Link: http://lkml.kernel.org/r/1322229925-10075-1-git-send-email-robert.richter@amd.com
    Signed-off-by: Robert Richter
    Signed-off-by: Arnaldo Carvalho de Melo

    Robert Richter
     
  • Fix mem leaks and missing NULL pointer checks after strdup().

    And get_script_path() did not free __script_root in case of continue.

    Introduce a helper function get_script_root().

    Cc: Ingo Molnar
    Link: http://lkml.kernel.org/r/1322217520-3287-1-git-send-email-robert.richter@amd.com
    Signed-off-by: Robert Richter
    Signed-off-by: Arnaldo Carvalho de Melo

    Robert Richter
     

28 Nov, 2011

6 commits

  • Allows collecting events system wide and then pulling out events for a
    specific task name(s). e.g,

    perf script -c gnome-shell,gnome-terminal

    Applies on top of:
    https://lkml.org/lkml/2011/11/13/74

    v2->v3
    - update Documentation

    v1->v2
    - use comm_list from symbol_conf

    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1321894972-24246-1-git-send-email-dsahern@gmail.com
    Signed-off-by: David Ahern
    Signed-off-by: Arnaldo Carvalho de Melo

    David Ahern
     
  • Currently the meaning of -C varies by perf command: for perf-top,
    perf-stat, perf-record it means cpu list. For perf-report it means comm
    list. Then perf-annotate, perf-report and perf-script use -c for cpu
    list.

    Fix annotate, report and script to use -C for cpu list to be consistent
    with top, stat and record. This means report needs to use -c for comm
    list which does introduce a backward compatibility change.

    v1 -> v2
    - update perf-script.txt too

    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1321209008-7004-1-git-send-email-dsahern@gmail.com
    Signed-off-by: David Ahern
    Signed-off-by: Arnaldo Carvalho de Melo

    David Ahern
     
  • To better reflect that it became the base class for all tools, that must
    be in each tool struct and where common stuff will be put.

    Cc: David Ahern
    Cc: Frederic Weisbecker
    Cc: Mike Galbraith
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Link: http://lkml.kernel.org/n/tip-qgpc4msetqlwr8y2k7537cxe@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • Reducing the exposure of perf_session further, so that we can use the
    classes in cases where no perf.data file is created.

    Cc: David Ahern
    Cc: Frederic Weisbecker
    Cc: Mike Galbraith
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Link: http://lkml.kernel.org/n/tip-stua66dcscsezzrcdugvbmvd@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • So that we don't need to have that many globals.

    Next steps will remove the 'session' pointer, that in most cases is
    not needed.

    Then we can rename perf_event_ops to 'perf_tool' that better describes
    this class hierarchy.

    Cc: David Ahern
    Cc: Frederic Weisbecker
    Cc: Mike Galbraith
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Link: http://lkml.kernel.org/n/tip-wp4djox7x6w1i2bab1pt4xxp@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • Since we have it in evsel->hists.callchain_cursor, remove it from
    perf_session.

    One more step in disentangling several places from requiring a
    perf_session pointer.

    Cc: David Ahern
    Cc: Frederic Weisbecker
    Cc: Mike Galbraith
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Link: http://lkml.kernel.org/n/tip-rxr5dj3di7ckyfmnz0naku1z@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     

08 Oct, 2011

1 commit

  • The goal of this patch is to include more information about the host
    environment into the perf.data so it is more self-descriptive. Overtime,
    profiles are captured on various machines and it becomes hard to track
    what was recorded, on what machine and when.

    This patch provides a way to solve this by extending the perf.data file
    with basic information about the host machine. To add those extensions,
    we leverage the feature bits capabilities of the perf.data format. The
    change is backward compatible with existing perf.data files.

    We define the following useful new extensions:
    - HEADER_HOSTNAME: the hostname
    - HEADER_OSRELEASE: the kernel release number
    - HEADER_ARCH: the hw architecture
    - HEADER_CPUDESC: generic CPU description
    - HEADER_NRCPUS: number of online/avail cpus
    - HEADER_CMDLINE: perf command line
    - HEADER_VERSION: perf version
    - HEADER_TOPOLOGY: cpu topology
    - HEADER_EVENT_DESC: full event description (attrs)
    - HEADER_CPUID: easy-to-parse low level CPU identication

    The small granularity for the entries is to make it easier to extend
    without breaking backward compatiblity. Many entries are provided as
    ASCII strings.

    Perf report/script have been modified to print the basic information as
    easy-to-parse ASCII strings. Extended information about CPU and NUMA
    topology may be requested with the -I option.

    Thanks to David Ahern for reviewing and testing the many versions of
    this patch.

    $ perf report --stdio
    # ========
    # captured on : Mon Sep 26 15:22:14 2011
    # hostname : quad
    # os release : 3.1.0-rc4-tip
    # perf version : 3.1.0-rc4
    # arch : x86_64
    # nrcpus online : 4
    # nrcpus avail : 4
    # cpudesc : Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz
    # cpuid : GenuineIntel,6,15,11
    # total memory : 8105360 kB
    # cmdline : /home/eranian/perfmon/official/tip/build/tools/perf/perf record date
    # event : name = cycles, type = 0, config = 0x0, config1 = 0x0, config2 = 0x0, excl_usr = 0, excl_kern = 0, id = { 29, 30, 31,
    # HEADER_CPU_TOPOLOGY info available, use -I to display
    # HEADER_NUMA_TOPOLOGY info available, use -I to display
    # ========
    #
    ...

    $ perf report --stdio -I
    # ========
    # captured on : Mon Sep 26 15:22:14 2011
    # hostname : quad
    # os release : 3.1.0-rc4-tip
    # perf version : 3.1.0-rc4
    # arch : x86_64
    # nrcpus online : 4
    # nrcpus avail : 4
    # cpudesc : Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz
    # cpuid : GenuineIntel,6,15,11
    # total memory : 8105360 kB
    # cmdline : /home/eranian/perfmon/official/tip/build/tools/perf/perf record date
    # event : name = cycles, type = 0, config = 0x0, config1 = 0x0, config2 = 0x0, excl_usr = 0, excl_kern = 0, id = { 29, 30, 31,
    # sibling cores : 0-3
    # sibling threads : 0
    # sibling threads : 1
    # sibling threads : 2
    # sibling threads : 3
    # node0 meminfo : total = 8320608 kB, free = 7571024 kB
    # node0 cpu list : 0-3
    # ========
    #
    ...

    Reviewed-by: David Ahern
    Tested-by: David Ahern
    Cc: David Ahern
    Cc: Ingo Molnar
    Cc: Peter Zijlstra
    Cc: Robert Richter
    Cc: Andi Kleen
    Link: http://lkml.kernel.org/r/20110930134040.GA5575@quad
    Signed-off-by: Stephane Eranian
    [ committer notes: Use --show-info in the tools as was in the docs, rename
    perf_header_fprintf_info to perf_file_section__fprintf_info, fixup
    conflict with f69b64f7 "perf: Support setting the disassembler style" ]
    Signed-off-by: Arnaldo Carvalho de Melo

    Stephane Eranian
     

05 Jul, 2011

1 commit

  • Add an option to perf report/annotate/script to specify which
    CPUs to operate on. This enables us to take a single system wide
    profile and analyse each CPU (or group of CPUs) in isolation.

    This was useful when profiling a multiprocess workload where the
    bottleneck was on one CPU but this was hidden in the overall
    profile. Per process and per thread breakdowns didn't help
    because multiple processes were running on each CPU and no
    single process consumed an entire CPU.

    The patch converts the list of CPUs returned by cpu_map__new
    into a bitmap for fast lookup. I wanted to use -C to be
    consistent with perf top/record/stat, but unfortunately perf
    report already uses -C .

    v2: Incorporate suggestions from David Ahern:
    - Added -c to perf script
    - Check that SAMPLE_CPU is set when -c is used
    - Update documentation

    v3: Create perf_session__cpu_bitmap()

    Signed-off-by: Anton Blanchard
    Acked-by: David Ahern
    Cc: Arnaldo Carvalho de Melo
    Cc: Peter Zijlstra
    Cc: Paul Mackerras
    Link: http://lkml.kernel.org/r/20110704215750.11647eb9@kryten
    Signed-off-by: Ingo Molnar

    Anton Blanchard
     

03 Jun, 2011

3 commits

  • Resolve to a function or variable if possible and if the sym option is
    enabled.

    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Link: http://lkml.kernel.org/r/1306782503-22002-1-git-send-email-dsahern@gmail.com
    Signed-off-by: David Ahern
    Signed-off-by: Arnaldo Carvalho de Melo

    David Ahern
     
  • The 'sym' option displays both the function name and the DSO it comes
    from. Split the display of the dso into a separate option. This allows
    display of the ip address and symbol without the dso, thus shortening
    line lengths - and decluttering the output a bit.

    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Link: http://lkml.kernel.org/r/1306528124-25861-3-git-send-email-dsahern@gmail.com
    Signed-off-by: David Ahern
    Signed-off-by: Arnaldo Carvalho de Melo

    David Ahern
     
  • Currently the "sym" output field is used to dump instruction pointers
    and callchain stack. Sample addresses can also be converted to symbols,
    so the meaning of "sym" needs to be fixed. This patch adds an "ip"
    option and if it is selected the user can also opt to dump symbols for
    them. If the user opts to dump IP without syms only the address is
    shown.

    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Link: http://lkml.kernel.org/r/1306528124-25861-2-git-send-email-dsahern@gmail.com
    Signed-off-by: David Ahern
    Signed-off-by: Arnaldo Carvalho de Melo

    David Ahern
     

26 May, 2011

1 commit

  • Signed-off-by: Jesper Juhl
    Cc: Tom Zanussi
    Cc: Arnaldo Carvalho de Melo
    Cc: trivial@kernel.org
    Cc: Peter Zijlstra
    Cc: Paul Mackerras
    Link: http://lkml.kernel.org/r/alpine.LNX.2.00.1105261011290.17400@swampdragon.chaosbits.net
    Signed-off-by: Ingo Molnar

    Jesper Juhl
     

20 Apr, 2011

1 commit

  • Check for required sample attributes using evsel rather than sample_type
    in the session header. If the attribute for a default field is not
    present for the event type (e.g., new command operating on file from
    older kernel) the field is removed from the output list.

    Expected event types must exist. For example, if a user specifies

    -f trace:time,trace -f sw:time,cpu,sym

    the perf.data file must contain both tracepoints and software events
    (ie., it is an error if either does not exist in the file).

    Attribute checking is done once at the beginning of perf-script rather
    than for each sample.

    v1 -> v2:
    - addressed comments from acme

    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1302148460-570-1-git-send-email-daahern@cisco.com
    Signed-off-by: David Ahern
    Signed-off-by: Arnaldo Carvalho de Melo

    David Ahern
     

19 Apr, 2011

1 commit

  • Useful for getting stack traces for hardware events not handled by
    PERF_TYPE_HARDWARE.

    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Mike Galbraith
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Cc: Thomas Gleixner
    Cc: Tom Zanussi
    Signed-off-by: Arun Sharma
    Link: http://lkml.kernel.org/n/tip-qimdcdpekjqxuyqovy4kjusx@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arun Sharma