1. 05 11月, 2014 3 次提交
    • N
      perf build-id: Move build-id related functions to util/build-id.c · e195fac8
      Namhyung Kim 提交于
      It'd be better managing those functions in a separate place as
      util/header.c file is already big.
      
      It now exports following 3 functions to others:
      
        bool perf_session__read_build_ids(struct perf_session *session, bool with_hits);
        int perf_session__write_buildid_table(struct perf_session *session, int fd);
        int perf_session__cache_build_ids(struct perf_session *session);
      Signed-off-by: NNamhyung Kim <namhyung@kernel.org>
      Acked-by: NAdrian Hunter <adrian.hunter@intel.com>
      Link: http://lkml.kernel.org/r/545733E7.6010105@intel.com
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung.kim@lge.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/r/1415063674-17206-5-git-send-email-namhyung@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      e195fac8
    • N
      perf build-id: Rename dsos__write_buildid_table() · 714c9c4a
      Namhyung Kim 提交于
      The dsos__write_buildid_table() is not use struct dso and it mostly
      uses perf_session struct.
      
      So rename it to perf_session__write_buildid_ table() so that it
      corresponds to other related functions such as
      perf_session__read_build_ids() and perf_session__cache_build_ids().
      Signed-off-by: NNamhyung Kim <namhyung@kernel.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung.kim@lge.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/r/1415063674-17206-4-git-send-email-namhyung@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      714c9c4a
    • N
      perf tools: Add gzip decompression support for kernel module · e92ce12e
      Namhyung Kim 提交于
      Now my Archlinux box shows module symbols correctly.
      
      Before:
        $ perf report --stdio
        Failed to open /tmp/perf-3477.map, continuing without symbols
        no symbols found in /usr/bin/date, maybe install a debug package?
        No kallsyms or vmlinux with build-id 7b4ea0a49ae2111925857099aaf05c3246ff33e0 was found
        [drm] with build id 7b4ea0a49ae2111925857099aaf05c3246ff33e0 not found, continuing without symbols
        No kallsyms or vmlinux with build-id edd931629094b660ca9dec09a1b635c8d87aa2ee was found
        [jbd2] with build id edd931629094b660ca9dec09a1b635c8d87aa2ee not found, continuing without symbols
        No kallsyms or vmlinux with build-id a7b1eada671c34933e5610bb920b2ca4945a82c3 was found
        [ext4] with build id a7b1eada671c34933e5610bb920b2ca4945a82c3 not found, continuing without symbols
        No kallsyms or vmlinux with build-id d69511fa3e5840e770336ef45b06c83fef8d74e3 was found
        [scsi_mod] with build id d69511fa3e5840e770336ef45b06c83fef8d74e3 not found, continuing without symbols
        No kallsyms or vmlinux with build-id af0430af13461af058770ee9b87afc07922c2e77 was found
        [libata] with build id af0430af13461af058770ee9b87afc07922c2e77 not found, continuing without symbols
        No kallsyms or vmlinux with build-id aaeedff8160ce631a5f0333591c6ff291201d29f was found
        [libahci] with build id aaeedff8160ce631a5f0333591c6ff291201d29f not found, continuing without symbols
        No kallsyms or vmlinux with build-id c57907712becaf662dc4981824bb372c0441d605 was found
        [mac80211] with build id c57907712becaf662dc4981824bb372c0441d605 not found, continuing without symbols
        No kallsyms or vmlinux with build-id e0589077cc0ec8c3e4c40eb9f2d9e69d236bee8f was found
        [iwldvm] with build id e0589077cc0ec8c3e4c40eb9f2d9e69d236bee8f not found, continuing without symbols
        No kallsyms or vmlinux with build-id 2d86086bf136bf374a2f029cf85a48194f9b950b was found
        [cfg80211] with build id 2d86086bf136bf374a2f029cf85a48194f9b950b not found, continuing without symbols
        No kallsyms or vmlinux with build-id 4493c48599bdb3d91d0f8db5150e0be33fdd9221 was found
        [iwlwifi] with build id 4493c48599bdb3d91d0f8db5150e0be33fdd9221 not found, continuing without symbols
        ...
        #
        # Overhead  Command          Shared Object            Symbol
        # ........  ...............  .......................  ........................................................
        #
             0.03%  swapper          [ext4]                   [k] 0x000000000000fe2e
             0.03%  swapper          [kernel.kallsyms]        [k] account_entity_enqueue
             0.03%  swapper          [ext4]                   [k] 0x000000000000fc2b
             0.03%  irq/50-iwlwifi   [iwlwifi]                [k] 0x000000000000200b
             0.03%  swapper          [kernel.kallsyms]        [k] ktime_add_safe
             0.03%  swapper          [kernel.kallsyms]        [k] elv_completed_request
             0.03%  swapper          [libata]                 [k] 0x0000000000003997
             0.03%  swapper          [libahci]                [k] 0x0000000000001f25
             0.03%  swapper          [kernel.kallsyms]        [k] rb_next
             0.03%  swapper          [kernel.kallsyms]        [k] blk_finish_request
             0.03%  swapper          [ext4]                   [k] 0x0000000000010248
             0.00%  perf             [kernel.kallsyms]        [k] native_write_msr_safe
      
      After:
        $ perf report --stdio
        Failed to open /tmp/perf-3477.map, continuing without symbols
        no symbols found in /usr/bin/tr, maybe install a debug package?
        ...
        #
        # Overhead  Command          Shared Object                Symbol
        # ........  ...............  ...........................  ......................................................
        #
      
             0.04%  kworker/u16:3    [ext4]                       [k] ext4_read_block_bitmap
             0.03%  kworker/u16:0    [mac80211]                   [k] ieee80211_sta_reset_beacon_monitor
             0.02%  irq/50-iwlwifi   [mac80211]                   [k] ieee80211_get_bssid
             0.02%  firefox          [e1000e]                     [k] __ew32_prepare
             0.02%  swapper          [libahci]                    [k] ahci_handle_port_interrupt
             0.02%  emacs            libglib-2.0.so.0.4000.0      [.] g_mutex_unlock
             0.02%  swapper          [e1000e]                     [k] e1000_clean_tx_irq
             0.02%  dwm              [kernel.kallsyms]            [k] __schedule
             0.02%  gnome-terminal-  [vdso]                       [.] __vdso_clock_gettime
             0.02%  swapper          [e1000e]                     [k] e1000_alloc_rx_buffers
             0.02%  irq/50-iwlwifi   [mac80211]                   [k] ieee80211_rx
             0.01%  firefox          [vdso]                       [.] __vdso_gettimeofday
             0.01%  irq/50-iwlwifi   [iwlwifi]                    [k] iwl_pcie_rxq_restock.part.13
      Signed-off-by: NNamhyung Kim <namhyung@kernel.org>
      Acked-by: NJiri Olsa <jolsa@redhat.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Namhyung Kim <namhyung.kim@lge.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/r/87h9yexshi.fsf@sejong.aot.lge.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      e92ce12e
  2. 04 11月, 2014 8 次提交
  3. 29 10月, 2014 29 次提交
    • A
      perf session: Add perf_session__deliver_synth_event() · a293829d
      Adrian Hunter 提交于
      Add a function to deliver synthesized events from within a session.
      
      Intel PT decoding works by synthesizing events (primarily branch events)
      that can then be consumed by existing tools.  This function will be used
      to deliver those events.
      Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@gmail.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/r/1414417770-18602-3-git-send-email-adrian.hunter@intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      a293829d
    • A
      perf tools: Use evlist__for_each in a few remaining places · cba9b847
      Arnaldo Carvalho de Melo 提交于
      Where direct use of the longer form using list_for_entry() was being
      used.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Don Zickus <dzickus@redhat.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-v4fw80flg25nkl8jgeod3ot9@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      cba9b847
    • A
      perf tools: Add id index · 3c659eed
      Adrian Hunter 提交于
      Add an index of the event identifiers, in preparation for Intel PT.
      
      The event id (also called the sample id) is a unique number
      allocated by the kernel to the event created by perf_event_open().  Events
      can include the event id by having a sample type including PERF_SAMPLE_ID or
      PERF_SAMPLE_IDENTIFIER.
      
      Currently the main use of the event id is to match an event back to the
      evsel to which it belongs i.e. perf_evlist__id2evsel()
      
      The purpose of this patch is to make it possible to match an event back to
      the mmap from which it was read.  The reason that is useful is because the
      mmap represents a time-ordered context (either for a cpu or for a thread).
      Intel PT decodes trace information on that basis.  In full-trace mode, that
      information can be recorded when the Intel PT trace is read, but in
      sample-mode the Intel PT trace data is embedded in a sample and it is in
      that case that the "id index" is needed.
      
      So the mmaps are numbered (idx) and the cpu and tid recorded against the id
      by perf_evlist__set_sid_idx() which is called by perf_evlist__mmap_per_evsel().
      
      That information is recorded on the perf.data file in the new "id index".
      idx, cpu and tid are added to struct perf_sample_id (which is the node of
      evlist's hash table to match ids to evsels).  The information can be
      retrieved using perf_evlist__id2sid().  Note however this all depends on
      having a sample type including PERF_SAMPLE_ID or PERF_SAMPLE_IDENTIFIER,
      otherwise ids are not recorded.
      
      The "id index" is a synthesized event record which will be created when
      Intel PT sampling is used by calling perf_event__synthesize_id_index().
      Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com>
      Acked-by: NJiri Olsa <jolsa@kernel.org>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@gmail.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/r/1414417770-18602-2-git-send-email-adrian.hunter@intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      3c659eed
    • M
      perf probe: Add --quiet option to suppress output result message · 5e17b28f
      Masami Hiramatsu 提交于
      Add --quiet(-q) option to suppress output result message for --add, and
      --del options (Note that --lines/funcs/vars are not affected). This
      option is useful if you run the perf probe inside your scripts.
      Signed-off-by: NMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: Hemant Kumar <hemant@linux.vnet.ibm.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
      Link: http://lkml.kernel.org/r/20141027203131.21219.35170.stgit@localhost.localdomainSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      5e17b28f
    • A
      perf script: Add Python script to export to postgresql · 2987e32f
      Adrian Hunter 提交于
      Add a Python script to export to a postgresql database.
      
      The script requires the Python pyside module and the Qt PostgreSQL
      driver.  The packages needed are probably named "python-pyside" and
      "libqt4-sql-psql"
      
      The caller of the script must be able to create postgresql databases.
      
      The script takes the database name as a parameter.  The database and
      database tables are created.  Data is written to flat files which are
      then imported using SQL COPY FROM.
      
      Example:
      
        $ perf record ls
        ...
        $ perf script report export-to-postgresql lsdb
        2014-02-14 10:55:38.631431 Creating database...
        2014-02-14 10:55:39.291958 Writing to intermediate files...
        2014-02-14 10:55:39.350280 Copying to database...
        2014-02-14 10:55:39.358536 Removing intermediate files...
        2014-02-14 10:55:39.358665 Adding primary keys
        2014-02-14 10:55:39.658697 Adding foreign keys
        2014-02-14 10:55:39.667412 Done
        $ psql lsdb
        lsdb-# \d
                    List of relations
         Schema |      Name       | Type  | Owner
        --------+-----------------+-------+-------
         public | comm_threads    | table | acme
         public | comms           | table | acme
         public | dsos            | table | acme
         public | machines        | table | acme
         public | samples         | table | acme
         public | samples_view    | view  | acme
         public | selected_events | table | acme
         public | symbols         | table | acme
         public | threads         | table | acme
        (9 rows)
        lsdb-# \d samples
               Table "public.samples"
            Column     |  Type   | Modifiers
        ---------------+---------+-----------
         id            | bigint  | not null
         evsel_id      | bigint  |
         machine_id    | bigint  |
         thread_id     | bigint  |
         comm_id       | bigint  |
         dso_id        | bigint  |
         symbol_id     | bigint  |
         sym_offset    | bigint  |
         ip            | bigint  |
         time          | bigint  |
         cpu           | integer |
         to_dso_id     | bigint  |
         to_symbol_id  | bigint  |
         to_sym_offset | bigint  |
         to_ip         | bigint  |
         period        | bigint  |
         weight        | bigint  |
         transaction   | bigint  |
         data_src      | bigint  |
        Indexes:
            "samples_pkey" PRIMARY KEY, btree (id)
        Foreign-key constraints:
            "commfk" FOREIGN KEY (comm_id) REFERENCES comms(id)
            "dsofk" FOREIGN KEY (dso_id) REFERENCES dsos(id)
            "evselfk" FOREIGN KEY (evsel_id) REFERENCES selected_events(id)
            "machinefk" FOREIGN KEY (machine_id) REFERENCES machines(id)
            "symbolfk" FOREIGN KEY (symbol_id) REFERENCES symbols(id)
            "threadfk" FOREIGN KEY (thread_id) REFERENCES threads(id)
            "todsofk" FOREIGN KEY (to_dso_id) REFERENCES dsos(id)
            "tosymbolfk" FOREIGN KEY (to_symbol_id) REFERENCES symbols(id)
      
        lsdb-# \d samples_view
                       View "public.samples_view"
              Column       |          Type           | Modifiers
        -------------------+-------------------------+-----------
         id                | bigint                  |
         time              | bigint                  |
         cpu               | integer                 |
         pid               | integer                 |
         tid               | integer                 |
         command           | character varying(16)   |
         event             | character varying(80)   |
         ip_hex            | text                    |
         symbol            | character varying(2048) |
         sym_offset        | bigint                  |
         dso_short_name    | character varying(256)  |
         to_ip_hex         | text                    |
         to_symbol         | character varying(2048) |
         to_sym_offset     | bigint                  |
         to_dso_short_name | character varying(256)  |
      
          lsdb=# select * from samples_view;
      
         id| time       |cpu | pid  | tid  |command| event  |   ip_hex      |           symbol    |sym_off| dso_name|to_ip_hex|to_symbol|to_sym_off|to_dso_name
         --+------------+----+------+------+-------+--------+---------------+---------------------+-------+---------+---------+---------+----------+----------
         1 |12202825015 | -1 | 7339 | 7339 |:17339 | cycles | fffff8104d24a |native_write_msr_safe|    10 | [kernel]| 0       | unknown |         0| unknown
         2 |12203258804 | -1 | 7339 | 7339 |:17339 | cycles | fffff8104d24a |native_write_msr_safe|    10 | [kernel]| 0       | unknown |         0| unknown
         3 |12203988119 | -1 | 7339 | 7339 |:17339 | cycles | fffff8104d24a |native_write_msr_safe|    10 | [kernel]| 0       | unknown |         0| unknown
      
      My notes (which may be out-of-date) on setting up postgresql so you can
      create databases:
      
      fedora:
      
              $ sudo yum install postgresql postgresql-server python-pyside qt-postgresql
              $ sudo su - postgres -c initdb
              $ sudo service postgresql start
              $ sudo su - postgres
              $ createuser -s <your username>
      
      I used the the unix user name in createuser.
      
      If it fails, try createuser without -s and answer the following question
      to allow your user to create tables:
      
              Shall the new role be a superuser? (y/n) y
      
      ubuntu:
      
              $ sudo apt-get install postgresql
              $ sudo su - postgres
              $ createuser <your username>
              Shall the new role be a superuser? (y/n) y
      
      You may want to disable automatic startup.  One way is to edit
      /etc/postgresql/9.3/main/start.conf.  Another is to disable the init
      script e.g. sudo update-rc.d postgresql disable
      Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@gmail.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/r/1414061124-26830-8-git-send-email-adrian.hunter@intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      2987e32f
    • A
      perf scripting python: Extend interface to export data in a database-friendly way · df919b40
      Adrian Hunter 提交于
      Use the new db_export facility to export data in a database-friendly
      way.
      
      A Python script selects the db_export mode by setting a global variable
      'perf_db_export_mode' to True.  The script then optionally implements
      functions to receive table rows.  The functions are:
      
      	evsel_table
      	machine_table
      	thread_table
      	comm_table
      	dso_table
      	symbol_table
      	sample_table
      
      An example script is provided in a subsequent patch.
      Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@gmail.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/r/1414061124-26830-7-git-send-email-adrian.hunter@intel.com
      [ Reserve space for per symbol db_id space when perf_db_export_mode is on ]
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      df919b40
    • A
      perf tools: Add facility to export data in database-friendly way · 0db15b1e
      Adrian Hunter 提交于
      This patch introduces an abstraction for exporting sample data in a
      database-friendly way.  The abstraction does not implement the actual
      output.  A subsequent patch takes this facility into use for extending
      the script interface.
      
      The abstraction is needed because static data like symbols, dsos, comms
      etc need to be exported only once.  That means allocating them a unique
      identifier and recording it on each structure.  The member 'db_id' is
      used for that.  'db_id' is just a 64-bit sequence number.
      
      Exporting centres around the db_export__sample() function which exports
      the associated data structures if they have not yet been allocated a
      db_id.
      Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@gmail.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/r/1414061124-26830-6-git-send-email-adrian.hunter@intel.com
      [ committer note: Stash db_id using symbol_conf.priv_size + symbol__priv() and foo->priv areas ]
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      0db15b1e
    • A
      perf pmu: Add proper error handling to print_pmu_events() · 7e4772dc
      Arnaldo Carvalho de Melo 提交于
      It was silently returning or printing "(null)" when no memory was
      available at various points. Fix it by checking and warning the user
      when that happens.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Don Zickus <dzickus@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jean Pihet <jean.pihet@linaro.org>
      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-835udmf66x9nza504cu6irz9@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      7e4772dc
    • A
      perf tools: Do not attempt to run perf-read-vdso32 if it wasn't built · 46b1fa85
      Adrian Hunter 提交于
      popen() causes an error message to print if perf-read-vdso32 does not
      run.  Avoid that by not trying to run it if it was not built.  Ditto
      perf-read-vdsox32.
      Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@gmail.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/r/1414061124-26830-17-git-send-email-adrian.hunter@intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      46b1fa85
    • A
      perf tools: Add support for 32-bit compatibility VDSOs · f6832e17
      Adrian Hunter 提交于
      'perf record' post-processes the event stream  to create a list of
      build-ids for object files for which sample events have been recorded.
      That results in those object files being recorded in the build-id cache.
      
      In the case of VDSO, perf tools reads it from memory and copies it into
      a temporary file, which as decribed above, gets added to the build-id
      cache.
      
      Then when the perf.data file is processed by other tools, the build-id
      of VDSO is listed in the perf.data file and the VDSO can be read from
      the build-id cache.  In that case the name of the map, the short name of
      the DSO, and the entry in the build-id cache are all "[vdso]".
      
      However, in the 64-bit case, there also can be 32-bit compatibility
      VDSOs.
      
      A previous patch added programs "perf-read-vdso32" and "perf
      read-vdsox32".
      
      This patch uses those programs to read the correct VDSO for a thread and
      create a temporary file just as for the 64-bit VDSO.
      
      The map name and the entry in the build-id cache are still "[vdso]" but
      the DSO short name becomes "[vdso32]" and "[vdsox32]" respectively.
      Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@gmail.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/r/1414061124-26830-16-git-send-email-adrian.hunter@intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      f6832e17
    • A
      perf tools: Build programs to copy 32-bit compatibility · e477f3f0
      Adrian Hunter 提交于
      perf tools copy VDSO out of memory.  However, on 64-bit machines there
      may be 32-bit compatibility VDOs also.  To copy those requires separate
      32-bit executables.
      
      This patch adds to the build additional programs perf-read-vdso32 and
      perf-read-vdsox32 for 32-bit and x32 respectively.
      Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>,
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@gmail.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/r/1414061124-26830-15-git-send-email-adrian.hunter@intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      e477f3f0
    • A
      perf pmu: Let pmu's with no events show up on perf list · 42634bc7
      Adrian Hunter 提交于
      perf list only lists PMUs with events.  Add a flag to cause a PMU to be
      also listed separately.
      Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@gmail.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/r/1414061124-26830-3-git-send-email-adrian.hunter@intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      42634bc7
    • W
      perf tools: Ensure return negative value when write header error · ed307758
      Wang Nan 提交于
      When 'perf record' write headers, it calls write_xxx in
      tools/perf/util/header.c, and check return value. It rolls back all
      working only when return value is negative.
      
      This patch ensures write_cpudesc() and write_total_mem() return negative number
      when error. Without this patch, headers reported by 'perf report' header is
      error in some platform. Following output is caputured on ARM, which doesn't
      contain "Processor" field in /proc/cpuinfo. See "cpudesc", "total memory" and
      "cmdline" field.
      
         bash-4.2# perf record ls
         ...
         [ perf record: Woken up 1 times to write data ]
         [ perf record: Captured and wrote 0.001 MB perf.data (~36 samples) ]
         bash-4.2# perf report --stdio --header
         Error:
         The perf.data file has no samples!
         # ========
         # captured on: Fri Sep 12 10:09:10 2014
         # hostname : arma15el
         # os release : 3.17.0+
         # perf version : 3.10.53
         # arch : armv7l
         # nrcpus online : 4
         # nrcpus avail : 1
         # cpudesc : (null)
         # total memory : 0 kB
         # cmdline :
         # event : name = cycles, type = 0, config = 0x0, config1 = 0x0, config2 = 0x0, excl_usr = 0, excl_kern = 0, excl_host = 0, excl_guest = 1, precise_ip = 0
         # pmu mappings: not available
         # ========
         #
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Li Zefan <lizefan@huawei.com>
      Cc: Namhyung Kim <namhyung.kim@lge.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Waiman Long <Waiman.Long@hp.com>
      Link: http://lkml.kernel.org/r/1413428909-80017-1-git-send-email-wangnan0@huawei.comSigned-off-by: NWang Nan <wangnan0@huawei.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      ed307758
    • N
      perf probe: Use PARSE_OPT_EXCLUSIVE flag · 13dcbbc0
      Namhyung Kim 提交于
      The perf probe command has some exclusive options.  Use new PARSE_OPT_EXCLUSIVE
      flag to simplify the code and show more compact usage.
      
        $ perf probe -l -a foo
          Error: switch `a' cannot be used with switch `l'
      
         usage: perf probe [<options>] 'PROBEDEF' ['PROBEDEF' ...]
            or: perf probe [<options>] --add 'PROBEDEF' [--add 'PROBEDEF' ...]
            or: perf probe [<options>] --del '[GROUP:]EVENT' ...
            or: perf probe --list
            or: perf probe [<options>] --line 'LINEDESC'
            or: perf probe [<options>] --vars 'PROBEPOINT'
      
            -a, --add <[EVENT=]FUNC[@src][+OFF|%return|:RL|;PT]|SRC:AL|SRC;PT [[NAME=]ARG ...]>
                                  probe point definition, where
      		GROUP:	Group name (optional)
      		EVENT:	Event name
      		FUNC:	Function name
      		OFF:	Offset from function entry (in byte)
      		%return:	Put the probe at function return
      		SRC:	Source code path
      		RL:	Relative line number from function entry.
      		AL:	Absolute line number in file.
      		PT:	Lazy expression of line code.
      		ARG:	Probe argument (local variable name or
      			kprobe-tracer argument format.)
      
            -l, --list            list up current probe events
      Signed-off-by: NNamhyung Kim <namhyung@kernel.org>
      Acked-by: NHemant Kumar <hemant@linux.vnet.ibm.com>
      Acked-by: NMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Hemant Kumar <hemant@linux.vnet.ibm.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/1413990949-13953-6-git-send-email-namhyung@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      13dcbbc0
    • N
      perf tools: Add support for exclusive option · 42bd71d0
      Namhyung Kim 提交于
      Some options cannot be used at the same time.  To handle such options
      add a new PARSE_OPT_EXCLUSIVE flag and show error message if more than
      one of them is used.
      Signed-off-by: NNamhyung Kim <namhyung@kernel.org>
      Reviewed-by: NMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Acked-by: NHemant Kumar <hemant@linux.vnet.ibm.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Hemant Kumar <hemant@linux.vnet.ibm.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/1413990949-13953-5-git-send-email-namhyung@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      42bd71d0
    • N
      perf kvm: Print kvm specific --help output · f45d20ff
      Namhyung Kim 提交于
      The 'perf kvm stat record' tool is an alias of 'perf record' with
      predefined kvm related options. All options that passed to 'perf kvm
      stat record' are processed by the 'perf record' tool. So, 'perf kvm
      stat record --help' prints help of usage for the 'perf record'
      command. There are a few options useful for 'perf kvm stat record',
      the rest either break kvm related output or don't change it.
      
      Let's print safe for 'perf kvm stat record' options in addition to
      general 'perf record' --help output.
      
      With this patch, new output looks like below:
      
        $ perf kvm stat record -h
      
         usage: perf kvm stat record [<options>]
      
            -p, --pid <pid>       record events on existing process id
            -t, --tid <tid>       record events on existing thread id
            -r, --realtime <n>    collect data with this RT SCHED_FIFO priority
                --no-buffering    collect data without buffering
            -a, --all-cpus        system-wide collection from all CPUs
            -C, --cpu <cpu>       list of cpus to monitor
            -c, --count <n>       event period to sample
            -o, --output <file>   output file name
            -i, --no-inherit      child tasks do not inherit counters
            -m, --mmap-pages <pages>
                                  number of mmap data pages
            -v, --verbose         be more verbose (show counter open errors, etc)
            -q, --quiet           don't print any message
            -s, --stat            per thread counts
            -D, --delay <n>       ms to wait before starting measurement after program start
            -u, --uid <user>      user to profile
                --per-thread      use per-thread mmaps
      
        $ perf kvm stat record -n sleep 1
          Error: switch `n' is not usable
      
         usage: perf kvm stat record [<options>]
      Signed-off-by: NNamhyung Kim <namhyung@kernel.org>
      Acked-by: NHemant Kumar <hemant@linux.vnet.ibm.com>
      Cc: Alexander Yarygin <yarygin@linux.vnet.ibm.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/1413990949-13953-4-git-send-email-namhyung@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      f45d20ff
    • N
      perf tools: Export usage string and option table of perf record · e5b2c207
      Namhyung Kim 提交于
      Those are shared with other builtin commands like kvm, script.  So
      make it accessable from them.  This is a preparation of later change
      that limiting possible options.
      Signed-off-by: NNamhyung Kim <namhyung@kernel.org>
      Acked-by: NHemant Kumar <hemant@linux.vnet.ibm.com>
      Cc: Alexander Yarygin <yarygin@linux.vnet.ibm.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Hemant Kumar <hemant@linux.vnet.ibm.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/1413990949-13953-3-git-send-email-namhyung@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      e5b2c207
    • N
      perf tools: Add PARSE_OPT_DISABLED flag · d152d1be
      Namhyung Kim 提交于
      In some cases, we need to reuse exising options with some of them
      disabled.  To do that, add PARSE_OPT_DISABLED flag and
      set_option_flag() function.
      Signed-off-by: NNamhyung Kim <namhyung@kernel.org>
      Acked-by: NHemant Kumar <hemant@linux.vnet.ibm.com>
      Cc: Alexander Yarygin <yarygin@linux.vnet.ibm.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Hemant Kumar <hemant@linux.vnet.ibm.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/1413990949-13953-2-git-send-email-namhyung@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      d152d1be
    • A
      perf tests: Use thread->mg->machine · 29f9e521
      Arnaldo Carvalho de Melo 提交于
      Instead of passing both thread and machine.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Don Zickus <dzickus@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jean Pihet <jean.pihet@linaro.org>
      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-y2nl2v7p7of0dzuyc3tppxoo@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      29f9e521
    • A
      perf tests: Remove misplaced __maybe_unused · f498784c
      Arnaldo Carvalho de Melo 提交于
      The 'machine' parameter is used in this function, ditch the
      __maybe_unused annotation, not needed.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Don Zickus <dzickus@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jean Pihet <jean.pihet@linaro.org>
      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-dme1nsu07a0spkmcl401srec@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      f498784c
    • A
      perf callchains: Use thread->mg->machine · dd8c17a5
      Arnaldo Carvalho de Melo 提交于
      The unwind__get_entries() already receives the thread parameter, from where it can
      obtain the matching machine structure, shorten the signature.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Don Zickus <dzickus@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jean Pihet <jean.pihet@linaro.org>
      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-isjc6bm8mv4612mhi6af64go@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      dd8c17a5
    • A
      perf thread: Adopt resolve_callchain method from machine · cc8b7c2b
      Arnaldo Carvalho de Melo 提交于
      Shortening function signature lenght too, since a thread's machine can be
      obtained from thread->mg->machine, no need to pass thread, machine.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Don Zickus <dzickus@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jean Pihet <jean.pihet@linaro.org>
      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-5wb6css280ty0cel5p0zo2b1@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      cc8b7c2b
    • A
      perf tools: A thread's machine can be found via thread->mg->machine · bb871a9c
      Arnaldo Carvalho de Melo 提交于
      So stop passing both machine and thread to several thread methods,
      reducing function signature length.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Don Zickus <dzickus@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jean Pihet <jean.pihet@linaro.org>
      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-ckcy19dcp1jfkmdihdjcqdn1@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      bb871a9c
    • A
      perf tools: Set thread->mg.machine in all places · 11246c70
      Arnaldo Carvalho de Melo 提交于
      We were setting this only in machine__init(), i.e. for the map_groups that
      holds the kernel module maps, not for the one used for a thread's executable
      mmaps.
      
      Now we are sure that we can obtain the machine where a thread is by going
      via thread->mg->machine, thus we can, in the following patch, make all
      codepaths that receive machine _and_ thread, drop the machine one.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Don Zickus <dzickus@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jean Pihet <jean.pihet@linaro.org>
      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-y6zgaqsvhrf04v57u15e4ybm@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      11246c70
    • S
      perf tools powerpc: Cache the DWARF debug info · 7d073b33
      Sukadev Bhattiprolu 提交于
      Cache the DWARF debug info for DSO so we don't have to rebuild it for each
      address in the DSO.
      
      Note that dso__new() uses calloc() so don't need to set dso->dwfl to NULL.
      
      	$ /tmp/perf.orig --version
      	perf version 3.18.rc1.gc2661b80
      	$ /tmp/perf.new --version
      	perf version 3.18.rc1.g402d62
      	$ perf stat -e cycles,instructions /tmp/perf.orig report -g > orig
      
      	 Performance counter stats for '/tmp/perf.orig report -g':
      
      	     6,428,177,183 cycles                    #    0.000 GHz
      	     4,176,288,391 instructions              #    0.65  insns per cycle
      
      	       1.840666132 seconds time elapsed
      
      	$ perf stat -e cycles,instructions /tmp/perf.new report -g > new
      
      	 Performance counter stats for '/tmp/perf.new report -g':
      
      	       305,773,142 cycles                    #    0.000 GHz
      	       276,048,272 instructions              #    0.90  insns per cycle
      
      	       0.087693543 seconds time elapsed
      	$ diff orig new
      	$
      
      Changelog[v2]:
      
      [Arnaldo Carvalho] Cache in existing global objects rather than create
                         new static/globals in functions.
      Reported-by: NAnton Blanchard <anton@samba.org>
      Signed-off-by: NSukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
      Cc: Anton Blanchard <anton@au1.ibm.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Link: http://lkml.kernel.org/r/20141022000958.GB2228@us.ibm.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      7d073b33
    • M
      perf probe: Trivial typo fix for --demangle · 4cdcc33d
      Masami Hiramatsu 提交于
      Replace "Disable" with "Enable", since --demangle option enables symbol
      demangling, not disable it.
      
      perf probe has --demangle and --no-demangle options, but the
      command-line help (--help) shows only --demangle option. So it should
      explain about --demangle.
      Signed-off-by: NMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: Hemant Kumar <hemant@linux.vnet.ibm.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
      Link: http://lkml.kernel.org/r/20141027203124.21219.68278.stgit@localhost.localdomainSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      4cdcc33d
    • J
      perf tools: Fix report -F dso_from for data without branch info · 288a4b91
      Jiri Olsa 提交于
      The branch field sorting code assumes hist_entry::branch_info is
      allocated, which is wrong and following perf session ends up with report
      segfault.
      
        $ perf record ls
        $ perf report -F dso_from
        perf: Segmentation fault
      
      Checking that hist_entry::branch_info is valid and display "N/A" string
      in snprint callback if it's not.
      Signed-off-by: NJiri Olsa <jolsa@kernel.org>
      Cc: Andi Kleen <ak@linux.intel.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: 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/1413468427-31049-8-git-send-email-jolsa@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      288a4b91
    • J
      perf tools: Fix report -F dso_to for data without branch info · 8b62fa59
      Jiri Olsa 提交于
      The branch field sorting code assumes hist_entry::branch_info is
      allocated, which is wrong and following perf session ends up with report
      segfault.
      
        $ perf record ls
        $ perf report -F dso_to
        perf: Segmentation fault
      
      Checking that hist_entry::branch_info is valid and display "N/A" string
      in snprint callback if it's not.
      Signed-off-by: NJiri Olsa <jolsa@kernel.org>
      Acked-by: NNamhyung Kim <namhyung@kernel.org>
      Cc: Andi Kleen <ak@linux.intel.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: 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/1413468427-31049-7-git-send-email-jolsa@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      8b62fa59
    • J
      perf tools: Fix report -F symbol_from for data without branch info · 1b9e97a2
      Jiri Olsa 提交于
      The branch field sorting code assumes hist_entry::branch_info is
      allocated, which is wrong and following perf session ends up with report
      segfault.
      
        $ perf record ls
        $ perf report -F symbol_from
        perf: Segmentation fault
      
      Checking that hist_entry::branch_info is valid and display "N/A" string
      in snprint callback if it's not.
      Signed-off-by: NJiri Olsa <jolsa@kernel.org>
      Acked-by: NNamhyung Kim <namhyung@kernel.org>
      Cc: Andi Kleen <ak@linux.intel.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: 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/1413468427-31049-6-git-send-email-jolsa@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      1b9e97a2