1. 17 2月, 2018 22 次提交
  2. 16 2月, 2018 13 次提交
    • Y
      perf stat: Add support to print counts after a period of time · f1f8ad52
      yuzhoujian 提交于
      Introduce a new option to print counts after N milliseconds and update
      'perf stat' documentation accordingly.
      
      Show below is the output of the new option for perf stat.
      
        $ perf stat --time 2000 -e cycles -a
        Performance counter stats for 'system wide':
      
              157,260,423      cycles
      
              2.003060766 seconds time elapsed
      
      We can print the count deltas after N milliseconds with this new
      introduced option. This option is not supported with "-I" option.
      
      In addition, according to Kangliang's patch(19afd104), the
      monitoring overhead for system-wide core event could be very high if the
      interval-print parameter was below 100ms, and the limitation value is
      10ms.
      
      So the same warning will be displayed when the time is set between 10ms
      to 100ms, and the minimal time is limited to 10ms. Users can make a
      decision according to their spcific cases.
      
      Committer notes:
      
      This actually stops the workload after the specified time, then prints
      the counts.
      
      So I renamed the option to --timeout and updated the documentation to
      state that it will not just print the counts after the specified time,
      but will really stop the 'perf stat' session and print the counts.
      
      The rename from 'time' to 'timeout' also fixes the build in systems
      where 'time' is used by glibc and can't be used as a name of a variable,
      such as centos:5 and centos:6.
      
      Changes since v3:
      - none.
      
      Changes since v2:
      - modify the time check in __run_perf_stat func to keep some consistency
        with the workload case.
      - add the warning when the time is set between 10ms to 100ms.
      - add the pr_err when the time is set below 10ms.
      
      Changes since v1:
      - none.
      Signed-off-by: Nyuzhoujian <yuzhoujian@didichuxing.com>
      Acked-by: NJiri Olsa <jolsa@kernel.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Kan Liang <kan.liang@intel.com>
      Cc: Milian Wolff <milian.wolff@kdab.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/r/1517217923-8302-3-git-send-email-ufo19890607@gmail.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      f1f8ad52
    • Y
      perf stat: Add support to print counts for fixed times · db06a269
      yuzhoujian 提交于
      Introduce a new option to print counts for fixed number of times and
      update 'perf stat' documentation accordingly.
      
      Show below is the output of the new option for perf stat.
      
        $ perf stat -I 1000 --interval-count 2 -e cycles -a
        #           time             counts unit events
                 1.002827089         93,884,870      cycles
                 2.004231506         56,573,446      cycles
      
      We can just print the counts for several times with this newly
      introduced option. The usage of it is a little like 'vmstat', and it
      should be used together with "-I" option.
      
        $ vmstat -n 1 2
        procs ---------memory-------------- --swap- ----io-- -system-- ------cpu---
         r  b swpd   free   buff   cache    si   so  bi   bo  in   cs us sy id wa st
         0  0    0 78270544 547484 51732076  0   0   0   20    1    1  1  0 99  0 0
         0  0    0 78270512 547484 51732080  0   0   0   16  477 1555  0  0 100 0 0
      
      Changes since v3:
      - merge interval_count check and times check to one line.
      - fix the wrong indent in stat.h
      - use stat_config.times instead of 'times' in cmd_stat function.
      
      Changes since v2:
      - none.
      
      Changes since v1:
      - change the name of the new option "times-print" to "interval-count".
      - keep the new option interval specifically.
      Signed-off-by: Nyuzhoujian <yuzhoujian@didichuxing.com>
      Acked-by: NJiri Olsa <jolsa@kernel.org>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Kan Liang <kan.liang@intel.com>
      Cc: Milian Wolff <milian.wolff@kdab.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/r/1517217923-8302-2-git-send-email-ufo19890607@gmail.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      db06a269
    • J
      perf report: Add support to display group output for non group events · ad52b8cb
      Jiri Olsa 提交于
      Add support to display group output for if non grouped events are
      detected and user forces --group option. Now for non-group events
      recorded like:
      
        $ perf record -e 'cycles,instructions' ls
      
      you can still get group output by using --group option
      in report:
      
        $ perf report --group --stdio
        ...
        #         Overhead  Command  Shared Object     Symbol
        # ................  .......  ................  ......................
        #
            17.67%   0.00%  ls       libc-2.25.so      [.] _IO_do_write@@GLIB
            15.59%  25.94%  ls       ls                [.] calculate_columns
            15.41%  31.35%  ls       libc-2.25.so      [.] __strcoll_l
        ...
      
      Committer note:
      
      We should improve on this by making sure that the first line states that
      this is not a group, but since the user doesn't have to force group view
      when really using grouped events (e.g. '{cycles,instructions}'), the
      user better know what is being done...
      Requested-by: NStephane Eranian <eranian@google.com>
      Signed-off-by: NJiri Olsa <jolsa@kernel.org>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Tested-by: NStephane Eranian <eranian@google.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andi Kleen <ak@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/20180209092734.GB20449@kravaSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      ad52b8cb
    • J
      perf report: Ask for ordered events for --tasks option · 8614ada0
      Jiri Olsa 提交于
      If we have the time in, keep the events in time order.
      
      Committer notes:
      
      Trying to be more verbose, what actual effect this will have in this particular
      case?
      
      Before and after this patch shows the artifacts:
      
        --- /tmp/before 2018-02-06 15:40:29.536411625 -0300
        +++ /tmp/after  2018-02-06 15:40:51.963403599 -0300
        @@ -5,34 +5,34 @@
               2540     2540     1818 |   gnome-terminal-
               3489     3489     2540 |    bash
              32433    32433     3489 |     perf
        -     32434    32434    32433 |      perf
        +     32434    32434    32433 |      make
              32441    32441    32434 |       make
              32514    32514    32441 |        make
                511      511    32514 |         sh
        -       512      512      511 |          sh
        +       512      512      511 |          install
      <SNIP>
      
      We don't have 'perf' calling 'perf' calling 'make', etc, the second
      'perf' actually is 'make', i.e.  there was reordering of the relevant
      PERF_RECORD_COMM and PERF_RECORD_FORK records.
      
      Ditto for sh/install later on.
      
      Look for FORK and COMM meta events, for those tids:
      
        # perf report -D | egrep 'PERF_RECORD_(FORK|COMM)' | egrep '3243[34]'
        0 14774650990679 0x1a3cd8 [0x38]: PERF_RECORD_FORK(32433:32433):(3489:3489)
        1 14774652080381 0x1d6568 [0x30]: PERF_RECORD_COMM exec: perf:32433/32433
        1 14774742473340 0x1dbb48 [0x38]: PERF_RECORD_FORK(32434:32434):(32433:32433)
        0 14774752005779 0x1a4af8 [0x30]: PERF_RECORD_COMM exec: make:32434/32434
        0 14774753997960 0x1a5578 [0x38]: PERF_RECORD_FORK(32435:32435):(32434:32434)
        0 14774756070782 0x1a5618 [0x38]: PERF_RECORD_FORK(32438:32438):(32434:32434)
        0 14774757772939 0x1a5680 [0x38]: PERF_RECORD_FORK(32440:32440):(32434:32434)
        0 14774758230600 0x1a56e8 [0x38]: PERF_RECORD_FORK(32441:32441):(32434:32434)
        #
      
      First column is the cpu, second is the timestamp.
      
      So they are on different CPUs, thus ring buffers, and when we don't use
      the ordered_events class, we end up mixing that up, use it to take
      advantage of the PERF_RECORD_FINISHED_ROUND meta events to go on
      ordering the events using the PERF_SAMPLE_TIME present in the
      PERF_RECORD_{FORK,COMM,EXIT,SAMPLE,etc} records in the ring buffer.
      Signed-off-by: NJiri Olsa <jolsa@kernel.org>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      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/20180206181813.10943-2-jolsa@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      8614ada0
    • J
      perf tools: Fix comment for sort__* compare functions · a7402c94
      Jiri Olsa 提交于
      In commit 2f15bd8c ("perf tools: Fix "Command" sort_entry's cmp and
      collapse function") we switched from pointer to string comparison.
      
      But failed to remove related comments. Removing them and adding another
      one to warn before pointer comparison in here.
      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/20180206181813.10943-18-jolsa@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      a7402c94
    • J
      perf tests: Fix dwarf unwind for stripped binaries · fdf7c49c
      Jiri Olsa 提交于
      When we strip the perf binary, dwarf unwind test stop
      to work. The reason is that strip will remove static
      function symbols, which we need to check for unwind.
      
      This change will keep this test working in cases where
      the global symbols are put into dynamic symbol table,
      which is the case on x86. It still won't work on powerpc.
      
      Making those 5 local functions global, and adding
      'test_dwarf_unwind__' to their names.
      
      Committer testing:
      
      Before:
      
        # perf test dwarf
        58: DWARF unwind                               : Ok
        # strip ~/bin/perf
        # perf test dwarf
        58: DWARF unwind                               : FAILED!
        # perf test -v dwarf
        58: DWARF unwind                               :
        --- start ---
        test child forked, pid 6590
        unwind: thread map already set, dso=/home/acme/bin/perf
        <SNIP>
        unwind: access_mem addr 0x7ffce6c48098 val 48563f, offset 1144
        unwind: test__dwarf_unwind:ip = 0x4a54e5 (0xa54e5)
        got: test__dwarf_unwind 0xa54e5, expecting test__dwarf_unwind
        unwind: '':ip = 0x4a50bb (0xa50bb)
        failed: got unresolved address 0xa50bb
        unwind failed
        test child finished with -1
        ---- end ----
        DWARF unwind: FAILED!
        #
      
      After:
      
        # perf test dwarf
        58: DWARF unwind                               : Ok
        # strip ~/bin/perf
        # perf test dwarf
        58: DWARF unwind                               : Ok
        #
        # perf test -v dwarf
        58: DWARF unwind                               :
        --- start ---
        test child forked, pid 7219
        unwind: thread map already set, dso=/home/acme/bin/perf
        <SNIP>
        unwind: access_mem addr 0x7fff007da2c8 val 48575f, offset 1144
        unwind: test__arch_unwind_sample:ip = 0x589044 (0x189044)
        got: test__arch_unwind_sample 0x189044, expecting test__arch_unwind_sample
        unwind: test_dwarf_unwind__thread:ip = 0x4a52f7 (0xa52f7)
        got: test_dwarf_unwind__thread 0xa52f7, expecting test_dwarf_unwind__thread
        unwind: test_dwarf_unwind__compare:ip = 0x4a5468 (0xa5468)
        got: test_dwarf_unwind__compare 0xa5468, expecting test_dwarf_unwind__compare
        unwind: bsearch:ip = 0x7f6608ae94d8 (0x394d8)
        got: bsearch 0x394d8, expecting bsearch
        unwind: test_dwarf_unwind__krava_3:ip = 0x4a54d1 (0xa54d1)
        got: test_dwarf_unwind__krava_3 0xa54d1, expecting test_dwarf_unwind__krava_3
        unwind: test_dwarf_unwind__krava_2:ip = 0x4a550b (0xa550b)
        got: test_dwarf_unwind__krava_2 0xa550b, expecting test_dwarf_unwind__krava_2
        unwind: test_dwarf_unwind__krava_1:ip = 0x4a554b (0xa554b)
        got: test_dwarf_unwind__krava_1 0xa554b, expecting test_dwarf_unwind__krava_1
        unwind: test__dwarf_unwind:ip = 0x4a5605 (0xa5605)
        got: test__dwarf_unwind 0xa5605, expecting test__dwarf_unwind
        test child finished with 0
        ---- end ----
        DWARF unwind: Ok
        #
      Signed-off-by: NJiri Olsa <jolsa@kernel.org>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      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/20180206181813.10943-17-jolsa@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      fdf7c49c
    • J
      tools lib api fs: Add sysfs__read_xll function · d9c5f322
      Jiri Olsa 提交于
      Adding sysfs__read_xll function to be able to read sysfs files with hex
      numbers in, which do not have 0x prefix.
      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/20180206181813.10943-6-jolsa@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      d9c5f322
    • J
      tools lib api fs: Add filename__read_xll function · 6baddfc6
      Jiri Olsa 提交于
      Adding filename__read_xll function to be able to read files with hex
      numbers in, which do not have 0x prefix.
      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/20180206181813.10943-5-jolsa@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      6baddfc6
    • J
      perf script: Add --show-round-event to display PERF_RECORD_FINISHED_ROUND · 3233b37a
      Jiri Olsa 提交于
      Adding --show-round-event to display PERF_RECORD_FINISHED_ROUND events
      like:
      
        # perf script --show-round-events 2>/dev/null
                     yes  8591 [002] 124177.397597:         18         cpu/mem-stores/P: ff...
                     yes  8591 [002] 124177.397615:          1 cpu/mem-loads,ldlat=30/P: ff...
        PERF_RECORD_FINISHED_ROUND
                    perf 10380 [001] 124177.397622:          6 cpu/mem-loads,ldlat=30/P: ff...
        PERF_RECORD_FINISHED_ROUND
                 swapper     0 [000] 124177.400518:         88         cpu/mem-stores/P: ff...
                 swapper     0 [000] 124177.400521:         88         cpu/mem-stores/P: ff...
      Signed-off-by: NJiri Olsa <jolsa@kernel.org>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      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/20180206181813.10943-4-jolsa@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      3233b37a
    • J
      perf record: Put new line after target override warning · c3dec27b
      Jiri Olsa 提交于
      There's no new-line after target-override warning, now:
      
        $ perf record -a --per-thread
        Warning:
        SYSTEM/CPU switch overriding PER-THREAD^C[ perf record: Woken up 1 times to write data ]
        [ perf record: Captured and wrote 0.705 MB perf.data (2939 samples) ]
      
      with patch:
      
        $ perf record -a --per-thread
        Warning:
        SYSTEM/CPU switch overriding PER-THREAD
        ^C[ perf record: Woken up 1 times to write data ]
        [ perf record: Captured and wrote 0.705 MB perf.data (2939 samples) ]
      Signed-off-by: NJiri Olsa <jolsa@kernel.org>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      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>
      Fixes: 16ad2ffb ("perf tools: Introduce perf_target__strerror()")
      Link: http://lkml.kernel.org/r/20180206181813.10943-3-jolsa@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      c3dec27b
    • J
      kprobes: Propagate error from disarm_kprobe_ftrace() · 297f9233
      Jessica Yu 提交于
      Improve error handling when disarming ftrace-based kprobes. Like with
      arm_kprobe_ftrace(), propagate any errors from disarm_kprobe_ftrace() so
      that we do not disable/unregister kprobes that are still armed. In other
      words, unregister_kprobe() and disable_kprobe() should not report success
      if the kprobe could not be disarmed.
      
      disarm_all_kprobes() keeps its current behavior and attempts to
      disarm all kprobes. It returns the last encountered error and gives a
      warning if not all probes could be disarmed.
      
      This patch is based on Petr Mladek's original patchset (patches 2 and 3)
      back in 2015, which improved kprobes error handling, found here:
      
         https://lkml.org/lkml/2015/2/26/452
      
      However, further work on this had been paused since then and the patches
      were not upstreamed.
      Based-on-patches-by: NPetr Mladek <pmladek@suse.com>
      Signed-off-by: NJessica Yu <jeyu@kernel.org>
      Acked-by: NMasami Hiramatsu <mhiramat@kernel.org>
      Cc: Ananth N Mavinakayanahalli <ananth@linux.vnet.ibm.com>
      Cc: Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>
      Cc: David S . Miller <davem@davemloft.net>
      Cc: Jiri Kosina <jikos@kernel.org>
      Cc: Joe Lawrence <joe.lawrence@redhat.com>
      Cc: Josh Poimboeuf <jpoimboe@redhat.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Miroslav Benes <mbenes@suse.cz>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Petr Mladek <pmladek@suse.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: live-patching@vger.kernel.org
      Link: http://lkml.kernel.org/r/20180109235124.30886-3-jeyu@kernel.orgSigned-off-by: NIngo Molnar <mingo@kernel.org>
      297f9233
    • J
      kprobes: Propagate error from arm_kprobe_ftrace() · 12310e34
      Jessica Yu 提交于
      Improve error handling when arming ftrace-based kprobes. Specifically, if
      we fail to arm a ftrace-based kprobe, register_kprobe()/enable_kprobe()
      should report an error instead of success. Previously, this has lead to
      confusing situations where register_kprobe() would return 0 indicating
      success, but the kprobe would not be functional if ftrace registration
      during the kprobe arming process had failed. We should therefore take any
      errors returned by ftrace into account and propagate this error so that we
      do not register/enable kprobes that cannot be armed. This can happen if,
      for example, register_ftrace_function() finds an IPMODIFY conflict (since
      kprobe_ftrace_ops has this flag set) and returns an error. Such a conflict
      is possible since livepatches also set the IPMODIFY flag for their ftrace_ops.
      
      arm_all_kprobes() keeps its current behavior and attempts to arm all
      kprobes. It returns the last encountered error and gives a warning if
      not all probes could be armed.
      
      This patch is based on Petr Mladek's original patchset (patches 2 and 3)
      back in 2015, which improved kprobes error handling, found here:
      
         https://lkml.org/lkml/2015/2/26/452
      
      However, further work on this had been paused since then and the patches
      were not upstreamed.
      Based-on-patches-by: NPetr Mladek <pmladek@suse.com>
      Signed-off-by: NJessica Yu <jeyu@kernel.org>
      Acked-by: NMasami Hiramatsu <mhiramat@kernel.org>
      Cc: Ananth N Mavinakayanahalli <ananth@linux.vnet.ibm.com>
      Cc: Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>
      Cc: David S . Miller <davem@davemloft.net>
      Cc: Jiri Kosina <jikos@kernel.org>
      Cc: Joe Lawrence <joe.lawrence@redhat.com>
      Cc: Josh Poimboeuf <jpoimboe@redhat.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Miroslav Benes <mbenes@suse.cz>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Petr Mladek <pmladek@suse.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: live-patching@vger.kernel.org
      Link: http://lkml.kernel.org/r/20180109235124.30886-2-jeyu@kernel.orgSigned-off-by: NIngo Molnar <mingo@kernel.org>
      12310e34
    • I
      Merge tag 'perf-core-for-mingo-4.17-20180215' of... · 3f9e6463
      Ingo Molnar 提交于
      Merge tag 'perf-core-for-mingo-4.17-20180215' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent
      
      Pull perf/core fixes from Arnaldo Carvalho de Melo:
      
      - perf_mmap overwrite mode fixes/overhaul, prep work to get 'perf top'
        using it, making it bearable to use it in large core count systems
        such as Knights Landing/Mill Intel systems (Kan Liang)
      
      - s/390 now uses syscall.tbl, just like x86-64 to generate the syscall
        table id -> string tables used by 'perf trace' (Hendrik Brueckner)
      
      - Use strtoull() instead of home grown function (Andy Shevchenko)
      
      - Synchronize kernel ABI headers, v4.16-rc1 (Ingo Molnar)
      
      - Document missing 'perf data --force' option (Sangwon Hong)
      
      - Add perf vendor JSON metrics for ARM Cortex-A53 Processor (William Cohen)
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      3f9e6463
  3. 15 2月, 2018 5 次提交
    • H
      Revert "tools include s390: Grab a copy of arch/s390/include/uapi/asm/unistd.h" · f1d0b4cd
      Hendrik Brueckner 提交于
      This reverts commit f120c7b187e6c418238710b48723ce141f467543 which is no
      longer required with the introduction of a syscall.tbl on s390.
      Signed-off-by: NHendrik Brueckner <brueckner@linux.vnet.ibm.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Michael Petlan <mpetlan@redhat.com>
      Cc: Thomas Richter <tmricht@linux.vnet.ibm.com>
      Cc: linux-s390@vger.kernel.org
      LPU-Reference: 1518090470-2899-2-git-send-email-brueckner@linux.vnet.ibm.com
      Link: https://lkml.kernel.org/n/tip-q1lg0nvhha1tk39ri9aqalcb@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      f1d0b4cd
    • H
      perf s390: Rework system call table creation by using syscall.tbl · 690d22d9
      Hendrik Brueckner 提交于
      Recently, s390 uses a syscall.tbl input file to generate its system call
      table and unistd uapi header files.  Hence, update mksyscalltbl to use
      it as input to create the system table for perf.
      Signed-off-by: NHendrik Brueckner <brueckner@linux.vnet.ibm.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Michael Petlan <mpetlan@redhat.com>
      Cc: Thomas Richter <tmricht@linux.vnet.ibm.com>
      Cc: linux-s390@vger.kernel.org
      LPU-Reference: 1518090470-2899-4-git-send-email-brueckner@linux.vnet.ibm.com
      Link: https://lkml.kernel.org/n/tip-bdyhllhsq1zgxv2qx4m377y6@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      690d22d9
    • H
      perf s390: Grab a copy of arch/s390/kernel/syscall/syscall.tbl · baa67610
      Hendrik Brueckner 提交于
      Grab a copy of the s390 system call table file introduced with commit
      857f46bf "s390/syscalls: add system call
      table".
      Signed-off-by: NHendrik Brueckner <brueckner@linux.vnet.ibm.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Michael Petlan <mpetlan@redhat.com>
      Cc: Thomas Richter <tmricht@linux.vnet.ibm.com>
      Cc: linux-s390@vger.kernel.org
      LPU-Reference: 1518090470-2899-3-git-send-email-brueckner@linux.vnet.ibm.com
      Link: https://lkml.kernel.org/n/tip-hpw7vdjp7g92ivgpddrp5ydq@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      baa67610
    • I
      tools/headers: Synchronize kernel ABI headers, v4.16-rc1 · f091f1d6
      Ingo Molnar 提交于
      Sync the following tooling headers with the latest kernel version:
      
        tools/arch/powerpc/include/uapi/asm/kvm.h
        tools/arch/x86/include/asm/cpufeatures.h
        tools/include/uapi/drm/i915_drm.h
        tools/include/uapi/linux/if_link.h
        tools/include/uapi/linux/kvm.h
      
      All the changes are new ABI additions which don't impact their use
      in existing tooling.
      
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Stephen Rothwell <sfr@canb.auug.org.au>
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      f091f1d6
    • T
      perf test: Fix test trace+probe_libc_inet_pton.sh for s390x · 7a924536
      Thomas Richter 提交于
      On Intel test case trace+probe_libc_inet_pton.sh succeeds and the
      output is:
      
      [root@f27 perf]# ./perf trace --no-syscalls
                        -e probe_libc:inet_pton/max-stack=3/ ping -6 -c 1 ::1
      PING ::1(::1) 56 data bytes
      64 bytes from ::1: icmp_seq=1 ttl=64 time=0.037 ms
      
       --- ::1 ping statistics ---
      1 packets transmitted, 1 received, 0% packet loss, time 0ms
      rtt min/avg/max/mdev = 0.037/0.037/0.037/0.000 ms
           0.000 probe_libc:inet_pton:(7fa40ac618a0))
                    __GI___inet_pton (/usr/lib64/libc-2.26.so)
                    getaddrinfo (/usr/lib64/libc-2.26.so)
                    main (/usr/bin/ping)
      
      The kernel stack unwinder is used, it is specified implicitly
      as call-graph=fp (frame pointer).
      
      On s390x only dwarf is available for stack unwinding. It is also
      done in user space. This requires different parameter setup
      and result checking for s390x and Intel.
      
      This patch adds separate perf trace setup and result checking
      for Intel and s390x. On s390x specify this command line to
      get a call-graph and handle the different call graph result
      checking:
      
      [root@s35lp76 perf]# ./perf trace --no-syscalls
      	-e probe_libc:inet_pton/call-graph=dwarf/ ping -6 -c 1 ::1
      PING ::1(::1) 56 data bytes
      64 bytes from ::1: icmp_seq=1 ttl=64 time=0.041 ms
      
       --- ::1 ping statistics ---
      1 packets transmitted, 1 received, 0% packet loss, time 0ms
      rtt min/avg/max/mdev = 0.041/0.041/0.041/0.000 ms
           0.000 probe_libc:inet_pton:(3ffb9942060))
                  __GI___inet_pton (/usr/lib64/libc-2.26.so)
                  gaih_inet (inlined)
                  __GI_getaddrinfo (inlined)
                  main (/usr/bin/ping)
                  __libc_start_main (/usr/lib64/libc-2.26.so)
                  _start (/usr/bin/ping)
      [root@s35lp76 perf]#
      
      Before:
      [root@s8360047 perf]# ./perf test -vv 58
      58: probe libc's inet_pton & backtrace it with ping       :
       --- start ---
      test child forked, pid 26349
      PING ::1(::1) 56 data bytes
      64 bytes from ::1: icmp_seq=1 ttl=64 time=0.079 ms
       --- ::1 ping statistics ---
      1 packets transmitted, 1 received, 0% packet loss, time 0ms
      rtt min/avg/max/mdev = 0.079/0.079/0.079/0.000 ms
      0.000 probe_libc:inet_pton:(3ff925c2060))
      test child finished with -1
       ---- end ----
      probe libc's inet_pton & backtrace it with ping: FAILED!
      [root@s8360047 perf]#
      
      After:
      [root@s35lp76 perf]# ./perf test -vv 57
      57: probe libc's inet_pton & backtrace it with ping       :
       --- start ---
      test child forked, pid 38708
      PING ::1(::1) 56 data bytes
      64 bytes from ::1: icmp_seq=1 ttl=64 time=0.038 ms
       --- ::1 ping statistics ---
      1 packets transmitted, 1 received, 0% packet loss, time 0ms
      rtt min/avg/max/mdev = 0.038/0.038/0.038/0.000 ms
      0.000 probe_libc:inet_pton:(3ff87342060))
      __GI___inet_pton (/usr/lib64/libc-2.26.so)
      gaih_inet (inlined)
      __GI_getaddrinfo (inlined)
      main (/usr/bin/ping)
      __libc_start_main (/usr/lib64/libc-2.26.so)
      _start (/usr/bin/ping)
      test child finished with 0
       ---- end ----
      probe libc's inet_pton & backtrace it with ping: Ok
      [root@s35lp76 perf]#
      
      On Intel the test case runs unchanged and succeeds.
      Signed-off-by: NThomas Richter <tmricht@linux.vnet.ibm.com>
      Reviewed-by: NHendrik Brueckner <brueckner@linux.vnet.ibm.com>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Link: http://lkml.kernel.org/r/20180117083831.101001-1-tmricht@linux.vnet.ibm.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      7a924536