1. 26 11月, 2019 6 次提交
  2. 21 11月, 2019 1 次提交
  3. 19 11月, 2019 1 次提交
    • I
      perf parse: Report initial event parsing error · a910e466
      Ian Rogers 提交于
      Record the first event parsing error and report. Implementing feedback
      from Jiri Olsa:
      
        https://lkml.org/lkml/2019/10/28/680
      
      An example error is:
      
        $ tools/perf/perf stat -e c/c/
        WARNING: multiple event parsing errors
        event syntax error: 'c/c/'
                               \___ unknown term
      
        valid terms: event,filter_rem,filter_opc0,edge,filter_isoc,filter_tid,filter_loc,filter_nc,inv,umask,filter_opc1,tid_en,thresh,filter_all_op,filter_not_nm,filter_state,filter_nm,config,config1,config2,name,period,percore
      
      Initial error:
      
        event syntax error: 'c/c/'
                            \___ Cannot find PMU `c'. Missing kernel support?
        Run 'perf list' for a list of valid events
      
         Usage: perf stat [<options>] [<command>]
      
            -e, --event <event>   event selector. use 'perf list' to list available events
      Signed-off-by: NIan Rogers <irogers@google.com>
      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: Allison Randal <allison@lohutok.net>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Anju T Sudhakar <anju@linux.vnet.ibm.com>
      Cc: Christian Borntraeger <borntraeger@de.ibm.com>
      Cc: Davidlohr Bueso <dave@stgolabs.net>
      Cc: Jin Yao <yao.jin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Ravi Bangoria <ravi.bangoria@linux.ibm.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Thomas Richter <tmricht@linux.ibm.com>
      Link: http://lore.kernel.org/lkml/20191116074652.9960-1-irogers@google.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      a910e466
  4. 18 11月, 2019 1 次提交
    • A
      perf maps: Do not use an rbtree to sort by map name · c5c584d2
      Arnaldo Carvalho de Melo 提交于
      This is only used for the kernel maps, shave 24 bytes out 'struct map'
      and just traverse the existing per ip rbtree to look for maps by name,
      use a front end cache to reuse the last search if its the same name.
      
      After this 'struct map' is down to just two cachelines:
      
        $ pahole -C map ~/bin/perf
        struct map {
        	union {
        		struct rb_node rb_node __attribute__((__aligned__(8))); /*     0    24 */
        		struct list_head node;                   /*     0    16 */
        	} __attribute__((__aligned__(8)));                                               /*     0    24 */
        	u64                        start;                /*    24     8 */
        	u64                        end;                  /*    32     8 */
        	_Bool                      erange_warned;        /*    40     1 */
      
        	/* XXX 3 bytes hole, try to pack */
      
        	u32                        priv;                 /*    44     4 */
        	u32                        prot;                 /*    48     4 */
        	u32                        flags;                /*    52     4 */
        	u64                        pgoff;                /*    56     8 */
        	/* --- cacheline 1 boundary (64 bytes) --- */
        	u64                        reloc;                /*    64     8 */
        	u32                        maj;                  /*    72     4 */
        	u32                        min;                  /*    76     4 */
        	u64                        ino;                  /*    80     8 */
        	u64                        ino_generation;       /*    88     8 */
        	u64                        (*map_ip)(struct map *, u64); /*    96     8 */
        	u64                        (*unmap_ip)(struct map *, u64); /*   104     8 */
        	struct dso *               dso;                  /*   112     8 */
        	refcount_t                 refcnt;               /*   120     4 */
      
        	/* size: 128, cachelines: 2, members: 17 */
        	/* sum members: 121, holes: 1, sum holes: 3 */
        	/* padding: 4 */
        	/* forced alignments: 1 */
        } __attribute__((__aligned__(8)));
        $
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: https://lkml.kernel.org/n/tip-bvr8fqfgzxtgnhnwt5sssx5g@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      c5c584d2
  5. 12 11月, 2019 1 次提交
  6. 07 11月, 2019 4 次提交
  7. 20 10月, 2019 3 次提交
    • L
      perf tests: Disable bp_signal testing for arm64 · 6a5f3d94
      Leo Yan 提交于
      As there are several discussions for enabling perf breakpoint signal
      testing on arm64 platform: arm64 needs to rely on single-step to execute
      the breakpointed instruction and then reinstall the breakpoint exception
      handler.  But if we hook the breakpoint with a signal, the signal
      handler will do the stepping rather than the breakpointed instruction,
      this causes infinite loops as below:
      
               Kernel space              |            Userspace
        ---------------------------------|--------------------------------
                                         |  __test_function() -> hit
      				   |                       breakpoint
        breakpoint_handler()             |
          `-> user_enable_single_step()  |
        do_signal()                      |
                                         |  sig_handler() -> Step one
      				   |                instruction and
      				   |                trap to kernel
        single_step_handler()            |
          `-> reinstall_suspended_bps()  |
                                         |  __test_function() -> hit
      				   |     breakpoint again and
      				   |     repeat up flow infinitely
      
      As Will Deacon mentioned [1]: "that we require the overflow handler to
      do the stepping on arm/arm64, which is relied upon by GDB/ptrace. The
      hw_breakpoint code is a complete disaster so my preference would be to
      rip out the perf part and just implement something directly in ptrace,
      but it's a pretty horrible job".  Though Will commented this on arm
      architecture, but the comment also can apply on arm64 architecture.
      
      For complete information, I searched online and found a few years back,
      Wang Nan sent one patch 'arm64: Store breakpoint single step state into
      pstate' [2]; the patch tried to resolve this issue by avoiding single
      stepping in signal handler and defer to enable the signal stepping when
      return to __test_function().  The fixing was not merged due to the
      concern for missing to handle different usage cases.
      
      Based on the info, the most feasible way is to skip Perf breakpoint
      signal testing for arm64 and this could avoid the duplicate
      investigation efforts when people see the failure.  This patch skips
      this case on arm64 platform, which is same with arm architecture.
      
      [1] https://lkml.org/lkml/2018/11/15/205
      [2] https://lkml.org/lkml/2015/12/23/477Signed-off-by: NLeo Yan <leo.yan@linaro.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Brajeswar Ghosh <brajeswar.linux@gmail.com>
      Cc: Florian Fainelli <f.fainelli@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Michael Petlan <mpetlan@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Song Liu <songliubraving@fb.com>
      Cc: Souptick Joarder <jrdr.linux@gmail.com>
      Cc: Will Deacon <will@kernel.org>
      Link: http://lore.kernel.org/lkml/20191018085531.6348-3-leo.yan@linaro.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      6a5f3d94
    • L
      perf tests bp_account: Add dedicated checking helper is_supported() · e533eadf
      Leo Yan 提交于
      The arm architecture supports breakpoint accounting but it doesn't
      support breakpoint overflow signal handling.  The current code uses the
      same checking helper, thus it disables both testings (bp_account and
      bp_signal) for arm platform.
      
      For handling two testings separately, this patch adds a dedicated
      checking helper is_supported() for breakpoint accounting testing, thus
      it allows supporting breakpoint accounting testing on arm platform; the
      old helper test__bp_signal_is_supported() is only used to checking for
      breakpoint overflow signal testing.
      Signed-off-by: NLeo Yan <leo.yan@linaro.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Brajeswar Ghosh <brajeswar.linux@gmail.com>
      Cc: Florian Fainelli <f.fainelli@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Michael Petlan <mpetlan@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Song Liu <songliubraving@fb.com>
      Cc: Souptick Joarder <jrdr.linux@gmail.com>
      Cc: Will Deacon <will@kernel.org>
      Link: http://lore.kernel.org/lkml/20191018085531.6348-2-leo.yan@linaro.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      e533eadf
    • L
      perf tests: Remove needless headers for bp_account · 12d79563
      Leo Yan 提交于
      A few headers are not needed and were introduced by copying from other
      test file.  This patch removes the needless headers for the breakpoint
      accounting testing.
      Signed-off-by: NLeo Yan <leo.yan@linaro.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Brajeswar Ghosh <brajeswar.linux@gmail.com>
      Cc: Florian Fainelli <f.fainelli@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Michael Petlan <mpetlan@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Song Liu <songliubraving@fb.com>
      Cc: Souptick Joarder <jrdr.linux@gmail.com>
      Cc: Will Deacon <will@kernel.org>
      Link: http://lore.kernel.org/lkml/20191018085531.6348-1-leo.yan@linaro.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      12d79563
  8. 15 10月, 2019 2 次提交
    • L
      perf test: Avoid infinite loop for task exit case · 791ce9c4
      Leo Yan 提交于
      When executing the task exit testing case, perf gets stuck in an endless
      loop this case and doesn't return back on Arm64 Juno board.
      
      After digging into this issue, since Juno board has Arm's big.LITTLE
      CPUs, thus the PMUs are not compatible between the big CPUs and little
      CPUs.  This leads to a PMU event that cannot be enabled properly when
      the traced task is migrated from one variant's CPU to another variant.
      Finally, the test case runs into infinite loop for cannot read out any
      event data after return from polling.
      
      Eventually, we need to work out formal solution to allow PMU events can
      be freely migrated from one CPU variant to another, but this is a
      difficult task and a different topic.  This patch tries to fix the Perf
      test case to avoid infinite loop, when the testing detects 1000 times
      retrying for reading empty events, it will directly bail out and return
      failure.  This allows the Perf tool can continue its other test cases.
      Signed-off-by: NLeo Yan <leo.yan@linaro.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: http://lore.kernel.org/lkml/20191011091942.29841-2-leo.yan@linaro.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      791ce9c4
    • L
      perf test: Report failure for mmap events · 6add129c
      Leo Yan 提交于
      When fail to mmap events in task exit case, it misses to set 'err' to
      -1; thus the testing will not report failure for it.
      
      This patch sets 'err' to -1 when fails to mmap events, thus Perf tool
      can report correct result.
      
      Fixes: d723a550 ("perf test: Add test case for checking number of EXIT events")
      Signed-off-by: NLeo Yan <leo.yan@linaro.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: http://lore.kernel.org/lkml/20191011091942.29841-1-leo.yan@linaro.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      6add129c
  9. 10 10月, 2019 4 次提交
  10. 27 9月, 2019 1 次提交
    • I
      perf tests: Avoid raising SEGV using an obvious NULL dereference · e3e2cf3d
      Ian Rogers 提交于
      An optimized build such as:
      
        make -C tools/perf CLANG=1 CC=clang EXTRA_CFLAGS="-O3
      
      will turn the dereference operation into a ud2 instruction, raising a
      SIGILL rather than a SIGSEGV. Use raise(..) for correctness and clarity.
      
      Similar issues were addressed in Numfor Mbiziwo-Tiapo's patch:
      
        https://lkml.org/lkml/2019/7/8/1234
      
      Committer testing:
      
      Before:
      
        [root@quaco ~]# perf test hooks
        55: perf hooks                                            : Ok
        [root@quaco ~]# perf test -v hooks
        55: perf hooks                                            :
        --- start ---
        test child forked, pid 17092
        SIGSEGV is observed as expected, try to recover.
        Fatal error (SEGFAULT) in perf hook 'test'
        test child finished with 0
        ---- end ----
        perf hooks: Ok
        [root@quaco ~]#
      
      After:
      
        [root@quaco ~]# perf test hooks
        55: perf hooks                                            : Ok
        [root@quaco ~]# perf test -v hooks
        55: perf hooks                                            :
        --- start ---
        test child forked, pid 17909
        SIGSEGV is observed as expected, try to recover.
        Fatal error (SEGFAULT) in perf hook 'test'
        test child finished with 0
        ---- end ----
        perf hooks: Ok
        [root@quaco ~]#
      
      Fixes: a074865e ("perf tools: Introduce perf hooks")
      Signed-off-by: NIan Rogers <irogers@google.com>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: http://lore.kernel.org/lkml/20190925195924.152834-2-irogers@google.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      e3e2cf3d
  11. 25 9月, 2019 12 次提交
  12. 21 9月, 2019 2 次提交
  13. 20 9月, 2019 2 次提交