28 Nov, 2011

1 commit

  • 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
     

21 Oct, 2011

1 commit


08 Oct, 2011

1 commit

  • This actually fixes several problems we had in the old 'perf top':

    1. Unresolved symbols not show, limitation that came from the old
    "KernelTop" codebase, to solve it we would need to do changes
    that would make sym_entry have most of the hist_entry fields.
    2. It was using the number of samples, not the sum of sample->period.

    And brings the --sort code that allows us to have all the views in
    'perf report', for instance:

    [root@emilia ~]# perf top --sort dso
    PerfTop: 5903 irqs/sec kernel:77.5% exact: 0.0% [1000Hz cycles], (all, 8 CPUs)
    ------------------------------------------------------------------------------

    31.59% libcrypto.so.1.0.0
    21.55% [kernel]
    18.57% libpython2.6.so.1.0
    7.04% libc-2.12.so
    6.99% _backend_agg.so
    4.72% sshd
    1.48% multiarray.so
    1.39% libfreetype.so.6.3.22
    1.37% perf
    0.71% libgobject-2.0.so.0.2200.5
    0.53% [tg3]
    0.48% libglib-2.0.so.0.2200.5
    0.44% libstdc++.so.6.0.13
    0.40% libcairo.so.2.10800.8
    0.38% libm-2.12.so
    0.34% umath.so
    0.30% libgdk-x11-2.0.so.0.1800.9
    0.22% libpthread-2.12.so
    0.20% libgtk-x11-2.0.so.0.1800.9
    0.20% librt-2.12.so
    0.15% _path.so
    0.13% libpango-1.0.so.0.2800.1
    0.11% libatlas.so.3.0
    0.09% ft2font.so
    0.09% libpangoft2-1.0.so.0.2800.1
    0.08% libX11.so.6.3.0
    0.07% [vdso]
    0.06% cyclictest
    ^C

    All the filter lists can be used as well: --dsos, --comms, --symbols,
    etc.

    The 'perf report' TUI is also reused, being possible to apply all the
    zoom operations, do annotation, etc.

    This change will allow multiple simplifications in the symbol system as
    well, that will be detailed in upcoming changesets.

    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-xzaaldxq7zhqrrxdxjifk1mh@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     

24 Sep, 2011

1 commit

  • GCC often introduces new warnings with lots of false positives -
    breaking -Werror builds. WERROR=0 allows one to build perf without much
    fuss - while still encouraging people to send patches to avoid the fuss
    of having to type WERROR=0.

    Bisecting back to commits that produce a (mostly harmless) warning on
    some compilers is more difficult. With WERROR=0 one could bisect without
    worrying about harmless warnings.

    Cc: Ingo Molnar
    Link: http://lkml.kernel.org/r/eac06c7cc4920e5d4830417d466161fb26c7359c.1315514559.git.dvhart@linux.intel.com
    Signed-off-by: Darren Hart
    Signed-off-by: Arnaldo Carvalho de Melo

    Darren Hart
     

09 Aug, 2011

1 commit


08 Aug, 2011

2 commits

  • Adding install-python_ext target to install python extension related
    files. Installation directory is governed by python distutils package
    and follows the DESTDIR variable settings.

    Also moving python extension build output into '$(O)python_ext_build'
    directory and making it configurable via PYTHON_EXTBUILD variable.

    Keeping the '$(O)python/perf.so' file, so it could be used for testing
    as of until now.

    Cc: Ingo Molnar
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/20110722113307.GA1931@jolsa.brq.redhat.com
    Signed-off-by: Jiri Olsa
    Signed-off-by: Arnaldo Carvalho de Melo

    Jiri Olsa
     
  • Use LIB_OBJS and BUILTIN_OBJS for .o files.

    LIB_FILE is already prefixed with OUTPUT.

    Cc: Ingo Molnar
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/20110807083932.9C0E514C03B@msa103.auone-net.jp
    Signed-off-by: Kusanagi Kouichi
    Signed-off-by: Arnaldo Carvalho de Melo

    Kusanagi Kouichi
     

24 Jul, 2011

1 commit

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

    * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    um: Make rwsem.S depend on CONFIG_RWSEM_XCHGADD_ALGORITHM

    * 'core-debug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    debug: Make CONFIG_EXPERT select CONFIG_DEBUG_KERNEL to unhide debug options

    * 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    genirq: Remove unused CHECK_IRQ_PER_CPU()

    * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    perf tools, x86: Fix 32-bit compile on 64-bit system

    Linus Torvalds
     

21 Jul, 2011

1 commit

  • Builds for 32-bit perf binaries on a 64-bit host currently fail
    with this error:

    [...]
    bench/../../../arch/x86/lib/memcpy_64.S: Assembler messages:
    bench/../../../arch/x86/lib/memcpy_64.S:29: Error: bad register name `%rdi'
    bench/../../../arch/x86/lib/memcpy_64.S:34: Error: invalid instruction suffix for `movs'
    bench/../../../arch/x86/lib/memcpy_64.S:50: Error: bad register name `%rdi'
    bench/../../../arch/x86/lib/memcpy_64.S:61: Error: bad register name `%rdi'
    ...

    The problem is the detection of the host arch without considering passed in
    flags. This change fixes 32-bit builds via:

    make EXTRA_CFLAGS=-m32

    and 64-bit builds still reference the memcpy_64.S.

    Signed-off-by: David Ahern
    Acked-by: Frederic Weisbecker
    Signed-off-by: Peter Zijlstra
    Cc:
    Link: http://lkml.kernel.org/r/1310420304-21452-1-git-send-email-dsahern@gmail.com
    Signed-off-by: Ingo Molnar

    David Ahern
     

16 Jul, 2011

1 commit

  • Move dwarf library related routines to dwarf-aux.{c,h}.
    This includes several minor changes.
    - Add simple documents for each API.
    - Rename die_find_real_subprogram() to die_find_realfunc()
    - Rename line_walk_handler_t to line_walk_callback_t.
    - Minor cleanups.

    Signed-off-by: Masami Hiramatsu
    Cc: Peter Zijlstra
    Cc: Frederic Weisbecker
    Cc: Paul Mackerras
    Cc: Ingo Molnar
    Cc: Arnaldo Carvalho de Melo
    Link: http://lkml.kernel.org/r/20110627072727.6528.57647.stgit@fedora15
    Signed-off-by: Steven Rostedt

    Masami Hiramatsu
     

16 Jun, 2011

1 commit

  • To build a statically linked version of the perf tool all needed
    libraries must be added in the correct order to get the symbols
    resolved. Currently this is broken when, e.g. python or newt
    support is enabled -- libpython needs libpthread which is an
    unconditional link dependency of the perf tool; libslang needs
    libm, another unconditional dependency. To solve the problem in
    the long run without the need to keep track of transitive
    library dependencies, simply make the linker look at the EXTLIBS
    multiple times until it has all symbols resolved.

    Signed-off-by: Mathias Krause
    Cc: Peter Zijlstra
    Cc: Paul Mackerras
    Cc: Arnaldo Carvalho de Melo
    Link: http://lkml.kernel.org/r/1308171818-20370-1-git-send-email-minipli@googlemail.com
    Signed-off-by: Ingo Molnar

    Mathias Krause
     

26 May, 2011

1 commit

  • Where /usr/include/linux/const.h is not present, e.g. RHEL5.

    Reported-by: Srikar Dronamraju
    Cc: Srikar Dronamraju
    Cc: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: Mike Galbraith
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Cc: Tom Zanussi
    Link: http://lkml.kernel.org/n/tip-ypcw2mu0w7dl1rrc6ncz3pee@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     

10 May, 2011

1 commit


07 May, 2011

1 commit

  • The original Makefile uses "uname -m" to determine ARCH.
    This causes problem on x86 when compile perf tool on 32 bit
    userspace with a 64 bit kernel.

    bench/../../../arch/x86/lib/memcpy_64.S: Assembler messages:
    bench/../../../arch/x86/lib/memcpy_64.S:28: Error: bad register name `%rdi'

    This is because "uname -m" returns x86_64 and memcpy_64.S is
    included in 32 bit build.

    Reported-by: Riccardo Magliocchetti
    Signed-off-by: Lin Ming
    Cc: Peter Zijlstra
    Cc: Arnaldo Carvalho de Melo
    Link: http://lkml.kernel.org/r/1304743274.3132.17.camel@localhost
    Signed-off-by: Ingo Molnar

    Lin Ming
     

19 Apr, 2011

3 commits

  • Signed-off-by: Michael Witten
    Link: http://lkml.kernel.org/n/tip-a6zhefjayuounko1tk5sjji2@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Michael Witten
     
  • Currently, Python 3 is not supported by perf's code; this
    can cause the build to fail for systems that have Python 3
    installed as the default python:

    python{,-config}

    The Correct Solution is to write compatibility code so that
    Python 3 works out-of-the-box.

    However, users often have an ancillary Python 2 installed:

    python2{,-config}

    Therefore, a quick fix is to allow the user to specify those
    ancillary paths as the python binaries that Makefile should
    use, thereby avoiding Python 3 altogether; as an added benefit,
    the Python binaries may be installed in non-standard locations
    without the need for updating any PATH variable.

    This commit adds the ability to set PYTHON and/or PYTHON_CONFIG
    either as environment variables or as make variables on the
    command line; the paths may be relative, and usually only PYTHON
    is necessary in order for PYTHON_CONFIG to be defined implicitly.
    Some rudimentary error checking is performed when the user
    explicitly specifies a value for any of these variables.

    In addition, this commit introduces significantly robust makefile
    infrastructure for working with paths and communicating with the
    shell; it's currently only used for handling Python, but I hope
    it will prove useful in refactoring the makefiles.

    Thanks to:

    Raghavendra D Prabhu

    for motivating this patch.

    Acked-by: Raghavendra D Prabhu
    Link: http://lkml.kernel.org/r/e987828e-87ec-4973-95e7-47f10f5d9bab-mfwitten@gmail.com
    Signed-off-by: Michael Witten
    Signed-off-by: Arnaldo Carvalho de Melo

    Michael Witten
     
  • There is no need for a subshell or an explicit `export';
    as per the POSIX Shell Command Language specification:

    http://pubs.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#tag_02_09_01
    http://pubs.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#tag_02_10_02

    It is only necessary to include the environment variable
    assignment just before the command to be run.

    Also, it is better to use single-quotes, because GNU make
    might expand `$(BASIC_CFLAGS)' into something that the shell
    could interpret within double-quotes.

    Acked-by: Raghavendra D Prabhu
    Link: http://lkml.kernel.org/n/tip-58n38o02ocuzrm9qh096hsf5@git.kernel.org
    Signed-off-by: Michael Witten
    Signed-off-by: Arnaldo Carvalho de Melo

    Michael Witten
     

30 Mar, 2011

1 commit

  • Fix the following build error:

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

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

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

    Robert Richter
     

15 Mar, 2011

1 commit

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

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

    Arnaldo Carvalho de Melo
     

18 Feb, 2011

4 commits

  • This commit squashes several commits that remove:

    unnecessary uname calls
    `sh -c'
    BUILT_INS and QUIET_BUILT_IN

    They have no effect, and the `fixup-builtins' and `check-builtins.sh'
    scripts don't even exist.

    RUNTIME_PREFIX

    It's currently never anything but unset, and it's apparently
    only meaningful when Microsoft Windows is the operating system
    (according to the source for git).

    TEST_PROGRAMS
    EXTRA_PROGRAMS
    unused SHELL_PATH_SQ portions
    unused test for V=2
    useless exports

    Only when `V' is undefined (that is, only when the value of `V'
    is empty) is `export V' performed, which just has the effect of
    placing the empty-valued variable `V' in the environment.

    The only other script to make use of `V' is `Documentation/Makefile',
    which only checks whether `V' is undefined (that is, whether the value
    of `V' is empty); hence, the `export V' has no effect whatsoever.

    Similarly, `export QUIET_GEN' is useless because it will only have
    a non-empty value when `V' has an empty-value, and when `V' has
    an empty-value, `QUIET_GEN' is always explicitly set in every
    script in which it is used.

    `DESTDIR' is only ever defined by the user via the environment
    or the command line, both of which are automatically exported
    to sub-make processes. Furthermore, no non-make sub-scripts
    make use of `DESTDIR' as an environment variable.

    No other scripts use `perfexec_instdir'.

    unused QUIET_SUBDIR{0,1}
    TAR and RPMBUILD
    PTHREAD_LIBS
    Maintainer's dist rules and commands
    distclean target
    Test suite coverage testing
    PRINT_DIR and NO_SUBDIR
    `configure' target
    NO_CURL
    @@PERF_VERSION@@ substitution

    Without the sed command, all of the rule's commands can be reduced
    to a single line that copies a file and sets the permissions properly
    in the process.

    `make test' echo line
    template_instdir
    PERF-BUILD-OPTIONS
    double-colon rules

    The use of double-colon rules seems misguided or vestigial git.

    Essentially hard-coded $(SCRIPTS) expansion

    Signed-off-by: Michael Witten
    LKML-Reference:
    Signed-off-by: Arnaldo Carvalho de Melo

    Michael Witten
     
  • This commit squashes several commits that remove:

    NO_C99_FORMAT
    CURLDIR and EXPATDIR
    NO_DEFLATE_BOUND
    CC_LD_DYNPATH and NO_R_TO_GCC_LINKER
    NO_PERL_MAKEMAKER
    INTERNAL_QSORT
    NO_EXTERNAL_GREP
    NO_PERL
    SCRIPT_PERL
    PERL_PATH_SQ

    Signed-off-by: Michael Witten
    LKML-Reference:
    Signed-off-by: Arnaldo Carvalho de Melo

    Michael Witten
     
  • While it makes sense that this tool could be used on
    other platforms at least to parse data, there doesn't
    appear to be any real support for such usage.

    This commit squashes several commits that remove:

    SNPRINTF_RETURNS_BOGUS
    FREAD_READS_DIRECTORIES
    NO_D_{INO,TYPE}_IN_DIRENT
    NO_STRCASESTR
    NO_MEMMEM
    NO_STRTOUMAX and NO_STRTOULL
    NO_SETENV
    NO_UNSETENV
    NO_MKDTEMP
    NEEDS_LIBICONV
    NEEDS_SOCKET
    NO_MMAP
    NO_PTHREADS
    NO_PREAD
    NO_TRUSTABLE_FILEMODE
    NO_IPV6 and NO_SOCKADDR_STORAGE
    NO_ICONV and OLD_ICONV
    NO_NSEC, USE_NSEC, and USE_ST_TIMESPEC
    NO_ST_BLOCKS_IN_STRUCT_STAT
    NO_FINK and NO_DARWIN_PORTS
    NO_SYS_SELECT_H
    NO_HSTRERROR
    DIR_HAS_BSD_GROUP_SEMANTICS and FORCE_DIR_SET_GID
    NEEDS_NSL, NO_UINTMAX_T, NO_INET_{N,P}TON
    COMPAT_{CFLAGS,OBJS}
    Executable extension `X'

    Signed-off-by: Michael Witten
    LKML-Reference:
    Signed-off-by: Arnaldo Carvalho de Melo

    Michael Witten
     
  • This commit squashes several commits that remove:

    NO_SYMLINK_HEAD
    NO_SVN_TESTS
    NO_FAST_WORKING_DIRECTORY
    USE_STDEV
    SHA1/SSL cruft
    makefile rules

    Signed-off-by: Michael Witten
    LKML-Reference:
    Signed-off-by: Arnaldo Carvalho de Melo

    Michael Witten
     

17 Feb, 2011

2 commits

  • The perf makefile is nicely complete except for

    a) an uninstall option
    b) a 'make help' description

    This patch implements b)
    it also comments out other non-working makefile targets

    Signed-off-by: Jesse Brandeburg
    LKML-Reference:
    Signed-off-by: Arnaldo Carvalho de Melo

    Jesse Brandeburg
     
  • The ui operations so far were used by just one thread, but 'perf top
    --tui' now has two threads updating the screen, so we need to use a
    mutex to avoid garbling the screen.

    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
     

16 Feb, 2011

1 commit

  • This patch adds the ability to filter monitoring based on container groups
    (cgroups) for both perf stat and perf record. It is possible to monitor
    multiple cgroup in parallel. There is one cgroup per event. The cgroups to
    monitor are passed via a new -G option followed by a comma separated list of
    cgroup names.

    The cgroup filesystem has to be mounted. Given a cgroup name, the perf tool
    finds the corresponding directory in the cgroup filesystem and opens it. It
    then passes that file descriptor to the kernel.

    Example:

    $ perf stat -B -a -e cycles:u,cycles:u,cycles:u -G test1,,test2 -- sleep 1
    Performance counter stats for 'sleep 1':

    2,368,667,414 cycles test1
    2,369,661,459 cycles
    cycles test2

    1.001856890 seconds time elapsed

    Signed-off-by: Stephane Eranian
    Signed-off-by: Peter Zijlstra
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Stephane Eranian
     

07 Feb, 2011

1 commit

  • So that we get this:

    CC /home/acme/git/build/perf/bench/mem-memcpy-x86-64-asm.o
    GEN perf-archive
    * GEN /home/acme/git/build/perf/python/perf.so
    CC /home/acme/git/build/perf/builtin-annotate.o

    Instead of silently building the python binding.

    LKML-Reference:
    Signed-off-by: Michael Witten
    Signed-off-by: Arnaldo Carvalho de Melo

    Michael Witten
     

05 Feb, 2011

1 commit

  • They will be used by perf top, so that we have just one set of routines
    to do annotation.

    Rename "struct sym_priv" to "struct annotation", etc, to clarify this
    code a bit.

    Rename "struct sym_ext" to "struct source_line", to give it a meaningful
    name, that clarifies that it is a the result of an addr2line call, that
    is sorted by percentage one particular source code line appeared in the
    annotation.

    And since we're moving things around also rename 'sym_hist->ip' to
    'sym_hist->addr' as we want to do data structure annotation at some
    point.

    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
     

02 Feb, 2011

3 commits

  • Just leverage the test done for python support in 'python script',
    emitting a warning about losing those features if python-dev[el] is not
    installed.

    Reported-by: Peter Zijlstra
    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
     
  • It wasn't using $(OUTPUT) to rm *.o and there were some funny looking
    automake files that never get created but were being deleted anyway.

    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
     
  • Also now it builds it in a well known location:

    [acme@felicio linux]$ rm -rf ../build/perf/
    [acme@felicio linux]$ mkdir ../build/perf
    [acme@felicio linux]$ make -j2 O=~acme/git/build/perf -C tools/perf/

    [acme@felicio linux]$ ls -la ../build/perf/python/
    total 152
    -rwxrwxr-x 1 acme acme 147957 Feb 1 14:56 perf.so
    drwxrwxr-x 3 acme acme 17 Feb 1 14:56 temp
    [acme@felicio linux]$

    [root@felicio ~]# strip ~acme/git/build/perf/python/perf.so
    [root@felicio ~]# ls -la ~acme/git/build/perf/python/perf.so
    -rwxrwxr-x 1 acme acme 46264 Feb 1 14:58 /home/acme/git/build/perf/python/perf.so

    [root@felicio ~]# export PYTHONPATH=~acme/git/build/perf/python/
    [root@felicio ~]# ~acme/git/linux/tools/perf/python/twatch.py
    cpu: 0, pid: 7751, tid: 7751 { type: exit, pid: 7751, ppid: 7751, tid: 7751, ptid: 7751, time: 54562393512356}
    cpu: 0, pid: 13700, tid: 13700 { type: fork, pid: 7756, ppid: 13700, tid: 7756, ptid: 13700, time: 54562393746739}
    cpu: 1, pid: 7756, tid: 7756 { type: fork, pid: 7757, ppid: 7756, tid: 7757, ptid: 7756, time: 54562394246152}
    cpu: 1, pid: 7757, tid: 7757 { type: comm, pid: 7757, tid: 7757, comm: awk }
    cpu: 1, pid: 7757, tid: 7757 { type: exit, pid: 7757, ppid: 7757, tid: 7757, ptid: 7757, time: 54562395456813}

    Reported-by: Ingo Molnar
    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
     

01 Feb, 2011

2 commits

  • Disabled by default as there are features found in the stdio based one
    that aren't implemented, like live annotation, filtering knobs data
    entry.

    Annotation hopefully will get somehow merged with the 'perf annotate'
    code.

    To use it:

    perf top --tui

    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
     
  • Paving the way for a slang browser a la 'perf report --tui'.

    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
     

30 Jan, 2011

1 commit

  • First clarifying that this kind of binding is not a replacement or an
    equivalent to the 'perf script' way of using python with perf.

    The 'perf script' way is to process events and look at a given script
    for some python function that matches the events to pass each event for
    processing.

    This is a python module, i.e. everything is driven from the python
    script, that merely uses "import perf" or "from perf import".

    perf script is focused on tracepoints, this binding is focused on profiling as
    an initial target. More work is needed to make available tracepoint specific
    variables as event variables accessible via this binding.

    There is one example of such usage model, in
    tools/perf/python/twatch.py, a tool to watch "cycles" events together
    with task (fork, exit) and comm perf events.

    For now, due to me not being able to grok how python distutils cope with
    building C extensions outside the sources dir the install target just
    builds it, I'm using it as:

    [root@emilia linux]# export PYTHONPATH=~acme/git/build/perf/lib.linux-x86_64-2.6/
    [root@emilia linux]# tools/perf/python/twatch.py
    cpu: 4, pid: 30126, tid: 30126 { type: mmap, pid: 30126, tid: 30126, start: 0x4, length: 0x82e9ca03, offset: 0, filename: }
    cpu: 6, pid: 47, tid: 47 { type: mmap, pid: 47, tid: 47, start: 0x6, length: 0xbef87c36, offset: 0, filename: }
    cpu: 1, pid: 0, tid: 0 { type: mmap, pid: 0, tid: 0, start: 0x1, length: 0x775d1904, offset: 0, filename: }
    cpu: 7, pid: 0, tid: 0 { type: mmap, pid: 0, tid: 0, start: 0x7, length: 0xc750aeb6, offset: 0, filename: }
    cpu: 5, pid: 2255, tid: 2255 { type: mmap, pid: 2255, tid: 2255, start: 0x5, length: 0x76669635, offset: 0, filename: }
    cpu: 0, pid: 0, tid: 0 { type: mmap, pid: 0, tid: 0, start: 0, length: 0x6422ef6b, offset: 0, filename: }
    cpu: 2, pid: 2255, tid: 2255 { type: mmap, pid: 2255, tid: 2255, start: 0x2, length: 0xe078757a, offset: 0, filename: }
    cpu: 1, pid: 5769, tid: 5769 { type: fork, pid: 30127, ppid: 5769, tid: 30127, ptid: 5769, time: 103893991270534}
    cpu: 6, pid: 30127, tid: 30127 { type: comm, pid: 30127, tid: 30127, comm: ls }
    cpu: 6, pid: 30127, tid: 30127 { type: exit, pid: 30127, ppid: 30127, tid: 30127, ptid: 30127, time: 103893993273024}

    The first 8 mmap events in this 8 way machine are a mistery that is still being
    investigated.

    More of the tools/perf/util/ APIs will be exposed via this python binding as
    the need arises. For now the focus is on creating events and processing them,
    symbol resolution is an obvious next step, with tracepoint variables as a close
    second step.

    Cc: Clark Williams
    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
     

28 Jan, 2011

1 commit

  • Add strfilter for general purpose string filter.

    Every filter rules are descrived by glob matching pattern and '!' prefix
    which means Logical NOT.

    A strfilter consists of those filter rules connected with '&' and '|'.

    A set of rules can be folded by using '(' and ')'.

    It also accepts spaces around rules and those operators.

    Format:
    ::= | "!" | | "(" ")"
    ::= "&" | "|"

    e.g.:

    "(add* | del*) & *timer" filter rules pass strings which start with add
    or del and end with timer.

    This will be used by perf probe --filter.

    Changes in V2:
    - Fix to check result of strdup() and strfilter__alloc().
    - Encapsulate and simplify interfaces as like regex(3).

    Cc: 2nddept-manager@sdl.hitachi.co.jp
    Cc: Franck Bui-Huu
    Cc: Ingo Molnar
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Srikar Dronamraju
    Cc: Steven Rostedt
    LKML-Reference:
    Signed-off-by: Masami Hiramatsu
    Signed-off-by: Arnaldo Carvalho de Melo

    Masami Hiramatsu
     

24 Jan, 2011

1 commit

  • To untangle it from struct thread handling, that is tied to symbols, etc.

    Right now in the python bindings I'm working on I need just a subset of
    the util/ files, untangling it allows me to do that.

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

    Arnaldo Carvalho de Melo
     

23 Jan, 2011

2 commits

  • Killing two more perf wide global variables: nr_counters and evsel_list
    as a list_head.

    There are more operations that will need more fields in perf_evlist,
    like the pollfd for polling all the fds in a list of evsel instances.

    Use option->value to pass the evsel_list to parse_{events,filters}.

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

    Arnaldo Carvalho de Melo
     
  • The -Wstack-protector and -Wvolatile-register-var warnings, for
    instance, are not supported by gcc 3.4.6.

    So fix by doing the same check we already do for -fstack-protector-all.

    With this and the other patches in this series, perf builds unmodified
    on, for instance, RHEL4.

    Cc: Eric Dumazet
    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
     

07 Jan, 2011

1 commit

  • It seems that some gcc versions build by default with frame pointers
    and some others omit them.

    Just build the tools with frame pointers as the callchains can be an
    important part of the perf workflow.

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

    Frederic Weisbecker
     

04 Jan, 2011

1 commit

  • Out of ad-hoc code and global arrays with hard coded sizes.

    This is the first step on having a library that will be first
    used on regression tests in the 'perf test' tool.

    [acme@felicio linux]$ size /tmp/perf.before
    text data bss dec hex filename
    1273776 97384 5104416 6475576 62cf38 /tmp/perf.before
    [acme@felicio linux]$ size /tmp/perf.new
    text data bss dec hex filename
    1275422 97416 1392416 2765254 2a31c6 /tmp/perf.new

    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