28 Mar, 2017

1 commit

  • This came from 'git', but isn't documented anywhere in
    tools/perf/Documentation/, looks like baggage we can do without, ditch
    it.

    Cc: Adrian Hunter
    Cc: David Ahern
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Cc: Wang Nan
    Link: http://lkml.kernel.org/n/tip-e7uwkn60t4hmlnwj99ba4t2s@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     

13 Jul, 2016

1 commit

  • The cache.h header doesn't use any of the definitions in some of the
    headers it includes, ditch them and fix the fallout, where files were
    getting stuff they needed just because they were including it, sometimes
    not using what it really exports at all.

    Cc: Adrian Hunter
    Cc: David Ahern
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Cc: Wang Nan
    Link: http://lkml.kernel.org/n/tip-l6r2bmj8h1g3e01wr981on0n@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     

23 Jun, 2016

1 commit

  • Lately util/config.h has been added but util/cache.h has declarations of
    functions and a global variable for config features.

    To manage codes about configuration at one spot, move them to
    util/config.h and let source files that need config features include
    config.h And if the source files that included previous cache.h need
    only config.h, remove including cache.h.

    Signed-off-by: Taeung Song
    Cc: Alexander Shishkin
    Cc: Jiri Olsa
    Cc: Masami Hiramatsu
    Cc: Namhyung Kim
    Cc: Peter Zijlstra
    Cc: Wang Nan
    Link: http://lkml.kernel.org/r/1466672119-4852-2-git-send-email-treeze.taeung@gmail.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Taeung Song
     

22 Jun, 2016

2 commits


10 May, 2016

1 commit


24 Mar, 2016

3 commits


12 Feb, 2016

1 commit

  • The '--system' option means $(sysconfdir)/perfconfig and '--user' means
    $HOME/.perfconfig. If none is used, both system and user config file are
    read. E.g.:

    # perf config [] [options]

    With an specific config file:

    # perf config --user | --system

    or both user and system config file:

    # perf config

    Signed-off-by: Taeung Song
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Link: http://lkml.kernel.org/r/1455126685-32367-2-git-send-email-treeze.taeung@gmail.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Taeung Song
     

18 Dec, 2015

1 commit

  • Move the subcommand-related files from perf to a new library named
    libsubcmd.a.

    Since we're moving files anyway, go ahead and rename 'exec_cmd.*' to
    'exec-cmd.*' to be consistent with the naming of all the other files.

    Signed-off-by: Josh Poimboeuf
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/c0a838d4c878ab17fee50998811612b2281355c1.1450193761.git.jpoimboe@redhat.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Josh Poimboeuf
     

17 Dec, 2015

2 commits

  • Create init functions for exec_cmd.c and pager.c. This allows their
    configuration to be specified at runtime so they can be split out into a
    separate library which can be used by other programs. Their
    configuration is stored in a shared subcmd_config struct.

    Signed-off-by: Josh Poimboeuf
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/21f5f6b38da72c985a8dcfa185700d03e7eecd1d.1450193761.git.jpoimboe@redhat.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Josh Poimboeuf
     
  • strlcpy() will be needed by the subcmd library. Move it to the shared
    tools/lib/string.c file which can be used by other tools.

    Signed-off-by: Josh Poimboeuf
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/71e2804b973bf39ad3d3b9be10f99f2ea630be46.1450193761.git.jpoimboe@redhat.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Josh Poimboeuf
     

14 Dec, 2015

1 commit

  • Move the 'pager' function prototypes into a new pager.h so that the
    pager code can be moved out to a library.

    Signed-off-by: Josh Poimboeuf
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/ba7c316474dd6bfc047e5c6dc4dcab39a982caf5.1449965119.git.jpoimboe@redhat.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Josh Poimboeuf
     

10 Dec, 2015

1 commit


14 May, 2015

1 commit

  • There's a bug that perf report sometimes ignore some options on --stdio
    output. This bug is triggered only if a related config variable is set.
    For example, let's assume we have a following config file.

    $ cat ~/.perfconfig
    [call-graph]
    print-type = graph
    [hist]
    percentage = absolute

    Then, following perf config will not honor some options.

    $ perf record -ag sleep 1
    [ perf record: Woken up 1 times to write data ]
    [ perf record: Captured and wrote 0.199 MB perf.data (77 samples) ]

    $ perf report -g none --stdio
    # To display the perf.data header info, please use --header/--header-only options.
    #
    # Samples: 77 of event 'cycles'
    # Event count (approx.): 25425383
    #
    # Overhead Command Shared Object Symbol
    # ........ ............... ....................... ..............
    #
    16.34% swapper [kernel.vmlinux] [k] intel_idle
    |
    ---intel_idle
    cpuidle_enter_state
    cpuidle_enter
    cpu_startup_entry
    ...

    With '-g none' option, it should not show callchains, but it still shows
    callchains. However it works as expected on --tui output.

    Similarly, '--percentage relative' option is not work and still shows a
    absolute percentage values.

    Looking at the source, I found that those setting were overwritten by
    config variables when setup_pager() called. The setup_pager() is to
    start a pager process so that it can manage long lines of output on the
    stdio mode. But as it calls the perf_config() after parsing arguments,
    the settings were overwritten regardless of command line options.

    The reason it calls perf_config() is to find the 'pager_program' which
    might be set by a config variable, I guess. However current perf code
    does not provide the config variable for it, so it's just meaningless
    IMHO. Eliminating the call makes the option working as expected.

    Signed-off-by: Namhyung Kim
    Cc: David Ahern
    Cc: Jiri Olsa
    Cc: Peter Zijlstra
    Cc: Taeung Song
    Link: http://lkml.kernel.org/r/1431529406-6762-1-git-send-email-namhyung@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Namhyung Kim
     

11 Feb, 2015

1 commit

  • As tracefs may be mounted instead of debugfs to get to the event
    directories, have perf know about tracefs, and use that file system over
    debugfs if it is present.

    Signed-off-by: Steven Rostedt
    Acked-by: Jiri Olsa
    Cc: Andrew Morton
    Cc: Ingo Molnar
    Cc: Masami Hiramatsu
    Cc: Namhyung Kim
    Link: http://lkml.kernel.org/r/20150202193553.340946602@goodmis.org
    [ Fixed up error messages about tracefs pointed out by Namhyung ]
    Signed-off-by: Arnaldo Carvalho de Melo

    Steven Rostedt (Red Hat)
     

17 Jan, 2015

1 commit

  • ----------------->8------------------
    CC bench/sched-pipe.o
    In file included from builtin-annotate.c:13:0:
    util/cache.h:76:15: warning: redundant redeclaration of 'strlcpy'
    [-Wredundant-decls]
    extern size_t strlcpy(char *dest, const char *src, size_t size);
    ^
    In file included from util/util.h:55:0,
    from builtin.h:4,
    from builtin-annotate.c:8:
    ~/vineetg/arc/gnu/INSTALL_1412-arc-2014.12-rc1/arc-snps-linux-uclibc/sysroot/usr/include/string.h:396:15:
    note: previous declaration of 'strlcpy' was here
    extern size_t strlcpy(char *__restrict dst, const char *__restrict src,
    ----------------->8------------------

    Signed-off-by: Vineet Gupta
    Cc: Alexey Brodkin
    Cc: Ingo Molnar
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1421156604-30603-3-git-send-email-vgupta@synopsys.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Vineet Gupta
     

12 Aug, 2014

1 commit

  • Adding perf_config_u64 function to be able to parse 'llong' values out
    of config file.

    Signed-off-by: Jiri Olsa
    Acked-by: David Ahern
    Cc: Corey Ashford
    Cc: David Ahern
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Jean Pihet
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/n/tip-ni6gqdlvw7khp74r9htvklkb@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Jiri Olsa
     

09 Oct, 2013

2 commits

  • The strlcpy() feature check slows every build unnecessarily - so make it
    a __weak function so it does not have to be auto-detected.

    If the libc (or any other library) has an strlcpy() implementation it will
    be used - otherwise our fallback is active.

    Cc: Arnaldo Carvalho de Melo
    Cc: Peter Zijlstra
    Cc: Namhyung Kim
    Cc: David Ahern
    Cc: Jiri Olsa
    Link: http://lkml.kernel.org/n/tip-zjbrcupapu08ePsyYhhhxiwk@git.kernel.org
    Signed-off-by: Ingo Molnar

    Ingo Molnar
     
  • Standardize all the feature flags based on the HAVE_{FEATURE}_SUPPORT naming convention:

    HAVE_ARCH_X86_64_SUPPORT
    HAVE_BACKTRACE_SUPPORT
    HAVE_CPLUS_DEMANGLE_SUPPORT
    HAVE_DWARF_SUPPORT
    HAVE_ELF_GETPHDRNUM_SUPPORT
    HAVE_GTK2_SUPPORT
    HAVE_GTK_INFO_BAR_SUPPORT
    HAVE_LIBAUDIT_SUPPORT
    HAVE_LIBELF_MMAP_SUPPORT
    HAVE_LIBELF_SUPPORT
    HAVE_LIBNUMA_SUPPORT
    HAVE_LIBUNWIND_SUPPORT
    HAVE_ON_EXIT_SUPPORT
    HAVE_PERF_REGS_SUPPORT
    HAVE_SLANG_SUPPORT
    HAVE_STRLCPY_SUPPORT

    Cc: Arnaldo Carvalho de Melo
    Cc: Peter Zijlstra
    Cc: Namhyung Kim
    Cc: David Ahern
    Cc: Jiri Olsa
    Link: http://lkml.kernel.org/n/tip-u3zvqejddfZhtrbYbfhi3spa@git.kernel.org
    Signed-off-by: Ingo Molnar

    Ingo Molnar
     

15 Nov, 2012

1 commit

  • We now have proper fallback logic, so always build it regardless of TUI
    or GTK setting.

    Signed-off-by: Namhyung Kim
    Cc: Ingo Molnar
    Cc: Pekka Enberg
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1352813436-14173-5-git-send-email-namhyung@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Namhyung Kim
     

03 Oct, 2012

3 commits

  • For similar reason of previous patches, convert NO_STRLCPY to positive
    HAVE_STRLCPY.

    Signed-off-by: Namhyung Kim
    Cc: Ingo Molnar
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1348824728-14025-13-git-send-email-namhyung@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Namhyung Kim
     
  • For building perf without gtk+2, we can set NO_GTK2=1 as a argument of
    make. It then defines NO_GTK2_SUPPORT macro for C code to do the
    proper handling. However it usually used in a negative semantics -
    e.g. #ifndef - so we saw double negations which can be misleading.
    Convert it to a positive form to make it more readable.

    Signed-off-by: Namhyung Kim
    Cc: Ingo Molnar
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1348824728-14025-8-git-send-email-namhyung@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Namhyung Kim
     
  • For building perf without libnewt, we can set NO_NEWT=1 as a argument of
    make. It then defines NO_NEWT_SUPPORT macro for C code to do the proper
    handling. However it usually used in a negative semantics - e.g. #ifndef -
    so we saw double negations which can be misleading. Convert it to a
    positive form to make it more readable.

    Signed-off-by: Namhyung Kim
    Cc: Ingo Molnar
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1348824728-14025-7-git-send-email-namhyung@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Namhyung Kim
     

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
     

03 May, 2012

4 commits

  • If gtk2 support is not enabled (or failed for some reason) try TUI again
    instead of falling directly back to the stdio interface.

    Signed-off-by: Namhyung Kim
    Acked-by: Pekka Enberg
    Cc: Ingo Molnar
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Pekka Enberg
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1335761711-31403-6-git-send-email-namhyung.kim@lge.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Namhyung Kim
     
  • Now setup_browser can handle gtk2 front-end so split the TUI code to
    ui/tui/setup.c in order to remove dependency.

    To this end, make ui__init/exit global symbols and take an argument.
    Also split gtk code to ui/gtk/setup.c.

    Signed-off-by: Namhyung Kim
    Acked-by: Pekka Enberg
    Cc: Ingo Molnar
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Pekka Enberg
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1335761711-31403-5-git-send-email-namhyung.kim@lge.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Namhyung Kim
     
  • We use double underscore characters to distinguish its subsystem and
    actual function name.

    Signed-off-by: Namhyung Kim
    Acked-by: Pekka Enberg
    Cc: Ingo Molnar
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Pekka Enberg
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1335761711-31403-4-git-send-email-namhyung.kim@lge.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Namhyung Kim
     
  • As perf doesn't allow to specify gtk command-line option, drop the
    arguments and pass NULL to gtk_init().

    This makes the function easier to be called from setup_browser().

    Signed-off-by: Namhyung Kim
    Acked-by: Pekka Enberg
    Cc: Ingo Molnar
    Cc: Namhyung Kim
    Cc: Paul Mackerras
    Cc: Pekka Enberg
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1335761711-31403-3-git-send-email-namhyung.kim@lge.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Namhyung Kim
     

20 Mar, 2012

1 commit

  • This patch adds a simple GTK2-based browser to 'perf report' that's
    based on the TTY-based browser in builtin-report.c.

    To launch "perf report" using the new GTK interface just type:

    $ perf report --gtk

    The interface is somewhat limited in features at the moment:

    - No callgraph support

    - No KVM guest profiling support

    - No color coding for percentages

    - No sorting from the UI

    - ..and many, many more!

    That said, I think this patch a reasonable start to build future features on.

    Signed-off-by: Pekka Enberg
    Cc: Colin Walters
    Cc: Peter Zijlstra
    Cc: Paul Mackerras
    Cc: Ingo Molnar
    Link: http://lkml.kernel.org/r/alpine.LFD.2.02.1202231952410.6689@tux.localdomain
    [ committer note: Added #pragma to make gtk no strict prototype problem go
    away as suggested by Colin Walters modulo avoiding push/pop ]
    Signed-off-by: Arnaldo Carvalho de Melo

    Pekka Enberg
     

01 Feb, 2011

1 commit


21 Aug, 2010

1 commit

  • Some Linux distributions like ALT Linux provides patched glibc with
    contains strlcpy(). It's confilcts with strlcpy() from perf.

    Let's add check for strlcpy().

    Cc: Peter Zijlstra
    Cc: Paul Mackerras
    Cc: Ingo Molnar
    LKML-Reference:
    Signed-off-by: Kirill A. Shutemov
    Signed-off-by: Arnaldo Carvalho de Melo

    Kirill A. Shutemov
     

05 Jun, 2010

1 commit

  • This patch adds the ability to specify an alternate directory to store the
    buildid cache (buildids, copy of binaries). By default, it is hardcoded to
    $HOME/.debug. This directory contains immutable data. The layout of the
    directory is such that no conflicts in filenames are possible. A modification
    in a file, yields a different buildid and thus a different location in the
    subdir hierarchy.

    You may want to put the buildid cache elsewhere because of disk space
    limitation or simply to share the cache between users. It is also useful for
    remote collect vs. local analysis of profiles.

    This patch adds a new config option to the perfconfig file. Under the tag
    'buildid', there is a dir option. For instance, if you have:

    $ cat /etc/perfconfig
    [buildid]
    dir = /var/cache/perf-buildid

    All buildids and binaries are be saved in the directory specified. The perf
    record, buildid-list, buildid-cache, report, annotate, and archive commands
    will it to pull information out.

    The option can be set in the system-wide perfconfig file or in the
    $HOME/.perfconfig file.

    Cc: David S. Miller
    Cc: Frédéric Weisbecker
    Cc: Ingo Molnar
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Cc: Tom Zanussi
    LKML-Reference:
    Signed-off-by: Stephane Eranian
    Signed-off-by: Arnaldo Carvalho de Melo

    Stephane Eranian
     

21 May, 2010

1 commit

  • Using the same scheme as for git's/perf's pager setup, i.e. if one
    doesn't want to, on a newt enabled perf binary, to disable the TUI for
    'perf report', its just a matter of doing:

    [root@doppio linux-2.6-tip]# printf "[tui]\n\nreport = off\n" >
    /root/.perfconfig
    [root@doppio linux-2.6-tip]# cat /root/.perfconfig
    [tui]

    report = off
    [root@doppio linux-2.6-tip]#

    System wide settings are also possible, by editing /etc/perfconfig, etc,
    i.e. the git machinery for config files applies to perf as well, so when
    in doubt where to put your settings, consult the git documentation, if
    it fails, please let us know.

    Suggested-by: Ingo Molnar
    Discussed-with: Stephane Eranian
    Cc: Frédéric 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
     

19 May, 2010

1 commit

  • Without the bloated cplus_demangle from binutils, i.e building with:

    $ make NO_DEMANGLE=1 O=~acme/git/build/perf -j3 -C tools/perf/ install

    Before:

    text data bss dec hex filename
    471851 29280 4025056 4526187 45106b /home/acme/bin/perf

    After:

    [acme@doppio linux-2.6-tip]$ size ~/bin/perf
    text data bss dec hex filename
    446886 29232 4008576 4484694 446e56 /home/acme/bin/perf

    So its a 5.3% size reduction in code, but the interesting part is in the git
    diff --stat output:

    19 files changed, 20 insertions(+), 1909 deletions(-)

    If we ever need some of the things we got from git but weren't using, we just
    have to go to the git repo and get fresh, uptodate source code bits.

    Cc: Frédéric Weisbecker
    Cc: Mike Galbraith
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Tom Zanussi
    LKML-Reference:
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     

23 Mar, 2010

1 commit


12 Mar, 2010

1 commit

  • Newt has widespread availability and provides a rather simple
    API as can be seen by the size of this patch.

    The work needed to support it will benefit other frontends too.

    In this initial patch it just checks if the output is a tty, if
    not it falls back to the previous behaviour, also if
    newt-devel/libnewt-dev is not installed the previous behaviour
    is maintaned.

    Pressing enter on a symbol will annotate it, ESC in the
    annotation window will return to the report symbol list.

    More work will be done to remove the special casing in
    color_fprintf, stop using fmemopen/FILE in the printing of
    hist_entries, etc.

    Also the annotation doesn't need to be done via spawning "perf
    annotate" and then browsing its output, we can do better by
    calling directly the builtin-annotate.c functions, that would
    then be moved to tools/perf/util/annotate.c and shared with perf
    top, etc

    But lets go by baby steps, this patch already improves perf
    usability by allowing to quickly do annotations on symbols from
    the report screen and provides a first experimentation with
    libnewt/TUI integration of tools.

    Tested on RHEL5 and Fedora12 X86_64 and on Debian PARISC64 to
    browse a perf.data file collected on a Fedora12 x86_64 box.

    Signed-off-by: Arnaldo Carvalho de Melo
    Cc: Avi Kivity
    Cc: Frédéric Weisbecker
    Cc: Mike Galbraith
    Cc: Peter Zijlstra
    Cc: Paul Mackerras
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Arnaldo Carvalho de Melo
     

13 Oct, 2009

1 commit


25 Sep, 2009

1 commit