1. 07 Dec, 2015 4 commits
  2. 06 Dec, 2015 10 commits
  3. 04 Dec, 2015 1 commit
  4. 28 Nov, 2015 6 commits
    • Ingo Molnar's avatar
      Merge tag 'perf-core-for-mingo' of... · ac675d0d
      Ingo Molnar authored
      Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core
      
      Pull perf/core improvements and fixes from Arnaldo Carvalho de Melo:
      
      User visible changes:
      
        - Fix 'perf list' segfault due to lack of support for PERF_CONF_SW_BPF_OUTPUT
          in an array used just for printing available events, robustify the code
          involved (Arnaldo Carvalho de Melo)
      
        - 'perf test unwind' should create kernel maps, now that entry works and the
          test passes (Jiri Olsa)
      
        - Fix showing the running kernel build id in 'perf buildid-list' (Michael Petlan)
      
        - Fix command line symbol filtering in 'perf report' (Namhyung Kim)
      
      Infrastructure changes:
      
        - Extract and collect map info from BPF object files in libbpf (Wang Nan)
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      ac675d0d
    • Wang Nan's avatar
      perf bpf: Rename bpf config to program config · 0bb93490
      Wang Nan authored
      Following patches are going to introduce BPF object level configuration
      to enable setting values into BPF maps. To avoid confusion, this patch
      renames existing 'config' in bpf-loader.c to 'program config'. Following
      patches would introduce 'object config'.
      Signed-off-by: default avatarWang Nan <wangnan0@huawei.com>
      Cc: Alexei Starovoitov <ast@kernel.org>
      Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Zefan Li <lizefan@huawei.com>
      Cc: pi3orama@163.com
      Link: http://lkml.kernel.org/r/1448614067-197576-4-git-send-email-wangnan0@huawei.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      0bb93490
    • Wang Nan's avatar
      tools lib bpf: Extract and collect map names from BPF object file · 561bbcca
      Wang Nan authored
      This patch collects name of maps in BPF object files and saves them into
      'maps' field in 'struct bpf_object'. 'bpf_object__get_map_by_name' is
      introduced to retrive fd and definitions of a map through its name.
      Signed-off-by: default avatarHe Kuang <hekuang@huawei.com>
      Cc: Alexei Starovoitov <ast@kernel.org>
      Cc: He Kuang <hekuang@huawei.com>
      Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Zefan Li <lizefan@huawei.com>
      Cc: pi3orama@163.com
      Link: http://lkml.kernel.org/r/1448614067-197576-3-git-send-email-wangnan0@huawei.comSigned-off-by: default avatarWang Nan <wangnan0@huawei.com>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      561bbcca
    • Wang Nan's avatar
      tools lib bpf: Collect map definition in bpf_object · 9d759a9b
      Wang Nan authored
      This patch collects more information from maps sections in BPF object
      files into 'struct bpf_object', enables later patches access those
      information (such as the type and size of the map).
      
      In this patch, a new handler 'struct bpf_map' is extracted in parallel
      with bpf_object and bpf_program. Its iterator and accessor is also
      created.
      Signed-off-by: default avatarWang Nan <wangnan0@huawei.com>
      Cc: Alexei Starovoitov <ast@kernel.org>
      Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Zefan Li <lizefan@huawei.com>
      Cc: pi3orama@163.com
      Link: http://lkml.kernel.org/r/1448614067-197576-2-git-send-email-wangnan0@huawei.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      9d759a9b
    • Namhyung Kim's avatar
      perf hists browser: Update nr entries regardless of min percent · 03905048
      Namhyung Kim authored
      When perf report on TUI was called with -S symbol filter, it should
      update nr entries even if min_pcnt is 0.  IIRC the reason was to update
      nr entries after applying minimum percent threshold.  But if symbol
      filter was given on command line (with -S option), it should use
      hists->nr_non_filtered_entries instead of hists->nr_entries.
      
      So this patch fixes a bug of navigating hists browser that the cursor
      goes beyond the number of entries when -S (or similar) option is used.
      Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Tested-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1448645559-31167-3-git-send-email-namhyung@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      03905048
    • Namhyung Kim's avatar
      perf hists: Do not skip elided fields when processing samples · e72655d9
      Namhyung Kim authored
      If user gives a filter, perf marks the corresponding column elided and
      omits the output.  But it should process and aggregates samples using
      the field, otherwise samples will be aggregated as if the column was not
      there resulted in incorrect output.
      
      For example, I'd like to set a filter on native_write_msr_safe.  The
      original overhead of the function is negligible.
      
        $ perf report | grep native_write_msr_safe
            0.00%  swapper  [kernel.vmlinux]  native_write_msr_safe
            0.00%  perf     [kernel.vmlinux]  native_write_msr_safe
      
      However adding -S option gives different output.
      
        $ perf report -S native_write_msr_safe --percentage absolute | \
        > grep -e swapper -e perf
           51.47%  swapper  [kernel.vmlinux]
            4.14%  perf     [kernel.vmlinux]
      
      Since it aggregated samples using comm and dso only.  In fact, the above
      values are same when it sorts with -s comm,dso.
      
        $ perf report -s comm,dso | grep -e swapper -e perf
           51.47%  swapper  [kernel.vmlinux]
            4.14%  perf     [kernel.vmlinux]
      
      This resulted in TUI failure with -ERANGE since it tries to increase
      sample hit count for annotation with wrong symbols due to incorrect
      aggregation.
      
      This patch fixes it not to skip elided fields when comparing samples in
      order to insert them to the hists.
      
      Commiter note:
      
      After the patch, with a different workloads:
      
        # perf report --show-total-period -S native_write_msr_safe --stdio
        #
        # symbol: native_write_msr_safe
        #
        # Samples: 455  of event 'cycles:pp'
        # Event count (approx.): 134787489
        #
        # Overhead Period Command         Shared Object
        # ........ ...... ............... ................
        #
             0.22% 293081 qemu-system-x86 [vmlinux]
             0.19% 255914 swapper         [vmlinux]
             0.00%   2054 Timer           [vmlinux]
             0.00%   1021 firefox         [vmlinux]
             0.00%      2 perf            [vmlinux]
      
        # perf report --show-total-period | grep native_write_msr_safe
        Failed to open /tmp/perf-14838.map, continuing without symbols
             0.22% 293081 qemu-system-x86 [vmlinux]  [k] native_write_msr_safe
             0.19% 255914 swapper         [vmlinux]  [k] native_write_msr_safe
             0.00%   2054 Timer           [vmlinux]  [k] native_write_msr_safe
             0.00%   1021 firefox         [vmlinux]  [k] native_write_msr_safe
             0.00%      2 perf            [vmlinux]  [k] native_write_msr_safe
        #
      Reported-by: default avatarIngo Molnar <mingo@kernel.org>
      Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Tested-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1448645559-31167-2-git-send-email-namhyung@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      e72655d9
  5. 27 Nov, 2015 6 commits
    • Namhyung Kim's avatar
      perf report: Show error message when processing sample fails · 25b1606b
      Namhyung Kim authored
      Currently when perf fails to process samples for some reason, it doesn't
      show any message about the failure.  This is very inconvenient for users
      especially on TUI as screen is reset after the failure.
      Reported-by: default avatarIngo Molnar <mingo@kernel.org>
      Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1448645559-31167-1-git-send-email-namhyung@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      25b1606b
    • Arnaldo Carvalho de Melo's avatar
      perf list: Robustify event printing routine · e37df6c7
      Arnaldo Carvalho de Melo authored
      When a43eec30 ("bpf: introduce bpf_perf_event_output() helper") added
      PERF_COUNT_SW_BPF_OUTPUT we ended up with a new entry in the event_symbols_sw
      array that wasn't initialized, thus set to NULL, fix print_symbol_events()
      to check for that case so that we don't crash if this happens again.
      
        (gdb) bt
        #0  __match_glob (ignore_space=false, pat=<optimized out>, str=<optimized out>) at util/string.c:198
        #1  strglobmatch (str=<optimized out>, pat=pat@entry=0x7fffffffe61d "stall") at util/string.c:252
        #2  0x00000000004993a5 in print_symbol_events (type=1, syms=0x872880 <event_symbols_sw+160>, max=11, name_only=false, event_glob=0x7fffffffe61d "stall")
            at util/parse-events.c:1615
        #3  print_events (event_glob=event_glob@entry=0x7fffffffe61d "stall", name_only=false) at util/parse-events.c:1675
        #4  0x000000000042c79e in cmd_list (argc=1, argv=0x7fffffffe390, prefix=<optimized out>) at builtin-list.c:68
        #5  0x00000000004788a5 in run_builtin (p=p@entry=0x871758 <commands+120>, argc=argc@entry=2, argv=argv@entry=0x7fffffffe390) at perf.c:370
        #6  0x0000000000420ab0 in handle_internal_command (argv=0x7fffffffe390, argc=2) at perf.c:429
        #7  run_argv (argv=0x7fffffffe110, argcp=0x7fffffffe11c) at perf.c:473
        #8  main (argc=2, argv=0x7fffffffe390) at perf.c:588
        (gdb) p event_symbols_sw[PERF_COUNT_SW_BPF_OUTPUT]
        $4 = {symbol = 0x0, alias = 0x0}
        (gdb)
      
      A patch to robustify perf to not segfault when the next counter gets added in
      the kernel will follow this one.
      Reported-by: default avatarIngo Molnar <mingo@kernel.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexei Starovoitov <ast@kernel.org>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/n/tip-57wysblcjfrseb0zg5u7ek10@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      e37df6c7
    • Arnaldo Carvalho de Melo's avatar
      perf list: Add support for PERF_COUNT_SW_BPF_OUT · bae9cc41
      Arnaldo Carvalho de Melo authored
      When PERF_COUNT_SW_BPF_OUTPUT was added to the kernel we should've
      added it to tools/perf, where it is used just to list events.
      
      This ended up causing a segfault in commands like "perf list stall".
      
      Fix it by adding that new software counter.
      
      A patch to robustify perf to not segfault when the next counter gets
      added in the kernel will follow this one.
      Reported-by: default avatarIngo Molnar <mingo@kernel.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexei Starovoitov <ast@kernel.org>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/n/tip-uya354upi3eprsey6mi5962d@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      bae9cc41
    • Jiri Olsa's avatar
      perf test: 'unwind' test should create kernel maps · 9bdcede5
      Jiri Olsa authored
      The 'perf test unwind' is failing because it forgot to create the kernel
      maps, fix it.
      
      After the patch:
      
        # perf test unwind
        40: Test dwarf unwind         : Ok
      Reported-and-Tested-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: default avatarJiri Olsa <jolsa@redhat.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: http://lkml.kernel.org/r/20151127082121.GA24503@krava.brq.redhat.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      9bdcede5
    • Michael Petlan's avatar
      perf buildid-list: Show running kernel build id fix · c4e07949
      Michael Petlan authored
      The --kernel option of perf buildid-list tool should show the running
      kernel buildid.  The functionality has been lost during other changes of
      the related code.
      
      The build_id__sprintf() function should return length of the build-id
      string,  but it was the length of the build-id raw data instead. Due to
      that, some return value checking caused that the final string was not
      printed out.
      
      With this patch the build_id__sprintf() returns the correct value, so
      the --kernel option works again.
      
      Before:
      
      	# perf buildid-list --kernel
      	#
      
      After:
      
      	# perf buildid-list --kernel
      	972c1edab5bdc06cc224af45d510af662a3c6972
      	#
      Signed-off-by: default avatarMichael Petlan <mpetlan@redhat.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      LPU-Reference: 1448632089.24573.114.camel@redhat.com
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      c4e07949
    • Ingo Molnar's avatar
      Merge tag 'perf-core-for-mingo' of... · 3f3b1a46
      Ingo Molnar authored
      Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core
      
      Pull perf/core improvements and fixes from Arnaldo Carvalho de Melo:
      
      User visible changes:
      
        - Add 'vmlinux.debug' to the vmlinux search path (Ekaterina Tumanova)
      
        - Do not show sample_(type|period) in the perf_event_attr dump when using
          -v with 'perf stat' (Jiri Olsa)
      
        - Display the WEIGHT sample bit, when set, in 'perf evlist -v' (Jiri Olsa)
      
        - Honour --hide-unresolved in 'report', will honour it as well in 'top'
          when --hide-unresolved gets supported in that tool (Namhyung Kim)
      
        - Fix freeze wit h--call-graph 'flat/folded' due to not properly
          reinitializing the callchain rb_tree (Namhyumg Kim)
      
        - Set dso->long_name when a module name is passed as a parameter
          to tools like 'perf probe' but the 'struct dso' associated to that module
          still doesn't have the full path for the module, just the '[name]' one
          obtained from /proc/modules (Wang Nan)
      
        - Fix anon_hugepage mmaps detection using scanf on /proc/PID/smaps (Yannick Brosseau)
      
      Infrastructure changes:
      
        - Add helper function for updating bpf maps elements (He Kuang)
      
        - Fix traceevents plugins build race (Jiri Olsa)
      
        - Add the $OUTPUT path prefix with 'fixdep' (Jiri Olsa)
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      3f3b1a46
  6. 26 Nov, 2015 13 commits