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


16 Aug, 2009

1 commit

  • Related to a shadowed variable bug fix Valdis Kletnieks noticed
    that perf does not get built with -Wshadow, which could have
    helped us avoid the bug.

    So enable -Wshadow and also enable the following warnings on
    perf builds, in addition to the already enabled -Wall -Wextra
    -std=gnu99 warnings:

    -Wcast-align
    -Wformat=2
    -Wshadow
    -Winit-self
    -Wpacked
    -Wredundant-decls
    -Wstack-protector
    -Wstrict-aliasing=3
    -Wswitch-default
    -Wswitch-enum
    -Wno-system-headers
    -Wundef
    -Wvolatile-register-var
    -Wwrite-strings
    -Wbad-function-cast
    -Wmissing-declarations
    -Wmissing-prototypes
    -Wnested-externs
    -Wold-style-definition
    -Wstrict-prototypes
    -Wdeclaration-after-statement

    And change/fix the perf code to build cleanly under GCC 4.3.2.

    The list of warnings enablement is rather arbitrary: it's based
    on my (quick) reading of the GCC manpages and trying them on
    perf.

    I categorized the warnings based on individually enabling them
    and looking whether they trigger something in the perf build.
    If i liked those warnings (i.e. if they trigger for something
    that arguably could be improved) i enabled the warning.

    If the warnings seemed to come from language laywers spamming
    the build with tons of nuisance warnings i generally kept them
    off. Most of the sign conversion related warnings were in
    this category. (A second patch enabling some of the sign
    warnings might be welcome - sign bugs can be nasty.)

    I also kept warnings that seem to make sense from their manpage
    description and which produced no actual warnings on our code
    base. These warnings might still be turned off if they end up
    being a nuisance.

    I also left out a few warnings that are not supported in older
    compilers.

    [ Note that these changes might break the build on older
    compilers i did not test, or on non-x86 architectures that
    produce different warnings, so more testing would be welcome. ]

    Reported-by: Valdis.Kletnieks@vt.edu
    Cc: Peter Zijlstra
    Cc: Mike Galbraith
    Cc: Paul Mackerras
    Cc: Arnaldo Carvalho de Melo
    Cc: Frederic Weisbecker
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Ingo Molnar
     

23 Jul, 2009

1 commit

  • If "/sys/kernel/debug" is not a debugfs mount point, search for the debugfs
    filesystem in /proc/mounts, but also allows the user to specify
    '--debugfs-dir=blah' or set the environment variable: 'PERF_DEBUGFS_DIR'

    Signed-off-by: Jason Baron
    [ also made it probe "/debug" by default ]
    Signed-off-by: Peter Zijlstra
    LKML-Reference:

    Jason Baron
     

01 Jul, 2009

1 commit

  • Enable -Wextra. This found a few real bugs plus a number
    of signed/unsigned type mismatches/uncleanlinesses. It
    also required a few annotations

    All things considered it was still worth it so lets try with
    this enabled for now.

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

    Ingo Molnar
     

07 Jun, 2009

1 commit