1. 13 1月, 2014 8 次提交
    • J
      perf tools: Make perf_event__synthesize_mmap_events global · a18382b6
      Jiri Olsa 提交于
      Making perf_event__synthesize_mmap_events global, it will be used in
      following patch from test code.
      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/1389098853-14466-4-git-send-email-jolsa@redhat.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      a18382b6
    • J
      perf machine: Fix id_hdr_size initialization · 14bd6d20
      Jiri Olsa 提交于
      The id_hdr_size field was not properly initialized, set it to zero, as
      the machine struct may have come from some non zeroing allocation
      routine or from the stack without any field being initialized.
      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/1389098853-14466-3-git-send-email-jolsa@redhat.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      14bd6d20
    • 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
    • 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 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
  2. 28 12月, 2013 2 次提交
  3. 27 12月, 2013 1 次提交
  4. 26 12月, 2013 2 次提交
    • 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
  5. 24 12月, 2013 6 次提交
  6. 20 12月, 2013 4 次提交
  7. 19 12月, 2013 8 次提交
  8. 18 12月, 2013 2 次提交
  9. 17 12月, 2013 6 次提交
  10. 13 12月, 2013 1 次提交