1. 13 1月, 2014 15 次提交
    • A
      perf header: Pack 'struct perf_session_env' · 3ba4d2e1
      Arnaldo Carvalho de Melo 提交于
      Initial struct:
      
      [acme@ssdandy linux]$ pahole -C perf_session_env ~/bin/perf
      struct perf_session_env {
      	char *                     hostname;             /*     0     8 */
      	char *                     os_release;           /*     8     8 */
      	char *                     version;              /*    16     8 */
      	char *                     arch;                 /*    24     8 */
      	int                        nr_cpus_online;       /*    32     4 */
      	int                        nr_cpus_avail;        /*    36     4 */
      	char *                     cpu_desc;             /*    40     8 */
      	char *                     cpuid;                /*    48     8 */
      	long long unsigned int     total_mem;            /*    56     8 */
      	/* --- cacheline 1 boundary (64 bytes) --- */
      	int                        nr_cmdline;           /*    64     4 */
      
      	/* XXX 4 bytes hole, try to pack */
      
      	char *                     cmdline;              /*    72     8 */
      	int                        nr_sibling_cores;     /*    80     4 */
      
      	/* XXX 4 bytes hole, try to pack */
      
      	char *                     sibling_cores;        /*    88     8 */
      	int                        nr_sibling_threads;   /*    96     4 */
      
      	/* XXX 4 bytes hole, try to pack */
      
      	char *                     sibling_threads;      /*   104     8 */
      	int                        nr_numa_nodes;        /*   112     4 */
      
      	/* XXX 4 bytes hole, try to pack */
      
      	char *                     numa_nodes;           /*   120     8 */
      	/* --- cacheline 2 boundary (128 bytes) --- */
      	int                        nr_pmu_mappings;      /*   128     4 */
      
      	/* XXX 4 bytes hole, try to pack */
      
      	char *                     pmu_mappings;         /*   136     8 */
      	int                        nr_groups;            /*   144     4 */
      
      	/* size: 152, cachelines: 3, members: 20 */
      	/* sum members: 128, holes: 5, sum holes: 20 */
      	/* padding: 4 */
      	/* last cacheline: 24 bytes */
      };
      [acme@ssdandy linux]$
      
      [acme@ssdandy linux]$ pahole -C perf_session_env --reorganize --show_reorg_steps ~/bin/perf | grep ^/ | grep -v Final
      /* Moving 'nr_sibling_cores' from after 'cmdline' to after 'nr_cmdline' */
      /* Moving 'nr_numa_nodes' from after 'sibling_threads' to after 'nr_sibling_threads' */
      /* Moving 'nr_groups' from after 'pmu_mappings' to after 'nr_pmu_mappings' */
      [acme@ssdandy linux]$
      
      Final struct stats:
      
      [acme@ssdandy linux]$ pahole -C perf_session_env --reorganize --show_reorg_steps ~/bin/perf | tail -4
      	/* --- cacheline 2 boundary (128 bytes) --- */
      
      	/* size: 128, cachelines: 2, members: 20 */
      };   /* saved 24 bytes and 1 cacheline! */
      [acme@ssdandy linux]$
      
      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-3d9tshamloinzxcqeb7mtd1n@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      3ba4d2e1
    • J
      tools lib traceevent: Shut up plugins make message · 9bb8e5ed
      Jiri Olsa 提交于
      Getting rid of following build output:
      
        $ make O=/tmp/build/perf -C tools/perf/ install-bin
        ...
        make[3]: Nothing to be done for `plugins'.
        make[2]: Nothing to be done for `plugins'.
        ...
      
      which triggers when traceevent library needs to be rebuilt, but we have
      plugins built already.
      
      Adding extra 'plugins' target with nop which is visible and triggers in
      both Makefile parts (for detached output directory (O=...) the
      traceevent Makefile spawns sub make for the build itself).
      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>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Link: http://lkml.kernel.org/r/1388595050-23005-2-git-send-email-jolsa@redhat.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      9bb8e5ed
    • J
      tools lib traceevent: Replace tabs with spaces for all non-commands statements · 198430b5
      Jiri Olsa 提交于
      The tabbed indentation in non-commands statements could be sometimes
      considered as follow up for the rule command in the Makefile.
      
      This error is hard to find, so as a precaution replacing tabs with
      spaces for all non-commands statements.
      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>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Link: http://marc.info/?t=136484403900003&r=1&w=2
      Link: http://lkml.kernel.org/r/20140102095304.GA1196@krava.brq.redhat.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      198430b5
    • J
      perf tests: Fix installation tests path setup · f7c64474
      Jiri Olsa 提交于
      Currently installation tests work only over x86_64, adding arch check to
      make it work over i386 as well.
      
      NOTE looks like x86 is the only arch running tests, we need some
      IS_(32/64) flag to make this generic.
      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: Jiri Olsa <jolsa@redhat.com>
      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/1388759553-12974-2-git-send-email-jolsa@redhat.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      f7c64474
    • J
      perf tools: Move arch setup into seprate Makefile · a6cf5f39
      Jiri Olsa 提交于
      I need to use arch related setup in the tests/make, so moving arch setup
      into Makefile.arch.
      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/1388759553-12974-1-git-send-email-jolsa@redhat.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      a6cf5f39
    • A
      perf stat: Remove misplaced __maybe_unused · 41cde476
      Arnaldo Carvalho de Melo 提交于
      That 'argc' argument _is_ being used.
      
      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-t2gsxc15zulkorieg8zq996o@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      41cde476
    • A
      perf tests: Fixup leak on error path in parse events test · 2d4352c0
      Arnaldo Carvalho de Melo 提交于
      We need to call the evlist destructor when failing to parse events.
      
      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-ilslu69s7v7bpvdgqtrlp8f5@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      2d4352c0
    • A
      perf evlist: Auto unmap on destructor · 983874d1
      Arnaldo Carvalho de Melo 提交于
      Removing further boilerplate after making sure perf_evlist__munmap can
      be called multiple times for the same evlist.
      
      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-o0luenuld4abupm4nmrgzm6f@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      983874d1
    • A
      perf evlist: Close fds on destructor · f26e1c7c
      Arnaldo Carvalho de Melo 提交于
      Since it is safe to call perf_evlist__close() multiple times, autoclose
      it and remove the calls to the close from existing tools, reducing the
      tooling boilerplate.
      
      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-2kq9v7p1rude1tqxa0aue2tk@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      f26e1c7c
    • A
      perf evlist: Move destruction of maps to evlist destructor · 03ad9747
      Arnaldo Carvalho de Melo 提交于
      Instead of requiring tools to do an extra destructor call just before
      calling perf_evlist__delete.
      
      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-0jd2ptzyikxb5wp7inzz2ah2@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      03ad9747
    • A
      perf record: Remove old evsel_list usage · 3e2be2da
      Arnaldo Carvalho de Melo 提交于
      To be consistent with other places, use just 'evlist' for the evsel list
      variable, and since we have it in 'struct record', use it directly from
      there.
      
      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-396bnfvmlxrsj3o2tk47b8t1@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      3e2be2da
    • A
      perf evlist: Move the SIGUSR1 error reporting logic to prepare_workload · 735f7e0b
      Arnaldo Carvalho de Melo 提交于
      So that we have the boilerplate in the preparation method, instead of
      open coded in tools wanting the reporting when the exec fails.
      
      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-purbdzcphdveskh7wwmnm4t7@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      735f7e0b
    • A
      perf evlist: Send the errno in the signal when workload fails · f33cbe72
      Arnaldo Carvalho de Melo 提交于
      When a tool uses perf_evlist__start_workload and the supplied workload
      fails (e.g.: its binary wasn't found), perror was being used to print
      the error reason.
      
      This is undesirable, as the caller may be a GUI, when it wants to have
      total control of the error reporting process.
      
      So move to using sigaction(SA_SIGINFO) + siginfo_t->sa_value->sival_int
      to communicate to the caller the errno and let it print it using the UI
      of its choosing.
      
      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-epgcv7kjq8ll2udqfken92pz@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      f33cbe72
    • A
      perf stat: Don't show counter information when workload fails · 6af206fd
      Arnaldo Carvalho de Melo 提交于
      When starting a workload 'stat' wasn't using prepare_workload evlist
      method's signal based exec() error reporting mechanism.
      
      Use it so that the we don't report 'not counted' counters.
      
      Before:
      
        [acme@zoo linux]$ perf stat dfadsfa
        dfadsfa: No such file or directory
      
         Performance counter stats for 'dfadsfa':
      
             <not counted>      task-clock
             <not counted>      context-switches
             <not counted>      cpu-migrations
             <not counted>      page-faults
             <not counted>      cycles
             <not counted>      stalled-cycles-frontend
           <not supported>      stalled-cycles-backend
             <not counted>      instructions
             <not counted>      branches
             <not counted>      branch-misses
      
               0.001831462 seconds time elapsed
      
        [acme@zoo linux]$
      
      After:
      
        [acme@zoo linux]$ perf stat dfadsfa
        dfadsfa: No such file or directory
        [acme@zoo linux]$
      Reported-by: NDavid Ahern <dsahern@gmail.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-5yui3bv7e3hitxucnjsn6z8q@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      6af206fd
    • I
      Merge tag 'perf-core-for-mingo' of... · 1341f3e4
      Ingo Molnar 提交于
      Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core
      
      Pull perf updates from Arnaldo Carvalho de Melo:
      
      User visible changes:
      
      Improvements:
      
       * Support showing source code, asking for variables to be collected
         at probe time and other 'perf probe' operations that use DWARF information.
      
         This supports only binaries with debugging information at this time, detached
         debuginfo (aka debuginfo packages) support should come in later patches.
         (Masami Hiramatsu)
      
       * Add a perf.data file header window in the 'perf report' TUI, associated
         with the 'i' hotkey, providing a counterpart to the --header option in the
         stdio UI. (Namhyung Kim)
      
       * Guest related improvements to 'perf kvm', including allowing to
         specify a directory with guest specific /proc information. (Dongsheng Yang)
      
       * Print session information only if --stdio is given (Namhyung Kim)
      
      Developer stuff:
      
      Fixes:
      
       * Get rid of a duplicate va_end() in error reporting (Namhyung Kim)
      
       * If a hist entry doesn't have symbol information, compare it with its
         address. Affects upcoming new feature (--cumulate) (Namhyung Kim)
      
      Improvements:
      
       * Make libtraceevent install target quieter (Jiri Olsa)
      
       * Make tests/make output more compact (Jiri Olsa)
      
       * Ignore generated files in feature-checks (Chunwei Chen)
      
      New APIs:
      
       * Introduce pevent_filter_strerror() in libtraceevent, similar in
         purpose to libc's strerror() function. (Namhyung Kim)
      
      Refactorings:
      
       * Use perf_data_file methods to write output file in 'record' and
         'inject' (Jiri Olsa)
      
       * Use pr_*() functions where applicable in 'report' (Namhyumg Kim)
      
       * Add 'machine' 'addr_location' struct to have full picture (machine,
         thread, map, symbol, addr) for a (partially) resolved address, reducing
         function signatures (Arnaldo Carvalho de Melo)
      
       * Reduce code duplication in the histogram entry creation/insertion. (Arnaldo Carvalho de Melo)
      
       * Auto allocate annotation histogram data structures, (Arnaldo Carvalho de Melo)
      
       * No need to test against NULL before calling free, also set
         freed memory in struct pointers to NULL, to help fixing use after
         free bugs. (Arnaldo Carvalho de Melo>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      1341f3e4
  2. 12 1月, 2014 3 次提交
  3. 28 12月, 2013 2 次提交
  4. 27 12月, 2013 1 次提交
  5. 26 12月, 2013 5 次提交
    • N
      perf ui/tui: Implement header window · 6dd60135
      Namhyung Kim 提交于
      Implement a simple, full-screen header window which shows session header
      (metadata) information.  Press 'i' key to display the header window.
      Signed-off-by: NNamhyung Kim <namhyung@kernel.org>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1388036284-32342-4-git-send-email-namhyung@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      6dd60135
    • N
      perf ui/tui: Split help message for perf top and report · e8e684a5
      Namhyung Kim 提交于
      Some hotkeys don't work for perf top so split help messages for them.
      
      It'll be helpful to a future modification.  Also sort the message by
      alphabetical order of the hotkey.
      Signed-off-by: NNamhyung Kim <namhyung@kernel.org>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1388036284-32342-3-git-send-email-namhyung@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      e8e684a5
    • N
      perf ui/tui: Protect windows by ui__lock · 5c743cf5
      Namhyung Kim 提交于
      Sometimes perf top TUI breaks display with concurrent help/input window
      and pr_* messages since they're not protected by ui__lock.
      
      You can check it by pressing (and not releasing) 'h' key on a "perf top
      -vvv" TUI session.
      Signed-off-by: NNamhyung Kim <namhyung@kernel.org>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1388036284-32342-2-git-send-email-namhyung@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      5c743cf5
    • M
      perf probe: Support basic dwarf-based operations on uprobe events · fb7345bb
      Masami Hiramatsu 提交于
      Support basic dwarf(debuginfo) based operations for uprobe events.  With
      this change, perf probe can analyze debuginfo of user application binary
      to set up new uprobe event.
      
      This allows perf-probe --add(with local variables, line numbers) and
      --line works with -x option.  (Actually, --vars has already accepted -x
      option)
      
      For example, the following command shows the probe-able lines of a given
      user space function. Something that so far was only available in the
      'perf probe' tool for kernel space functions:
      
        # ./perf probe -x perf --line map__load
        <map__load@/home/fedora/ksrc/linux-2.6/tools/perf/util/map.c:0>
              0  int map__load(struct map *map, symbol_filter_t filter)
              1  {
              2         const char *name = map->dso->long_name;
                        int nr;
      
              5         if (dso__loaded(map->dso, map->type))
              6                 return 0;
      
              8         nr = dso__load(map->dso, map, filter);
              9         if (nr < 0) {
             10                 if (map->dso->has_build_id) {
      
      And this shows the available variables at the given line of the
      function.
      
        # ./perf probe -x perf --vars map__load:8
        Available variables at map__load:8
                @<map__load+96>
                        char*   name
                        struct map*     map
                        symbol_filter_t filter
                @<map__find_symbol+112>
                        char*   name
                        symbol_filter_t filter
                @<map__find_symbol_by_name+136>
                        char*   name
                        symbol_filter_t filter
                @<map_groups__find_symbol_by_name+176>
                        char*   name
                        struct map*     map
                        symbol_filter_t filter
      
      And lastly, we can now define probe(s) with all available
      variables on the given line:
      
        # ./perf probe -x perf --add 'map__load:8 $vars'
      
        Added new events:
          probe_perf:map__load (on map__load:8 with $vars)
          probe_perf:map__load_1 (on map__load:8 with $vars)
          probe_perf:map__load_2 (on map__load:8 with $vars)
          probe_perf:map__load_3 (on map__load:8 with $vars)
      
        You can now use it in all perf tools, such as:
      
                perf record -e probe_perf:map__load_3 -aR sleep 1
      
        Changes from previous version:
         - Add examples in the patch description.
         - Use .text section start address and dwarf symbol address
           for calculating the offset of given symbol, instead of
           searching the symbol in symtab again.
           With this change, we can safely handle multiple local
           function instances (e.g. scnprintf in 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@kernel.org>
      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: systemtap@sourceware.org
      Cc: yrl.pp-manager.tt@hitachi.com
      Link: http://lkml.kernel.org/r/20131226054152.22364.47021.stgit@kbuild-fedora.novalocalSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      fb7345bb
    • M
      perf probe: Expand given path to absolute path · 8a613d40
      Masami Hiramatsu 提交于
      Expand given path to absolute path in the option parser, except for a
      module name.
      
      Since realpath at later stage in processing several probe point, can be
      called several times (even if currently doesn't, it can happen when we
      expands the feature), it is waste of the performance.
      
      Processing it once at the early stage can avoid that.
      
      Changes from previous one:
       - Fix not to print null string.
       - Allocate memory for given path/module name everytime.
      Signed-off-by: NMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: "David A. Long" <dave.long@linaro.org>
      Cc: "Steven Rostedt (Red Hat)" <rostedt@goodmis.org>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
      Cc: systemtap@sourceware.org
      Cc: yrl.pp-manager.tt@hitachi.com
      Link: http://lkml.kernel.org/r/20131226054150.22364.12187.stgit@kbuild-fedora.novalocal
      [ Clarified the pr_warning message as per David Ahern's suggestion ]
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      8a613d40
  6. 24 12月, 2013 7 次提交
  7. 21 12月, 2013 2 次提交
  8. 20 12月, 2013 5 次提交