1. 14 3月, 2014 3 次提交
    • D
      perf bench: Add futex-requeue microbenchmark · 0fb298cf
      Davidlohr Bueso 提交于
      Block a bunch of threads on a futex and requeue them on another, N at a
      time.
      
      This program is particularly useful to measure the latency of nthread
      requeues without waking up any tasks -- thus mimicking a regular
      futex_wait.
      
      An example run:
      
        $ perf bench futex requeue -r 100 -t 64
        Run summary [PID 151011]: Requeuing 64 threads (from 0x7d15c4 to 0x7d15c8), 1 at a time.
      
        [Run 1]: Requeued 64 of 64 threads in 0.0400 ms
        [Run 2]: Requeued 64 of 64 threads in 0.0390 ms
        [Run 3]: Requeued 64 of 64 threads in 0.0400 ms
        ...
        [Run 100]: Requeued 64 of 64 threads in 0.0390 ms
        Requeued 64 of 64 threads in 0.0399 ms (+-0.37%)
      Signed-off-by: NDavidlohr Bueso <davidlohr@hp.com>
      Acked-by: NDarren Hart <dvhart@linux.intel.com>
      Cc: Aswin Chandramouleeswaran <aswin@hp.com>
      Cc: Darren Hart <dvhart@linux.intel.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jason Low <jason.low2@hp.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Scott J Norton <scott.norton@hp.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Waiman Long <Waiman.Long@hp.com>
      Link: http://lkml.kernel.org/r/1387081917-9102-4-git-send-email-davidlohr@hp.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      0fb298cf
    • D
      perf bench: Add futex-wake microbenchmark · 27db7830
      Davidlohr Bueso 提交于
      Block a bunch of threads on a futex and wake them up, N at a time.
      
      This program is particularly useful to measure the latency of nthread
      wakeups in non-error situations:  all waiters are queued and all wake
      calls wakeup one or more tasks.
      
      An example run:
      
        $ perf bench futex wake -t 512 -r 100
        Run summary [PID 27823]: blocking on 512 threads (at futex 0x7e10d4), waking up 1 at a time.
      
        [Run 1]: Wokeup 512 of 512 threads in 6.0080 ms
        [Run 2]: Wokeup 512 of 512 threads in 5.2280 ms
        [Run 3]: Wokeup 512 of 512 threads in 4.8300 ms
        ...
        [Run 100]: Wokeup 512 of 512 threads in 5.0100 ms
        Wokeup 512 of 512 threads in 5.0109 ms (+-2.25%)
      Signed-off-by: NDavidlohr Bueso <davidlohr@hp.com>
      Acked-by: NDarren Hart <dvhart@linux.intel.com>
      Cc: Aswin Chandramouleeswaran <aswin@hp.com>
      Cc: Darren Hart <dvhart@linux.intel.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jason Low <jason.low2@hp.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Scott J Norton <scott.norton@hp.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Waiman Long <Waiman.Long@hp.com>
      Link: http://lkml.kernel.org/r/1387081917-9102-3-git-send-email-davidlohr@hp.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      27db7830
    • D
      perf bench: Add futex-hash microbenchmark · a0439711
      Davidlohr Bueso 提交于
      Introduce futexes to perf-bench and add a program that stresses and
      measures the kernel's implementation of the hash table.
      
      This is a multi-threaded program that simply measures the amount of
      failed futex wait calls - we only want to deal with the hashing
      overhead, so a negative return of futex_wait_setup() is enough to do the
      trick.
      
      An example run:
      
        $ perf bench futex hash -t 32
        Run summary [PID 10989]: 32 threads, each operating on 1024 [private] futexes for 10 secs.
      
        [thread  0] futexes: 0x19d9b10 ... 0x19dab0c [ 418713 ops/sec ]
        [thread  1] futexes: 0x19daca0 ... 0x19dbc9c [ 469913 ops/sec ]
        [thread  2] futexes: 0x19dbe30 ... 0x19dce2c [ 479744 ops/sec ]
        ...
        [thread 31] futexes: 0x19fbb80 ... 0x19fcb7c [ 464179 ops/sec ]
      
        Averaged 454310 operations/sec (+- 0.84%), total secs = 10
      Signed-off-by: NDavidlohr Bueso <davidlohr@hp.com>
      Acked-by: NDarren Hart <dvhart@linux.intel.com>
      Cc: Aswin Chandramouleeswaran <aswin@hp.com>
      Cc: Darren Hart <dvhart@linux.intel.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jason Low <jason.low2@hp.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Scott J Norton <scott.norton@hp.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Waiman Long <Waiman.Long@hp.com>
      Link: http://lkml.kernel.org/r/1387081917-9102-2-git-send-email-davidlohr@hp.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      a0439711
  2. 11 3月, 2014 2 次提交
  3. 10 3月, 2014 3 次提交
  4. 28 2月, 2014 2 次提交
  5. 27 2月, 2014 6 次提交
  6. 25 2月, 2014 2 次提交
  7. 24 2月, 2014 12 次提交
    • N
      perf symbols: Destroy unused symsrcs · 98e9f03b
      Namhyung Kim 提交于
      Stephane reported that perf report and annotate failed to process data
      using lots of (> 500) shared libraries.  It was because of the limit on
      number of open files (ulimit -n).
      
      Currently when perf loads a DSO, it'll look for normal and dynamic
      symbol tables.  And if it fails to find out both tables, it'll iterate
      all of possible symtab types.  But many of them are useless since they
      have no additional information and the problem is that it's not closing
      those files even though they're not used.  Fix it.
      Reported-by: NStephane Eranian <eranian@google.com>
      Signed-off-by: NNamhyung Kim <namhyung@kernel.org>
      Cc: Cody P Schafer <cody@linux.vnet.ibm.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Namhyung Kim <namhyung.kim@lge.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1392859976-32760-2-git-send-email-namhyung@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      98e9f03b
    • N
      perf annotate: Check availability of annotate when processing samples · 48c65bda
      Namhyung Kim 提交于
      The TUI of perf report and top support annotation, but stdio and GTK
      don't.  So it should be checked before calling hist_entry__inc_addr_
      samples() to avoid wasting resources that will never be used.
      
      perf annotate need it regardless of UI and sort keys, so the check
      of whether to allocate resources should be on the tools that have
      annotate as an option in the TUI, 'report' and 'top', not on the
      function called by all of them.
      
      It caused perf annotate on ppc64 to produce zero output, since the
      buckets were not being allocated.
      Reported-by: NAnton Blanchard <anton@samba.org>
      Signed-off-by: NNamhyung Kim <namhyung@kernel.org>
      Cc: Anton Blanchard <anton@samba.org>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Namhyung Kim <namhyung.kim@lge.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1392859976-32760-1-git-send-email-namhyung@kernel.org
      [ Renamed (report,top)__needs_annotate() to ui__has_annotation() ]
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      48c65bda
    • J
      perf tests: Add NO_LIBDW_DWARF_UNWIND make test · 9e8c06ea
      Jiri Olsa 提交于
      Adding make test for NO_LIBDW_DWARF_UNWIND option, plus updating minimal
      build test with it.
      Signed-off-by: NJiri Olsa <jolsa@redhat.com>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jean Pihet <jean.pihet@linaro.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1392825179-5228-7-git-send-email-jolsa@redhat.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      9e8c06ea
    • J
      perf tools: Setup default dwarf post unwinder · 0a4f2b6a
      Jiri Olsa 提交于
      Factor NO_LIBDW_DWARF_UNWIND makefile variable and code that selects
      default DWARf post unwinder based on detected features (libdw and
      libunwind support)
      
      If both are detected the libunwind is selected as default.  Simple
      'make' will try to add:
      
        - libunwind unwinder if present
        - libdw unwinder if present
        - disable dwarf unwind if non of libunwind and libdw
          libraries are present
      
      If one of the DWARF unwind libraries is detected, message is displayed
      which one (libunwind/libdw) is compiled in.
      
      Examples:
        - compile in libdw unwinder if present:
      
          $ make NO_LIBUNWIND=1
      
        - compile in libdw (with libdw installation directory) unwinder if present:
      
          $ make LIBDW_DIR=/opt/elfutils/ NO_LIBUNWIND=1
            BUILD:   Doing 'make -j4' parallel build
      
          Auto-detecting system features:
          ...                         dwarf: [ on  ]
          ...                         glibc: [ on  ]
          ...                          gtk2: [ on  ]
          ...                      libaudit: [ on  ]
          ...                        libbfd: [ on  ]
          ...                        libelf: [ on  ]
          ...                       libnuma: [ on  ]
          ...                       libperl: [ on  ]
          ...                     libpython: [ on  ]
          ...                      libslang: [ on  ]
          ...                     libunwind: [ on  ]
          ...            libdw-dwarf-unwind: [ on  ]
          ...     DWARF post unwind library: libdw
      
        - disable post dwarf unwind completely:
      
          $ make NO_LIBUNWIND=1 NO_LIBDW_DWARF_UNWIND=1
            BUILD:   Doing 'make -j4' parallel build
      
          Auto-detecting system features:
          ...                         dwarf: [ on  ]
          ...                         glibc: [ on  ]
          ...                          gtk2: [ on  ]
          ...                      libaudit: [ on  ]
          ...                        libbfd: [ on  ]
          ...                        libelf: [ on  ]
          ...                       libnuma: [ on  ]
          ...                       libperl: [ on  ]
          ...                     libpython: [ on  ]
          ...                      libslang: [ on  ]
          ...                     libunwind: [ on  ]
          ...            libdw-dwarf-unwind: [ on  ]
          ...     DWARF post unwind library: libunwind
      Signed-off-by: NJiri Olsa <jolsa@redhat.com>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jean Pihet <jean.pihet@linaro.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1392825179-5228-6-git-send-email-jolsa@redhat.com
      [ Add suggestion about setting LIBDW_DIR when not finding libdw ]
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      0a4f2b6a
    • J
      perf tools: Add libdw DWARF post unwind support · 5ea84154
      Jiri Olsa 提交于
      Adding libdw DWARF post unwind support, which is part of
      elfutils-devel/libdw-dev package from version 0.158.
      
      The new code is contained in unwin-libdw.c object, and implements
      unwind__get_entries unwind interface function.
      
      New Makefile variable NO_LIBDW_DWARF_UNWIND was added to control its
      compilation, and is marked as disabled now.  It's factored with the rest
      of the Makefile unwind build code in the next patch.
      
      Arch specific code was added for x86.
      Signed-off-by: NJiri Olsa <jolsa@redhat.com>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jean Pihet <jean.pihet@linaro.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1392825179-5228-5-git-send-email-jolsa@redhat.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      5ea84154
    • J
      perf tools: Add feature check for libdw dwarf unwind · 45757895
      Jiri Olsa 提交于
      Adding feature check test code for libdw dwarf unwind.
      Signed-off-by: NJiri Olsa <jolsa@redhat.com>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jean Pihet <jean.pihet@linaro.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1392825179-5228-4-git-send-email-jolsa@redhat.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      45757895
    • A
      perf tools: Warn the user about how to enable libunwind support · 7a0447d6
      Arnaldo Carvalho de Melo 提交于
      When one has libunwind installed somewhere the perf tools build process
      doesn't expects it to be, this happens:
      
        [acme@ssdandy linux]$ make O=/tmp/build/perf -C tools/perf/ install-bin
        make: Entering directory `/home/acme/git/linux/tools/perf'
          BUILD:   Doing 'make -j8' parallel build
        config/Makefile:312: No libunwind found, disabling post unwind support.  Please install libunwind-dev[el] >= 1.1
      
        Auto-detecting system features:
        <SNIP>
        ...                     libunwind: [ OFF ]
      
      Change the message so that it tells how to use a non-standard libunwind
      install directory:
      
        config/Makefile:312: No libunwind found, disabling post unwind support.  Please install libunwind-dev[el] >= 1.1 and/or set LIBUNWIND_DIR
      
        [acme@ssdandy linux]$ make LIBUNWIND_DIR=/opt/libunwind-git/ O=/tmp/build/perf -C tools/perf/ install-bin
        make: Entering directory `/home/acme/git/linux/tools/perf'
          BUILD:   Doing 'make -j8' parallel build
      
        Auto-detecting system features:
        <SNIP>
        ...                     libunwind: [ on  ]
      Acked-by: NJiri Olsa <jolsa@redhat.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/n/tip-huoxnou7sw85lm58k3pi1xhw@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      7a0447d6
    • J
      perf tools: Add variable display for VF make output · 8d79076a
      Jiri Olsa 提交于
      Adding dump of interesting build directories to the make VF=1 output.
      
        $ make VF=1
          BUILD:   Doing 'make -j4' parallel build
      
        Auto-detecting system features:
        ...                         dwarf: [ on  ]
        ...                         glibc: [ on  ]
        ...                          gtk2: [ on  ]
        ...                      libaudit: [ on  ]
        ...                        libbfd: [ on  ]
        ...                        libelf: [ on  ]
        ...                       libnuma: [ on  ]
        ...                       libperl: [ on  ]
        ...                     libpython: [ on  ]
        ...                      libslang: [ on  ]
        ...                     libunwind: [ on  ]
        ...                     backtrace: [ on  ]
        ...                fortify-source: [ on  ]
        ...                  gtk2-infobar: [ on  ]
        ...             libelf-getphdrnum: [ on  ]
        ...                   libelf-mmap: [ on  ]
        ...             libpython-version: [ on  ]
        ...                       on-exit: [ on  ]
        ...            stackprotector-all: [ on  ]
        ...                       timerfd: [ on  ]
        ...         libunwind-debug-frame: [ OFF ]
        ...                        bionic: [ OFF ]
      
        ...                        prefix: /home/jolsa
        ...                        bindir: /home/jolsa/bin
        ...                        libdir: /home/jolsa/lib64
        ...                    sysconfdir: /home/jolsa/etc
      
      Adding functions to print variable/text in features display -
      feature_print_var/feature_print_text (feature_print_text is used in next
      patches).
      Signed-off-by: NJiri Olsa <jolsa@redhat.com>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jean Pihet <jean.pihet@linaro.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1392825179-5228-3-git-send-email-jolsa@redhat.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      8d79076a
    • J
      perf tools: Factor features display code · 0695e57b
      Jiri Olsa 提交于
      Currently the we display all detected features/libraries by following
      rules:
      
       - if one of the features is missing
       - if it's build from clean tree
      
      This patch changes changes this behavior in several ways.
      
      - We no longer display all detected features, only detected libraries
        are displayed by default:
      
        $ make
          BUILD:   Doing 'make -j4' parallel build
      
        Auto-detecting system features:
        ...                         dwarf: [ on  ]
        ...                         glibc: [ on  ]
        ...                          gtk2: [ on  ]
        ...                      libaudit: [ on  ]
        ...                        libbfd: [ on  ]
        ...                        libelf: [ on  ]
        ...                       libnuma: [ on  ]
        ...                       libperl: [ on  ]
        ...                     libpython: [ on  ]
        ...                      libslang: [ on  ]
        ...                     libunwind: [ on  ]
      
        The assumption is, that above libraries are the most interesting part
      of the detection, while we don't care much about detection of on-exit
      support.
      
      - If all above libraries are detected, the default is not shown on
        subsequent builds.
      
      - If one of the above libraries is missing, the detection output is
        forced.
      
      - The features status is stored in PERF-FEATURES file and the detection
        output is forced in case the there's difference between the file
        contents and currently detected features.
      
      - If you want to see all detected features, you can use VF=1 make
        variable, that forces the detected features output.
      
        $ make VF=1
          BUILD:   Doing 'make -j4' parallel build
      
        Auto-detecting system features:
        ...                         dwarf: [ on  ]
        ...                         glibc: [ on  ]
        ...                          gtk2: [ on  ]
        ...                      libaudit: [ on  ]
        ...                        libbfd: [ on  ]
        ...                        libelf: [ on  ]
        ...                       libnuma: [ on  ]
        ...                       libperl: [ on  ]
        ...                     libpython: [ on  ]
        ...                      libslang: [ on  ]
        ...                     libunwind: [ on  ]
        ...                     backtrace: [ on  ]
        ...                fortify-source: [ on  ]
        ...                  gtk2-infobar: [ on  ]
        ...             libelf-getphdrnum: [ on  ]
        ...                   libelf-mmap: [ on  ]
        ...             libpython-version: [ on  ]
        ...                       on-exit: [ on  ]
        ...            stackprotector-all: [ on  ]
        ...                       timerfd: [ on  ]
        ...         libunwind-debug-frame: [ OFF ]
        ...                        bionic: [ OFF ]
      Signed-off-by: NJiri Olsa <jolsa@redhat.com>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jean Pihet <jean.pihet@linaro.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1392825179-5228-2-git-send-email-jolsa@redhat.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      0695e57b
    • J
      perf tools: Fix bison OUTPUT directories dependency · da237ed0
      Jiri Olsa 提交于
      The bison and flex C objects don't have dependency for creating output
      directories.
      
      This could lead to build failure if the one of those objects is picked
      up by make to be build as the first one (reported by Arnaldo).
      
      Also following make fails:
        $ rm -rf /tmp/krava; mkdir /tmp/krava; make O=/tmp/krava util/pmu-bison.o
        BUILD:   Doing 'make -j4' parallel build
        [ SNIP ]
        BISON    /tmp/krava/util/pmu-bison.c
        FLAGS:   * new build flags or prefix
      bison: /tmp/krava/util/pmu-bison.output: cannot open: No such file or directory
      make[1]: *** [/tmp/krava/util/pmu-bison.c] Error 1
      make[1]: *** Waiting for unfinished jobs....
      make: *** [util/pmu-bison.o] Error 2
      
      Adding bison objects dependency for output directories (flex objects
      depends on bisons').
      
      This fixies the make_util_pmu_bison_o_O make test.
      Reported-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: NJiri Olsa <jolsa@redhat.com>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1392805300-14610-3-git-send-email-jolsa@redhat.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      da237ed0
    • J
      perf tests: Add pmu-bison.o make test · 2a94f6c4
      Jiri Olsa 提交于
      Adding pmu-bison.o make test:
      
        $ make -f tests/make make_util_pmu_bison_o
        - make_util_pmu_bison_o: cd . && make -f Makefile DESTDIR=/tmp/tmp.0u99hQn8Ga util/pmu-bison.o
        $ make -f tests/make make_util_pmu_bison_o_O
        - make_util_pmu_bison_o_O: cd . && make -f Makefile O=/tmp/tmp.sWKDLGS71O DESTDIR=/tmp/tmp.htQNJAfJ0d util/pmu-bison.o
        make: *** [make_util_pmu_bison_o_O] Error 1
      
      The 'O=' version of the test is failing at the moment, due to the OUTPUT
      directory issue fixed in next patch.
      Signed-off-by: NJiri Olsa <jolsa@redhat.com>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1392805300-14610-2-git-send-email-jolsa@redhat.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      2a94f6c4
    • J
      perf tests: Fix *.o make tests · 04b01a1d
      Jiri Olsa 提交于
      Enable and fix *.o object make tests. Following tests are now available:
      
        $ make -f tests/make make_perf_o_O
        - make_perf_o_O: cd . && make -f Makefile O=/tmp/tmp.iF5vI5emGy DESTDIR=/tmp/tmp.epDPFVhH0s perf.o
        $ make -f tests/make make_util_map_o_O
        - make_util_map_o_O: cd . && make -f Makefile O=/tmp/tmp.BWuMf55ygC DESTDIR=/tmp/tmp.QbGBRF95oP util/map.o
      Signed-off-by: NJiri Olsa <jolsa@redhat.com>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1392805300-14610-1-git-send-email-jolsa@redhat.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      04b01a1d
  8. 18 2月, 2014 10 次提交
    • M
      perf probe: Support distro-style debuginfo for uprobe · a15ad2f5
      Masami Hiramatsu 提交于
      Support distro-style debuginfo supported by dso for setting uprobes.
      Note that this tries to find a debuginfo file based on the real path of
      the target binary. If the debuginfo is not correctly installed on the
      system, this can not find it.
      Signed-off-by: NMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: "David A. Long" <dave.long@linaro.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: yrl.pp-manager.tt@hitachi.com
      Link: http://lkml.kernel.org/r/20140206053227.29635.54434.stgit@kbuild-fedora.yrl.intra.hitachi.co.jpSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      a15ad2f5
    • M
      perf probe: Allow to add events on the local functions · eb948e50
      Masami Hiramatsu 提交于
      Allow to add events on the local functions without debuginfo.
      (With the debuginfo, we can add events even on inlined functions)
      Currently, probing on local functions requires debuginfo to
      locate actual address. It is also possible without debuginfo since
      we have symbol maps.
      
      Without this change;
        ----
        # ./perf probe -a t_show
        Added new event:
          probe:t_show         (on t_show)
      
        You can now use it in all perf tools, such as:
      
                perf record -e probe:t_show -aR sleep 1
      
        # ./perf probe -x perf -a identity__map_ip
        no symbols found in /kbuild/ksrc/linux-3/tools/perf/perf, maybe install a debug package?
        Failed to load map.
          Error: Failed to add events. (-22)
        ----
      As the above results, perf probe just put one event
      on the first found symbol for kprobe event. Moreover,
      for uprobe event, perf probe failed to find local
      functions.
      
      With this change;
        ----
        # ./perf probe -a t_show
        Added new events:
          probe:t_show         (on t_show)
          probe:t_show_1       (on t_show)
          probe:t_show_2       (on t_show)
          probe:t_show_3       (on t_show)
      
        You can now use it in all perf tools, such as:
      
                perf record -e probe:t_show_3 -aR sleep 1
      
        # ./perf probe -x perf -a identity__map_ip
        Added new events:
          probe_perf:identity__map_ip (on identity__map_ip in /kbuild/ksrc/linux-3/tools/perf/perf)
          probe_perf:identity__map_ip_1 (on identity__map_ip in /kbuild/ksrc/linux-3/tools/perf/perf)
          probe_perf:identity__map_ip_2 (on identity__map_ip in /kbuild/ksrc/linux-3/tools/perf/perf)
          probe_perf:identity__map_ip_3 (on identity__map_ip in /kbuild/ksrc/linux-3/tools/perf/perf)
      
        You can now use it in all perf tools, such as:
      
                perf record -e probe_perf:identity__map_ip_3 -aR sleep 1
        ----
      Now we succeed to put events on every given local functions
      for both kprobes and uprobes. :)
      
      Note that this also introduces some symbol rbtree
      iteration macros; symbols__for_each, dso__for_each_symbol,
      and map__for_each_symbol. These are for walking through
      the symbol list in a map.
      
      Changes from v2:
        - Fix add_exec_to_probe_trace_events() not to convert address
          to tp->symbol any more.
        - Fix to set kernel probes based on ref_reloc_sym.
      Signed-off-by: NMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: "David A. Long" <dave.long@linaro.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: yrl.pp-manager.tt@hitachi.com
      Link: http://lkml.kernel.org/r/20140206053225.29635.15026.stgit@kbuild-fedora.yrl.intra.hitachi.co.jpSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      eb948e50
    • M
      perf probe: Show source-level or symbol-level info for uprobes · 5a6f6314
      Masami Hiramatsu 提交于
      Show source-level or symbol-level information for uprobe events.
      
      Without this change;
        # ./perf probe -l
          probe_perf:dso__load_vmlinux (on 0x000000000006d110 in /kbuild/ksrc/linux-3/tools/perf/perf)
      
      With this change;
        # ./perf probe -l
          probe_perf:dso__load_vmlinux (on dso__load_vmlinux@util/symbol.c in /kbuild/ksrc/linux-3/tools/perf/perf)
      
      Changes from v2:
       - Update according to previous patches.
      
      Changes from v1:
       - Rewrite the code based on new series.
      Signed-off-by: NMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: "David A. Long" <dave.long@linaro.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: yrl.pp-manager.tt@hitachi.com
      Link: http://lkml.kernel.org/r/20140206053223.29635.51280.stgit@kbuild-fedora.yrl.intra.hitachi.co.jpSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      5a6f6314
    • M
      perf probe: Show appropriate symbol for ref_reloc_sym based kprobes · 8f33f7de
      Masami Hiramatsu 提交于
      Show appropriate symbol for ref_reloc_sym based kprobes instead of
      refpoint+offset when perf-probe -l runs without debuginfo.
      
      Without this change:
        # ./perf probe -l
          probe:t_show         (on _stext+889880 with m v)
          probe:t_show_1       (on _stext+928568 with m v t)
          probe:t_show_2       (on _stext+969512 with m v fmt)
          probe:t_show_3       (on _stext+1001416 with m v file)
      
      With this change:
        # ./perf probe -l
          probe:t_show         (on t_show with m v)
          probe:t_show_1       (on t_show with m v t)
          probe:t_show_2       (on t_show with m v fmt)
          probe:t_show_3       (on t_show with m v file)
      
      Changes from v2:
       - Check ref_reloc_sym to find correct unrelocated address.
      Signed-off-by: NMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: "David A. Long" <dave.long@linaro.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: yrl.pp-manager.tt@hitachi.com
      Link: http://lkml.kernel.org/r/20140206053220.29635.81819.stgit@kbuild-fedora.yrl.intra.hitachi.co.jpSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      8f33f7de
    • M
      perf probe: Find given address from offline dwarf · f90acac7
      Masami Hiramatsu 提交于
      Find the given address from offline dwarfs instead of online kernel
      dwarfs.
      
      On the KASLR enabled kernel, the kernel text section is loaded with
      random offset, and the debuginfo__new_online_kernel can't handle it. So
      let's move to the offline dwarf loader instead of using the online dwarf
      loader.
      
      As a result, since we don't need debuginfo__new_online_kernel any more,
      this also removes the functions related to that.
      
      Without this change;
      
        # ./perf probe -l
          probe:t_show         (on _stext+901288 with m v)
          probe:t_show_1       (on _stext+939624 with m v t)
          probe:t_show_2       (on _stext+980296 with m v fmt)
          probe:t_show_3       (on _stext+1014392 with m v file)
      
      With this change;
      
        # ./perf probe -l
          probe:t_show         (on t_show@linux-3/kernel/trace/ftrace.c with m v)
          probe:t_show_1       (on t_show@linux-3/kernel/trace/trace.c with m v t)
          probe:t_show_2       (on t_show@kernel/trace/trace_printk.c with m v fmt)
          probe:t_show_3       (on t_show@kernel/trace/trace_events.c with m v file)
      
      Changes from v2:
       - Instead of retrying, directly opens offline dwarf.
       - Remove debuginfo__new_online_kernel and related functions.
       - Refer map->reloc to get the correct address of a symbol.
       - Add a special case for handling ref_reloc_sym based address.
      Signed-off-by: NMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: "David A. Long" <dave.long@linaro.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: yrl.pp-manager.tt@hitachi.com
      Link: http://lkml.kernel.org/r/20140206053218.29635.74821.stgit@kbuild-fedora.yrl.intra.hitachi.co.jpSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      f90acac7
    • M
      perf probe: Use ref_reloc_sym based address instead of the symbol name · dfef99cd
      Masami Hiramatsu 提交于
      Since several local symbols can have same name (e.g. t_show), we need to
      use the relative address from the symbol referred by kmap->ref_reloc_sym
      instead of the target symbol name itself.
      
      Because the kernel address space layout randomize (kASLR) changes the
      absolute address of kernel symbols, we can't rely on the absolute
      address.
      
      Note that this works only with debuginfo.
      
      E.g. without this change;
        ----
        # ./perf probe -a "t_show \$vars"
        Added new events:
          probe:t_show         (on t_show with $vars)
          probe:t_show_1       (on t_show with $vars)
          probe:t_show_2       (on t_show with $vars)
          probe:t_show_3       (on t_show with $vars)
      
        You can now use it in all perf tools, such as:
      
                perf record -e probe:t_show_3 -aR sleep 1
        ----
      OK, we have 4 different t_show()s. All functions have
      different arguments as below;
        ----
        # cat /sys/kernel/debug/tracing/kprobe_events
        p:probe/t_show t_show m=%di:u64 v=%si:u64
        p:probe/t_show_1 t_show m=%di:u64 v=%si:u64 t=%si:u64
        p:probe/t_show_2 t_show m=%di:u64 v=%si:u64 fmt=%si:u64
        p:probe/t_show_3 t_show m=%di:u64 v=%si:u64 file=%si:u64
        ----
      However, all of them have been put on the *same* address.
        ----
        # cat /sys/kernel/debug/kprobes/list
        ffffffff810d9720  k  t_show+0x0    [DISABLED]
        ffffffff810d9720  k  t_show+0x0    [DISABLED]
        ffffffff810d9720  k  t_show+0x0    [DISABLED]
        ffffffff810d9720  k  t_show+0x0    [DISABLED]
        ----
      
      With this change;
        ----
        # ./perf probe -a "t_show \$vars"
        Added new events:
          probe:t_show         (on t_show with $vars)
          probe:t_show_1       (on t_show with $vars)
          probe:t_show_2       (on t_show with $vars)
          probe:t_show_3       (on t_show with $vars)
      
        You can now use it in all perf tools, such as:
      
                perf record -e probe:t_show_3 -aR sleep 1
      
        # cat /sys/kernel/debug/tracing/kprobe_events
        p:probe/t_show _stext+889880 m=%di:u64 v=%si:u64
        p:probe/t_show_1 _stext+928568 m=%di:u64 v=%si:u64 t=%si:u64
        p:probe/t_show_2 _stext+969512 m=%di:u64 v=%si:u64 fmt=%si:u64
        p:probe/t_show_3 _stext+1001416 m=%di:u64 v=%si:u64 file=%si:u64
      
        # cat /sys/kernel/debug/kprobes/list
        ffffffffb50d95e0  k  t_show+0x0    [DISABLED]
        ffffffffb50e2d00  k  t_show+0x0    [DISABLED]
        ffffffffb50f4990  k  t_show+0x0    [DISABLED]
        ffffffffb50eccf0  k  t_show+0x0    [DISABLED]
        ----
      This time, each event is put in different address
      correctly.
      
      Note that currently this doesn't support address-based
      probe on modules (thus the probes on modules are symbol
      based), since it requires relative address probe syntax
      for kprobe-tracer, and it isn't implemented yet.
      
      One more note, this allows us to put events on correct
      address, but --list option should be updated to show
      correct corresponding source code.
      
      Changes from v2:
        - Refer kmap->ref_reloc_sym instead of "_stext".
        - Refer map->reloc to catch up the kASLR perf fix.
      
      Changes from v1:
        - Use _stext relative address instead of actual
          absolute address recorded in debuginfo.
      Signed-off-by: NMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: "David A. Long" <dave.long@linaro.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: yrl.pp-manager.tt@hitachi.com
      Link: http://lkml.kernel.org/r/20140206053216.29635.22584.stgit@kbuild-fedora.yrl.intra.hitachi.co.jpSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      dfef99cd
    • M
      perf probe: Show in what binaries/modules probes are set · fb226ccd
      Masami Hiramatsu 提交于
      Show the name of binary file or modules in which the probes are set with
      --list option.
      
      Without this change;
      
        # ./perf probe -m drm drm_av_sync_delay
        # ./perf probe -x perf dso__load_vmlinux
      
        # ./perf probe -l
          probe:drm_av_sync_delay (on drm_av_sync_delay)
          probe_perf:dso__load_vmlinux (on 0x000000000006d110)
      
      With this change;
      
        # ./perf probe -l
          probe:drm_av_sync_delay (on drm_av_sync_delay in drm)
          probe_perf:dso__load_vmlinux (on 0x000000000006d110 in /kbuild/ksrc/linux-3/tools/perf/perf)
      Signed-off-by: NMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: "David A. Long" <dave.long@linaro.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: yrl.pp-manager.tt@hitachi.com
      Link: http://lkml.kernel.org/r/20140206053213.29635.69948.stgit@kbuild-fedora.yrl.intra.hitachi.co.jpSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      fb226ccd
    • M
      perf probe: Unify show_available_functions for uprobes/kprobes · 2df58634
      Masami Hiramatsu 提交于
      Unify show_available_functions for uprobes/kprobes to cleanup and reduce
      the code. This also improves error messages.
      Signed-off-by: NMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: "David A. Long" <dave.long@linaro.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: yrl.pp-manager.tt@hitachi.com
      Link: http://lkml.kernel.org/r/20140206053211.29635.20563.stgit@kbuild-fedora.yrl.intra.hitachi.co.jpSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      2df58634
    • M
      perf probe: Replace line_list with intlist · 5a62257a
      Masami Hiramatsu 提交于
      Replace line_list (struct line_node) with intlist for reducing similar
      codes.
      Signed-off-by: NMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Acked-by: NNamhyung Kim <namhyung@kernel.org>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: "David A. Long" <dave.long@linaro.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: yrl.pp-manager.tt@hitachi.com
      Link: http://lkml.kernel.org/r/20140206053209.29635.81043.stgit@kbuild-fedora.yrl.intra.hitachi.co.jpSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      5a62257a
    • M
      perf probe: Remove incorrect symbol check for --list · f49540b1
      Masami Hiramatsu 提交于
      Remove unneeded symbol check for --list option.
      
      This code actually checks whether the given symbol exists in the kernel.
      But this is incorrect for online kernel/module and offline module too:
      
       - For online kernel/module, the kprobes itself already
        ensured the symbol exist in the kernel.
       - For offline module, this code can't access the offlined
        modules. Ignore it.
      Signed-off-by: NMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: "David A. Long" <dave.long@linaro.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: yrl.pp-manager.tt@hitachi.com
      Link: http://lkml.kernel.org/r/20140206053206.29635.7453.stgit@kbuild-fedora.yrl.intra.hitachi.co.jpSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      f49540b1