1. 17 3月, 2018 8 次提交
    • J
      perf c2c report: Add span header over cacheline data · d0802b1e
      Jiri Olsa 提交于
      Forcing the NUMA node output to be grouped with the "Cacheline" column
      in both "Shared Data Cache Line Table" and "Shared Cache Line
      Distribution Pareto" tables.
      
      Before:
        #                                    Total      Tot  ----- LLC Load Hitm -----
        # Index           Cacheline  Node  records     Hitm    Total      Lcl      Rmt
        # .....  ..................  ....  .......  .......  .......  .......  .......
        #
              0      0x7f0830100000     0       84   10.53%        8        8        0
              1  0xffff922a93154200     0        3    2.63%        2        2        0
              2  0xffff922a93154500     0        4    2.63%        2        2        0
      
      After:
        #        ------- Cacheline ------    Total      Tot  ----- LLC Load Hitm -----
        # Index             Address  Node  records     Hitm    Total      Lcl      Rmt
        # .....  ..................  ....  .......  .......  .......  .......  .......
        #
              0      0x7f0830100000     0       84   10.53%        8        8        0
              1  0xffff922a93154200     0        3    2.63%        2        2        0
              2  0xffff922a93154500     0        4    2.63%        2        2        0
      
      Before:
        #        ----- HITM -----  -- Store Refs --        Data address
        #   Num      Rmt      Lcl   L1 Hit  L1 Miss              Offset  Node      Pid
        # .....  .......  .......  .......  .......  ..................  ....  .......
        #
          -------------------------------------------------------------
              0        0        8       32        2      0x7f0830100000
          -------------------------------------------------------------
                   0.00%   75.00%   21.88%    0.00%                0x18     0     1791
                   0.00%   12.50%   37.50%    0.00%                0x18     0     1791
                   0.00%    0.00%   34.38%    0.00%                0x18     0     1791
      
      After:
        #        ----- HITM -----  -- Store Refs --  ----- Data address -----
        #   Num      Rmt      Lcl   L1 Hit  L1 Miss              Offset  Node      Pid
        # .....  .......  .......  .......  .......  ..................  ....  .......
        #
          -------------------------------------------------------------
              0        0        8       32        2      0x7f0830100000
          -------------------------------------------------------------
                   0.00%   75.00%   21.88%    0.00%                0x18     0     1791
                   0.00%   12.50%   37.50%    0.00%                0x18     0     1791
                   0.00%    0.00%   34.38%    0.00%                0x18     0     1791
      Signed-off-by: NJiri Olsa <jolsa@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Joe Mario <jmario@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/20180309101442.9224-9-jolsa@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      d0802b1e
    • J
      perf c2c report: Display node for cacheline address · 7f834c2e
      Jiri Olsa 提交于
      Adding the NUMA node info for the data cacheline. Adding the new column
      to both "Shared Data Cache Line Table" and "Shared Cache Line
      Distribution Pareto".
      
      Note the new 'Node' column next to the 'Cacheline'.
      
        $ perf c2c report --stdio
        =================================================
                   Shared Data Cache Line Table
        =================================================
        #
        #                                    Total      Tot  ----- LLC Load Hitm -----
        # Index           Cacheline  Node  records     Hitm    Total      Lcl      Rmt
        # .....  ..................  ....  .......  .......  .......  .......  .......
        #
              0      0x7f0830100000     0       84   10.53%        8        8        0
              1  0xffff922a93154200     0        3    2.63%        2        2        0
              2  0xffff922a93154500     0        4    2.63%        2        2        0
        ...
      
      Note the new 'Node' column next to the 'Offset'.
      
        =================================================
              Shared Cache Line Distribution Pareto
        =================================================
        #
        #        ----- HITM -----  -- Store Refs --        Data address
        #   Num      Rmt      Lcl   L1 Hit  L1 Miss              Offset  Node      Pid
        # .....  .......  .......  .......  .......  ..................  ....  .......
        #
          -------------------------------------------------------------
              0        0        8       32        2      0x7f0830100000
          -------------------------------------------------------------
                   0.00%   75.00%   21.88%    0.00%                0x18     0     1791
                   0.00%   12.50%   37.50%    0.00%                0x18     0     1791
                   0.00%    0.00%   34.38%    0.00%                0x18     0     1791
      
      Using the mem2node object to get the NUMA node data.
      Signed-off-by: NJiri Olsa <jolsa@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Joe Mario <jmario@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/20180309101442.9224-8-jolsa@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      7f834c2e
    • J
      perf c2c report: Call calc_width() only for displayed entries · bc229c21
      Jiri Olsa 提交于
      There's no need to calculate column widths for entries that are not
      going to be displayed.
      Signed-off-by: NJiri Olsa <jolsa@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Joe Mario <jmario@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/20180309101442.9224-7-jolsa@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      bc229c21
    • J
      perf c2c report: Make calc_width work with struct c2c_hist_entry · 37731388
      Jiri Olsa 提交于
      We are going to calculate tje column width based on the struct
      c2c_hist_entry data, so making calc_width to work with struct
      c2c_hist_entry.
      Signed-off-by: NJiri Olsa <jolsa@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Joe Mario <jmario@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/20180309101442.9224-6-jolsa@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      37731388
    • J
      perf c2c record: Record physical addresses in samples · 8fab7843
      Jiri Olsa 提交于
      We are going to display NUMA node information in following patches. For
      this we need to have physical address data in the sample.
      
      Adding --phys-data as a default option for perf c2c record.
      Signed-off-by: NJiri Olsa <jolsa@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Joe Mario <jmario@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/20180309101442.9224-5-jolsa@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      8fab7843
    • J
      perf tests: Add mem2node object test · 8185850a
      Jiri Olsa 提交于
      Adding mem2node object automated test.
      
      The test prepares few artificial nodes - memory maps and verifies the
      mem2node object returns proper node values to given addresses.
      Signed-off-by: NJiri Olsa <jolsa@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/20180309101442.9224-4-jolsa@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      8185850a
    • J
      perf tools: Add mem2node object · 4acf6142
      Jiri Olsa 提交于
      Adding mem2node object to allow the easy lookup of the node for the
      physical address.
      
      It has following interface:
      
        int  mem2node__init(struct mem2node *map, struct perf_env *env);
        void mem2node__exit(struct mem2node *map);
        int  mem2node__node(struct mem2node *map, u64 addr);
      
      The mem2node__toolsinit initialize object from the perf data file
      MEM_TOPOLOGY feature data. Following calls to mem2node__node will return
      node number for given physical address. The mem2node__exit function
      frees the object.
      Signed-off-by: NJiri Olsa <jolsa@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/20180309101442.9224-3-jolsa@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      4acf6142
    • J
      perf env: Free memory nodes data · e725920c
      Jiri Olsa 提交于
      Forgot to free env's memory nodes, adding needed code to perf_env__exit.
      Signed-off-by: NJiri Olsa <jolsa@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/20180309101442.9224-2-jolsa@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      e725920c
  2. 13 3月, 2018 2 次提交
    • M
      perf/core: Implement fast breakpoint modification via _IOC_MODIFY_ATTRIBUTES · 32ff77e8
      Milind Chabbi 提交于
      Problem and motivation: Once a breakpoint perf event (PERF_TYPE_BREAKPOINT)
      is created, there is no flexibility to change the breakpoint type
      (bp_type), breakpoint address (bp_addr), or breakpoint length (bp_len). The
      only option is to close the perf event and configure a new breakpoint
      event. This inflexibility has a significant performance overhead. For
      example, sampling-based, lightweight performance profilers (and also
      concurrency bug detection tools),  monitor different addresses for a short
      duration using PERF_TYPE_BREAKPOINT and change the address (bp_addr) to
      another address or change the kind of breakpoint (bp_type) from  "write" to
      a "read" or vice-versa or change the length (bp_len) of the address being
      monitored. The cost of these modifications is prohibitive since it involves
      unmapping the circular buffer associated with the perf event, closing the
      perf event, opening another perf event and mmaping another circular buffer.
      
      Solution: The new ioctl flag for perf events,
      PERF_EVENT_IOC_MODIFY_ATTRIBUTES, introduced in this patch takes a pointer
      to a struct perf_event_attr as an argument to update an old breakpoint
      event with new address, type, and size. This facility allows retaining a
      previous mmaped perf events ring buffer and avoids having to close and
      reopen another perf event.
      
      This patch supports only changing PERF_TYPE_BREAKPOINT event type; future
      implementations can extend this feature. The patch replicates some of its
      functionality of modify_user_hw_breakpoint() in
      kernel/events/hw_breakpoint.c. modify_user_hw_breakpoint cannot be called
      directly since perf_event_ctx_lock() is already held in _perf_ioctl().
      
      Evidence: Experiments show that the baseline (not able to modify an already
      created breakpoint) costs an order of magnitude (~10x) more than the
      suggested optimization (having the ability to dynamically modifying a
      configured breakpoint via ioctl). When the breakpoints typically do not
      trap, the speedup due to the suggested optimization is ~10x; even when the
      breakpoints always trap, the speedup is ~4x due to the suggested
      optimization.
      
      Testing: tests posted at
      https://github.com/linux-contrib/perf_event_modify_bp demonstrate the
      performance significance of this patch. Tests also check the functional
      correctness of the patch.
      Signed-off-by: NMilind Chabbi <chabbi.milind@gmail.com>
      [ Using modify_user_hw_breakpoint_check function. ]
      [ Reformated PERF_EVENT_IOC_*, so the values are all in one column. ]
      Signed-off-by: NJiri Olsa <jolsa@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Hari Bathini <hbathini@linux.vnet.ibm.com>
      Cc: Jin Yao <yao.jin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Kan Liang <kan.liang@intel.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Oleg Nesterov <onestero@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Will Deacon <will.deacon@arm.com>
      Link: http://lkml.kernel.org/r/20180312134548.31532-8-jolsa@kernel.orgSigned-off-by: NIngo Molnar <mingo@kernel.org>
      32ff77e8
    • J
      perf tests: Add breakpoint accounting/modify test · 032db28e
      Jiri Olsa 提交于
      Adding test that:
      
        - detects the number of watch/break-points,
          skip test if any is missing
        - detects PERF_EVENT_IOC_MODIFY_ATTRIBUTES ioctl,
          skip test if it's missing
        - detects if watchpoints and breakpoints share
          same slots
        - create all possible watchpoints on cpu 0
        - change one of it to breakpoint
        - in case wp and bp do not share slots,
          we create another watchpoint to ensure
          the slot accounting is correct
      Signed-off-by: NJiri Olsa <jolsa@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Hari Bathini <hbathini@linux.vnet.ibm.com>
      Cc: Jin Yao <yao.jin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Kan Liang <kan.liang@intel.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Milind Chabbi <chabbi.milind@gmail.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Oleg Nesterov <onestero@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Will Deacon <will.deacon@arm.com>
      Link: http://lkml.kernel.org/r/20180312134548.31532-9-jolsa@kernel.orgSigned-off-by: NIngo Molnar <mingo@kernel.org>
      032db28e
  3. 08 3月, 2018 30 次提交