1. 01 12月, 2020 13 次提交
  2. 30 11月, 2020 10 次提交
  3. 28 11月, 2020 5 次提交
    • M
      perf probe: Change function definition check due to broken DWARF · a9ffd048
      Masami Hiramatsu 提交于
      Since some gcc generates a broken DWARF which lacks DW_AT_declaration
      attribute from the subprogram DIE of function prototype.
      (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97060)
      
      So, in addition to the DW_AT_declaration check, we also check the
      subprogram DIE has DW_AT_inline or actual entry pc.
      
      Committer testing:
      
        # cat /etc/fedora-release
        Fedora release 33 (Thirty Three)
        #
      
      Before:
      
        # perf test vfs_getname
        78: Use vfs_getname probe to get syscall args filenames             : FAILED!
        79: Check open filename arg using perf trace + vfs_getname          : FAILED!
        81: Add vfs_getname probe to get syscall args filenames             : FAILED!
        #
      
      After:
      
        # perf test vfs_getname
        78: Use vfs_getname probe to get syscall args filenames             : Ok
        79: Check open filename arg using perf trace + vfs_getname          : Ok
        81: Add vfs_getname probe to get syscall args filenames             : Ok
        #
      Reported-by: NThomas Richter <tmricht@linux.ibm.com>
      Signed-off-by: NMasami Hiramatsu <mhiramat@kernel.org>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Sumanth Korikkar <sumanthk@linux.ibm.com>
      Link: http://lore.kernel.org/lkml/160645613571.2824037.7441351537890235895.stgit@devnote2Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      a9ffd048
    • M
      perf probe: Fix to die_entrypc() returns error correctly · ab4200c1
      Masami Hiramatsu 提交于
      Fix die_entrypc() to return error correctly if the DIE has no
      DW_AT_ranges attribute. Since dwarf_ranges() will treat the case as an
      empty ranges and return 0, we have to check it by ourselves.
      
      Fixes: 91e2f539 ("perf probe: Fix to show function entry line as probe-able")
      Signed-off-by: NMasami Hiramatsu <mhiramat@kernel.org>
      Cc: Sumanth Korikkar <sumanthk@linux.ibm.com>
      Cc: Thomas Richter <tmricht@linux.ibm.com>
      Link: http://lore.kernel.org/lkml/160645612634.2824037.5284932731175079426.stgit@devnote2Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      ab4200c1
    • N
      perf stat: Use proper cpu for shadow stats · c0ee1d5a
      Namhyung Kim 提交于
      Currently perf stat shows some metrics (like IPC) for defined events.
      But when no aggregation mode is used (-A option), it shows incorrect
      values since it used a value from a different cpu.
      
      Before:
      
        $ perf stat -aA -e cycles,instructions sleep 1
      
         Performance counter stats for 'system wide':
      
        CPU0      116,057,380      cycles
        CPU1       86,084,722      cycles
        CPU2       99,423,125      cycles
        CPU3       98,272,994      cycles
        CPU0       53,369,217      instructions      #    0.46  insn per cycle
        CPU1       33,378,058      instructions      #    0.29  insn per cycle
        CPU2       58,150,086      instructions      #    0.50  insn per cycle
        CPU3       40,029,703      instructions      #    0.34  insn per cycle
      
             1.001816971 seconds time elapsed
      
      So the IPC for CPU1 should be 0.38 (= 33,378,058 / 86,084,722)
      but it was 0.29 (= 33,378,058 / 116,057,380) and so on.
      
      After:
      
        $ perf stat -aA -e cycles,instructions sleep 1
      
         Performance counter stats for 'system wide':
      
        CPU0      109,621,384      cycles
        CPU1      159,026,454      cycles
        CPU2       99,460,366      cycles
        CPU3      124,144,142      cycles
        CPU0       44,396,706      instructions      #    0.41  insn per cycle
        CPU1      120,195,425      instructions      #    0.76  insn per cycle
        CPU2       44,763,978      instructions      #    0.45  insn per cycle
        CPU3       69,049,079      instructions      #    0.56  insn per cycle
      
             1.001910444 seconds time elapsed
      
      Fixes: 44d49a60 ("perf stat: Support metrics in --per-core/socket mode")
      Reported-by: NSam Xi <xyzsam@google.com>
      Signed-off-by: NNamhyung Kim <namhyung@kernel.org>
      Reviewed-by: NAndi Kleen <ak@linux.intel.com>
      Acked-by: NJiri Olsa <jolsa@redhat.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lore.kernel.org/lkml/20201127041404.390276-1-namhyung@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      c0ee1d5a
    • N
      perf record: Synthesize cgroup events only if needed · aa50d953
      Namhyung Kim 提交于
      It didn't check the tool->cgroup_events bit which is set when the
      --all-cgroups option is given.  Without it, samples will not have cgroup
      info so no reason to synthesize.
      
      We can check the PERF_RECORD_CGROUP records after running perf record
      *WITHOUT* the --all-cgroups option:
      
      Before:
      
        $ perf report -D | grep CGROUP
        0 0 0x8430 [0x38]: PERF_RECORD_CGROUP cgroup: 1 /
                CGROUP events:          1
                CGROUP events:          0
                CGROUP events:          0
      
      After:
      
        $ perf report -D | grep CGROUP
                CGROUP events:          0
                CGROUP events:          0
                CGROUP events:          0
      
      Committer testing:
      
      Before:
      
        # perf record -a sleep 1
        [ perf record: Woken up 1 times to write data ]
        [ perf record: Captured and wrote 2.208 MB perf.data (10003 samples) ]
        # perf report -D | grep "CGROUP events"
                  CGROUP events:        146
                  CGROUP events:          0
                  CGROUP events:          0
        #
      
      After:
      
        # perf record -a sleep 1
        [ perf record: Woken up 1 times to write data ]
        [ perf record: Captured and wrote 2.208 MB perf.data (10448 samples) ]
        # perf report -D | grep "CGROUP events"
                  CGROUP events:          0
                  CGROUP events:          0
                  CGROUP events:          0
        #
      
      With all-cgroups:
      
        # perf record --all-cgroups -a sleep 1
        [ perf record: Woken up 1 times to write data ]
        [ perf record: Captured and wrote 2.374 MB perf.data (11526 samples) ]
        # perf report -D | grep "CGROUP events"
                  CGROUP events:        146
                  CGROUP events:          0
                  CGROUP events:          0
        #
      
      Fixes: 8fb4b679 ("perf record: Add --all-cgroups option")
      Signed-off-by: NNamhyung Kim <namhyung@kernel.org>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Acked-by: NJiri Olsa <jolsa@redhat.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lore.kernel.org/lkml/20201127054356.405481-1-namhyung@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      aa50d953
    • A
      perf tools: Update copy of libbpf's hashmap.c · 3b13eaf0
      Arnaldo Carvalho de Melo 提交于
      To pick the changes in:
      
        7a078d2d ("libbpf, hashmap: Fix undefined behavior in hash_bits")
      
      That don't entail any changes in tools/perf.
      
      This addresses this perf build warning:
      
        Warning: Kernel ABI header at 'tools/perf/util/hashmap.h' differs from latest version at 'tools/lib/bpf/hashmap.h'
        diff -u tools/perf/util/hashmap.h tools/lib/bpf/hashmap.h
      
      Not a kernel ABI, its just that this uses the mechanism in place for
      checking kernel ABI files drift.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Daniel Borkmann <daniel@iogearbox.net>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      3b13eaf0
  4. 27 11月, 2020 9 次提交
  5. 26 11月, 2020 3 次提交