1. 21 Jan, 2019 24 commits
    • Thomas Richter's avatar
      perf report: Dump s390 counter set data to file · 8dabe9c4
      Thomas Richter authored
      Add support for the new s390 PMU device cpum_cf_diag to extract the
      counter set diagnostic data. This data is available as event raw data
      and can be created with this command:
      
        [root@s35lp76 perf]# ./perf record -R -e '{rbd000,rbc000}' --
                                       ~/mytests/facultaet 2500
        [ perf record: Woken up 1 times to write data ]
        [ perf record: Captured and wrote 0.009 MB perf.data ]
        [root@s35lp76 perf]#
      
      The new event 0xbc000 generated this counter set diagnostic trace data.
      The data can be extracted using command:
      
        [root@s35lp76 perf]# ./perf report --stdio --itrace=d
        #
        # Total Lost Samples: 0
        #
        # Samples: 21  of events 'anon group { rbd000, rbc000 }'
        # Event count (approx.): 21
        #
        #         Overhead  Command    Shared Object      Symbol
        # ................  .........  .................  ........................
        #
          80.95%   0.00%  facultaet  facultaet          [.] facultaet
           4.76%   0.00%  facultaet  [kernel.kallsyms]  [k] check_chain_key
           4.76%   0.00%  facultaet  [kernel.kallsyms]  [k] ftrace_likely_update
           4.76%   0.00%  facultaet  [kernel.kallsyms]  [k] lock_release
           4.76%   0.00%  facultaet  libc-2.26.so       [.] _dl_addr
        [root@s35lp76 perf]# ll aux*
        -rw-r--r-- 1 root root 3408 Oct 16 12:40 aux.ctr.02
        -rw-r--r-- 1 root root 4096 Oct 16 12:40 aux.smp.02
        [root@s35lp76 perf]#
      
      The files named aux.ctr.## contain the counter set diagnostic data and
      the files named aux.smp.## contain the sampling diagnostic data. ##
      stand for the CPU number the data was taken from.
      Signed-off-by: default avatarThomas Richter <tmricht@linux.ibm.com>
      Reviewed-by: default avatarHendrik Brueckner <brueckner@linux.ibm.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Link: http://lkml.kernel.org/r/20190117093003.96287-4-tmricht@linux.ibm.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      8dabe9c4
    • Thomas Richter's avatar
      perf report: Display names in s390 diagnostic counter sets · 3e4a1c53
      Thomas Richter authored
      On s390 the CPU Measurement Facility diagnostic counter sets are
      displayed by counter number and value. Add the logical counter name in
      the output (if it is available). Otherwise "unknown" is shown.
      
      Output before:
      
       [root@s35lp76 perf]# ./perf report -D --stdio
       [00000000] Counterset:0 Counters:6
         Counter:000 Value:0x000000000085ec36 Counter:001 Value:0x0000000000796c94
         Counter:002 Value:0x0000000000005ada Counter:003 Value:0x0000000000092460
         Counter:004 Value:0x0000000000006073 Counter:005 Value:0x00000000001a9a73
       [0x000038] Counterset:1 Counters:2
         Counter:000 Value:0x000000000007c59f Counter:001 Value:0x000000000002fad6
       [0x000050] Counterset:2 Counters:16
         Counter:000 Value:000000000000000000 Counter:001 Value:000000000000000000
      
      Output after:
      
          [root@s35lp76 perf]# ./perf report -D --stdio
      
       [00000000] Counterset:0 Counters:6
           Counter:000 cpu_cycles Value:0x000000000085ec36
           Counter:001 instructions Value:0x0000000000796c94
           Counter:002 l1i_dir_writes Value:0x0000000000005ada
           Counter:003 l1i_penalty_cycles Value:0x0000000000092460
           Counter:004 l1d_dir_writes Value:0x0000000000006073
           Counter:005 l1d_penalty_cycles Value:0x00000000001a9a73
       [0x000038] Counterset:1 Counters:2
           Counter:000 problem_state_cpu_cycles Value:0x000000000007c59f
           Counter:001 problem_state_instructions Value:0x000000000002fad6
       [0x000050] Counterset:2 Counters:16
           Counter:000 prng_functions Value:000000000000000000
      Signed-off-by: default avatarThomas Richter <tmricht@linux.ibm.com>
      Reviewed-by: default avatarHendrik Brueckner <brueckner@linux.ibm.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Link: http://lkml.kernel.org/r/20190117093003.96287-3-tmricht@linux.ibm.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      3e4a1c53
    • Thomas Richter's avatar
      perf report: Display arch specific diagnostic counter sets, starting with s390 · 93115d32
      Thomas Richter authored
      On s390 the event bc000 (also named CF_DIAG) extracts the CPU
      Measurement Facility diagnostic counter sets and displays them as
      counter number and counter value pairs sorted by counter set number.
      
      Output:
       [root@s35lp76 perf]# ./perf report -D --stdio
      
       [00000000] Counterset:0 Counters:6
         Counter:000 Value:0x000000000085ec36 Counter:001 Value:0x0000000000796c94
         Counter:002 Value:0x0000000000005ada Counter:003 Value:0x0000000000092460
         Counter:004 Value:0x0000000000006073 Counter:005 Value:0x00000000001a9a73
       [0x000038] Counterset:1 Counters:2
         Counter:000 Value:0x000000000007c59f Counter:001 Value:0x000000000002fad6
       [0x000050] Counterset:2 Counters:16
         Counter:000 Value:000000000000000000 Counter:001 Value:000000000000000000
         Counter:002 Value:000000000000000000 Counter:003 Value:000000000000000000
         Counter:004 Value:000000000000000000 Counter:005 Value:000000000000000000
         Counter:006 Value:000000000000000000 Counter:007 Value:000000000000000000
         Counter:008 Value:000000000000000000 Counter:009 Value:000000000000000000
         Counter:010 Value:000000000000000000 Counter:011 Value:000000000000000000
         Counter:012 Value:000000000000000000 Counter:013 Value:000000000000000000
         Counter:014 Value:000000000000000000 Counter:015 Value:000000000000000000
       [0x0000d8] Counterset:3 Counters:128
         Counter:000 Value:0x000000000000020f Counter:001 Value:0x00000000000001d8
         Counter:002 Value:0x000000000000d7fa Counter:003 Value:0x000000000000008b
         ...
      
      The number in brackets is the offset into the raw data field of the
      sample.
      
      New functions trace_event_sample_raw__init() and s390_sample_raw() are
      introduced in the code path to enable interpretation on non s390
      platforms. This event bc000 attached raw data is generated only on s390
      platform. Correct display on other platforms requires correct endianness
      handling.
      
      Committer notes:
      
      Added a init function that sets up a evlist function pointer to avoid
      repeated tests on evlist->env and calls to perf_env__name() that
      involves normalizing, etc, for each PERF_RECORD_SAMPLE.
      
      Removed needless __maybe_unused from the trace_event_raw()
      prototype in session.h, move it to be an static function in evlist.
      
      The 'offset' variable is a size_t, not an u64, fix it to avoid this on
      some arches:
      
          CC       /tmp/build/perf/util/s390-sample-raw.o
        util/s390-sample-raw.c: In function 's390_cpumcfdg_testctr':
        util/s390-sample-raw.c:77:4: error: format '%llx' expects argument of type 'long long unsigned int', but argument 4 has type 'size_t' [-Werror=format=]
            pr_err("Invalid counter set entry at %#"  PRIx64 "\n",
            ^
        cc1: all warnings being treated as errors
      Signed-off-by: default avatarThomas Richter <tmricht@linux.ibm.com>
      Reviewed-by: default avatarHendrik Brueckner <brueckner@linux.ibm.com>
      Link: https://lkml.kernel.org/r/9c856ac0-ef23-72b5-901d-a1f815508976@linux.ibm.com
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Link: https://lkml.kernel.org/n/tip-s3jhif06et9ug78qhclw41z1@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      93115d32
    • Brajeswar Ghosh's avatar
      perf tools: Remove duplicate headers · 3eb03a52
      Brajeswar Ghosh authored
      Remove duplicate headers which are included more than once in the same
      file.
      Signed-off-by: default avatarBrajeswar Ghosh <brajeswar.linux@gmail.com>
      Acked-by: default avatarSouptick Joarder <jrdr.linux@gmail.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Colin King <colin.king@canonical.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Sabyasachi Gupta <sabyasachi.linux@gmail.com>
      Link: http://lkml.kernel.org/r/20190115135916.GA3629@hp-pavilion-15-notebook-pc-brajeswarSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      3eb03a52
    • YueHaibing's avatar
      perf: Remove duplicated workqueue.h include from perf_event.h · cf5c6c21
      YueHaibing authored
      It is already included a little bit higher up in that file.
      Signed-off-by: default avatarYueHaibing <yuehaibing@huawei.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/20190117072504.14428-1-yuehaibing@huawei.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      cf5c6c21
    • Jiri Olsa's avatar
      perf session: Add reader__process_events function · 3c7b67b2
      Jiri Olsa authored
      The reader object is defined by file's fd, data offset and data size.
      
      Now we can simply define a reader object for an arbitrary file data
      portion and pass it to reader__process_events().
      Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
      Acked-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/20190110101301.6196-7-jolsa@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      3c7b67b2
    • Jiri Olsa's avatar
      perf session: Add 'data_offset' member to reader object · 71002bd2
      Jiri Olsa authored
      Add 'data_offset' member to reader object.
      Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
      Acked-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/20190110101301.6196-6-jolsa@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      71002bd2
    • Jiri Olsa's avatar
      perf session: Add 'data_size' member to reader object · f66f0950
      Jiri Olsa authored
      Add a  'data_size' member to the reader object. Keep the 'data_size'
      variable instead of replacing it with rd.data_size as it will be used in
      the following patch.
      Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
      Acked-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/20190110101301.6196-5-jolsa@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      f66f0950
    • Jiri Olsa's avatar
      perf session: Add reader object · 82715eb1
      Jiri Olsa authored
      Add a session private reader object to encapsulate the reading of the
      event data block. Starting with a 'fd' field.
      Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
      Acked-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/20190110101301.6196-4-jolsa@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      82715eb1
    • Jiri Olsa's avatar
      perf session: Get rid of file_size variable · 4f5a473d
      Jiri Olsa authored
      It's not needed and removing it makes the code a little simpler for the
      upcoming changes.
      
      It's safe to replace file_size with data_size, because the
      perf_data__size() value is never smaller than data_offset + data_size.
      Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
      Acked-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/20190110101301.6196-3-jolsa@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      4f5a473d
    • Jiri Olsa's avatar
      perf session: Rearrange perf_session__process_events function · 7ba4da10
      Jiri Olsa authored
      To reduce function arguments and the code.
      Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
      Acked-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/20190110101301.6196-2-jolsa@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      7ba4da10
    • Rasmus Villemoes's avatar
      perf tools: Replace automatic const char[] variables by statics · 49b8e2be
      Rasmus Villemoes authored
      An automatic const char[] variable gets initialized at runtime, just
      like any other automatic variable. For long strings, that uses a lot of
      stack and wastes time building the string; e.g. for the "No %s
      allocation events..." case one has:
      
        444516:       48 b8 4e 6f 20 25 73 20 61 6c   movabs $0x6c61207325206f4e,%rax # "No %s al"
        ...
        444674:       48 89 45 80                     mov    %rax,-0x80(%rbp)
        444678:       48 b8 6c 6f 63 61 74 69 6f 6e   movabs $0x6e6f697461636f6c,%rax # "location"
        444682:       48 89 45 88                     mov    %rax,-0x78(%rbp)
        444686:       48 b8 20 65 76 65 6e 74 73 20   movabs $0x2073746e65766520,%rax # " events "
        444690:       66 44 89 55 c4                  mov    %r10w,-0x3c(%rbp)
        444695:       48 89 45 90                     mov    %rax,-0x70(%rbp)
        444699:       48 b8 66 6f 75 6e 64 2e 20 20   movabs $0x20202e646e756f66,%rax
      
      Make them all static so that the compiler just references objects in .rodata.
      
      Committer testing:
      
      Ok, using dwarves's codiff tool:
      
          $ codiff --functions /tmp/perf.before ~/bin/perf
        builtin-sched.c:
          cmd_sched                 |  -48
         1 function changed, 48 bytes removed, diff: -48
      
        builtin-report.c:
          cmd_report                |  -32
         1 function changed, 32 bytes removed, diff: -32
      
        builtin-kmem.c:
          cmd_kmem                  |  -64
          build_alloc_func_list     |  -50
         2 functions changed, 114 bytes removed, diff: -114
      
        builtin-c2c.c:
          perf_c2c__report          | -390
         1 function changed, 390 bytes removed, diff: -390
      
        ui/browsers/header.c:
          tui__header_window        | -104
         1 function changed, 104 bytes removed, diff: -104
      
        /home/acme/bin/perf:
         9 functions changed, 688 bytes removed, diff: -688
      Signed-off-by: default avatarRasmus Villemoes <linux@rasmusvillemoes.dk>
      Acked-by: default avatarJiri Olsa <jolsa@kernel.org>
      Tested-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/20181102230624.20064-1-linux@rasmusvillemoes.dkSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      49b8e2be
    • Andrew Murray's avatar
      perf/core: Remove unused perf_flags · ad07c8ce
      Andrew Murray authored
      Now that perf_flags is not used we remove it.
      Signed-off-by: default avatarAndrew Murray <andrew.murray@arm.com>
      Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Matt Turner <mattst88@gmail.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Richard Henderson <rth@twiddle.net>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Sascha Hauer <s.hauer@pengutronix.de>
      Cc: Shawn Guo <shawnguo@kernel.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: linuxppc-dev@lists.ozlabs.org
      Cc: robin.murphy@arm.com
      Cc: suzuki.poulose@arm.com
      Link: https://lkml.kernel.org/r/1547128414-50693-13-git-send-email-andrew.murray@arm.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      ad07c8ce
    • Andrew Murray's avatar
      perf/core, arch/x86: Strengthen exclusion checks with PERF_PMU_CAP_NO_EXCLUDE · 88dbe3c9
      Andrew Murray authored
      For x86 PMUs that do not support context exclusion let's advertise the
      PERF_PMU_CAP_NO_EXCLUDE capability. This ensures that perf will
      prevent us from handling events where any exclusion flags are set.
      Let's also remove the now unnecessary check for exclusion flags.
      
      This change means that amd/iommu and amd/uncore will now also
      indicate that they do not support exclude_{hv|idle} and intel/uncore
      that it does not support exclude_{guest|host}.
      Signed-off-by: default avatarAndrew Murray <andrew.murray@arm.com>
      Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Matt Turner <mattst88@gmail.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Richard Henderson <rth@twiddle.net>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Sascha Hauer <s.hauer@pengutronix.de>
      Cc: Shawn Guo <shawnguo@kernel.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: linuxppc-dev@lists.ozlabs.org
      Cc: robin.murphy@arm.com
      Cc: suzuki.poulose@arm.com
      Link: https://lkml.kernel.org/r/1547128414-50693-12-git-send-email-andrew.murray@arm.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      88dbe3c9
    • Andrew Murray's avatar
      perf/core, arch/x86: Use PERF_PMU_CAP_NO_EXCLUDE for exclusion incapable PMUs · 2ff40250
      Andrew Murray authored
      For drivers that do not support context exclusion let's advertise the
      PERF_PMU_CAP_NOEXCLUDE capability. This ensures that perf will
      prevent us from handling events where any exclusion flags are set.
      Let's also remove the now unnecessary check for exclusion flags.
      
      PMU drivers that support at least one exclude flag won't have the
      PERF_PMU_CAP_NOEXCLUDE capability set - these PMU drivers should still
      check and fail on unsupported exclude flags. These missing tests are
      not added in this patch.
      Signed-off-by: default avatarAndrew Murray <andrew.murray@arm.com>
      Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Matt Turner <mattst88@gmail.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Richard Henderson <rth@twiddle.net>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Sascha Hauer <s.hauer@pengutronix.de>
      Cc: Shawn Guo <shawnguo@kernel.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: linuxppc-dev@lists.ozlabs.org
      Cc: robin.murphy@arm.com
      Cc: suzuki.poulose@arm.com
      Link: https://lkml.kernel.org/r/1547128414-50693-11-git-send-email-andrew.murray@arm.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      2ff40250
    • Andrew Murray's avatar
      perf/core, arch/powerpc: use PERF_PMU_CAP_NO_EXCLUDE for exclusion incapable PMUs · c2c9091d
      Andrew Murray authored
      For PowerPC PMUs that do not support context exclusion let's
      advertise the PERF_PMU_CAP_NO_EXCLUDE capability. This ensures that
      perf will prevent us from handling events where any exclusion flags
      are set. Let's also remove the now unnecessary check for exclusion
      flags.
      Signed-off-by: default avatarAndrew Murray <andrew.murray@arm.com>
      Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Reviewed-by: default avatarMadhavan Srinivasan <maddy@linux.vnet.ibm.com>
      Acked-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Matt Turner <mattst88@gmail.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Richard Henderson <rth@twiddle.net>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Sascha Hauer <s.hauer@pengutronix.de>
      Cc: Shawn Guo <shawnguo@kernel.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: linuxppc-dev@lists.ozlabs.org
      Cc: robin.murphy@arm.com
      Cc: suzuki.poulose@arm.com
      Link: https://lkml.kernel.org/r/1547128414-50693-10-git-send-email-andrew.murray@arm.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      c2c9091d
    • Andrew Murray's avatar
      perf/drivers: Strengthen exclusion checks with PERF_PMU_CAP_NO_EXCLUDE · a66b0010
      Andrew Murray authored
      For drivers that do not support context exclusion let's advertise the
      PERF_PMU_CAP_NO_EXCLUDE capability. This ensures that perf will
      prevent us from handling events where any exclusion flags are set.
      Let's also remove the now unnecessary check for exclusion flags.
      
      This change means that qcom_{l2|l3}_pmu will now also indicate that
      they do not support exclude_{host|guest} and that xgene_pmu does
      not also support exclude_idle and exclude_hv.
      
      Note that for qcom_l2_pmu we now implictly return -EINVAL instead
      of -EOPNOTSUPP. This change will result in the perf userspace
      utility retrying the perf_event_open system call with fallback
      event attributes that do not fail.
      Signed-off-by: default avatarAndrew Murray <andrew.murray@arm.com>
      Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Acked-by: default avatarWill Deacon <will.deacon@arm.com>
      Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Matt Turner <mattst88@gmail.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Richard Henderson <rth@twiddle.net>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Sascha Hauer <s.hauer@pengutronix.de>
      Cc: Shawn Guo <shawnguo@kernel.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: linuxppc-dev@lists.ozlabs.org
      Cc: robin.murphy@arm.com
      Cc: suzuki.poulose@arm.com
      Link: https://lkml.kernel.org/r/1547128414-50693-9-git-send-email-andrew.murray@arm.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      a66b0010
    • Andrew Murray's avatar
      For drivers that do not support context exclusion let's advertise the · 30656398
      Andrew Murray authored
      PERF_PMU_CAP_NO_EXCLUDE capability. This ensures that perf will
      prevent us from handling events where any exclusion flags are set.
      Let's also remove the now unnecessary check for exclusion flags.
      Signed-off-by: default avatarAndrew Murray <andrew.murray@arm.com>
      Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Acked-by: default avatarWill Deacon <will.deacon@arm.com>
      Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Matt Turner <mattst88@gmail.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Richard Henderson <rth@twiddle.net>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Sascha Hauer <s.hauer@pengutronix.de>
      Cc: Shawn Guo <shawnguo@kernel.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: linuxppc-dev@lists.ozlabs.org
      Cc: robin.murphy@arm.com
      Cc: suzuki.poulose@arm.com
      Link: https://lkml.kernel.org/r/1547128414-50693-8-git-send-email-andrew.murray@arm.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      30656398
    • Andrew Murray's avatar
      perf/core, arch/arm: Use PERF_PMU_CAP_NO_EXCLUDE for exclusion incapable PMUs · cafa780e
      Andrew Murray authored
      For drivers that do not support context exclusion let's advertise the
      PERF_PMU_CAP_NO_EXCLUDE capability. This ensures that perf will
      prevent us from handling events where any exclusion flags are set.
      Let's also remove the now unnecessary check for exclusion flags.
      Signed-off-by: default avatarAndrew Murray <andrew.murray@arm.com>
      Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Acked-by: default avatarShawn Guo <shawnguo@kernel.org>
      Acked-by: default avatarWill Deacon <will.deacon@arm.com>
      Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Matt Turner <mattst88@gmail.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Richard Henderson <rth@twiddle.net>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Sascha Hauer <s.hauer@pengutronix.de>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: linuxppc-dev@lists.ozlabs.org
      Cc: robin.murphy@arm.com
      Cc: suzuki.poulose@arm.com
      Link: https://lkml.kernel.org/r/1547128414-50693-7-git-send-email-andrew.murray@arm.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      cafa780e
    • Andrew Murray's avatar
      perf/core, arch/arm: Use PERF_PMU_CAP_NO_EXCLUDE conditionally · 1d899c0e
      Andrew Murray authored
      The ARM PMU driver can be used to represent a variety of ARM based
      PMUs. Some of these PMUs do not provide support for context
      exclusion, where this is the case we advertise the
      PERF_PMU_CAP_NO_EXCLUDE capability to ensure that perf prevents us
      from handling events where any exclusion flags are set.
      
      Where an ARM PMU driver has the set_event_filter function implemented,
      we rely on it to perform exclusion checks. At present some of these
      functions do not test for all of the available exclude flags.
      Signed-off-by: default avatarAndrew Murray <andrew.murray@arm.com>
      Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Acked-by: default avatarWill Deacon <will.deacon@arm.com>
      Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Matt Turner <mattst88@gmail.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Richard Henderson <rth@twiddle.net>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Sascha Hauer <s.hauer@pengutronix.de>
      Cc: Shawn Guo <shawnguo@kernel.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: linuxppc-dev@lists.ozlabs.org
      Cc: robin.murphy@arm.com
      Cc: suzuki.poulose@arm.com
      Link: https://lkml.kernel.org/r/1547128414-50693-6-git-send-email-andrew.murray@arm.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      1d899c0e
    • Andrew Murray's avatar
      perf/core, arch/alpha: Strengthen exclusion checks with PERF_PMU_CAP_NO_EXCLUDE · 6dd273f4
      Andrew Murray authored
      As the Alpha PMU doesn't support context exclusion let's advertise
      the PERF_PMU_CAP_NO_EXCLUDE capability. This ensures that perf will
      prevent us from handling events where any exclusion flags are set.
      Let's also remove the now unnecessary check for exclusion flags.
      
      This change means that __hw_perf_event_init will now also
      indicate that it doesn't support exclude_host and exclude_guest and
      will now implicitly return -EINVAL instead of -EPERM. This is likely
      more desirable as -EPERM will result in a kernel.perf_event_paranoid
      related warning from the perf userspace utility.
      Signed-off-by: default avatarAndrew Murray <andrew.murray@arm.com>
      Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Matt Turner <mattst88@gmail.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Richard Henderson <rth@twiddle.net>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Sascha Hauer <s.hauer@pengutronix.de>
      Cc: Shawn Guo <shawnguo@kernel.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: linuxppc-dev@lists.ozlabs.org
      Cc: robin.murphy@arm.com
      Cc: suzuki.poulose@arm.com
      Link: https://lkml.kernel.org/r/1547128414-50693-5-git-send-email-andrew.murray@arm.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      6dd273f4
    • Andrew Murray's avatar
      perf/core: Add PERF_PMU_CAP_NO_EXCLUDE for exclusion incapable PMUs · cc6795ae
      Andrew Murray authored
      Many PMU drivers do not have the capability to exclude counting events
      that occur in specific contexts such as idle, kernel, guest, etc. These
      drivers indicate this by returning an error in their event_init upon
      testing the events attribute flags. This approach is error prone and
      often inconsistent.
      
      Let's instead allow PMU drivers to advertise their inability to exclude
      based on context via a new capability: PERF_PMU_CAP_NO_EXCLUDE. This
      allows the perf core to reject requests for exclusion events where
      there is no support in the PMU.
      Signed-off-by: default avatarAndrew Murray <andrew.murray@arm.com>
      Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Matt Turner <mattst88@gmail.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Richard Henderson <rth@twiddle.net>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Sascha Hauer <s.hauer@pengutronix.de>
      Cc: Shawn Guo <shawnguo@kernel.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: linuxppc-dev@lists.ozlabs.org
      Cc: robin.murphy@arm.com
      Cc: suzuki.poulose@arm.com
      Link: https://lkml.kernel.org/r/1547128414-50693-4-git-send-email-andrew.murray@arm.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      cc6795ae
    • Andrew Murray's avatar
      perf/core: Add function to test for event exclusion flags · 486efe9f
      Andrew Murray authored
      Add a function that tests if any of the perf event exclusion flags
      are set on a given event.
      Signed-off-by: default avatarAndrew Murray <andrew.murray@arm.com>
      Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Matt Turner <mattst88@gmail.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Richard Henderson <rth@twiddle.net>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Sascha Hauer <s.hauer@pengutronix.de>
      Cc: Shawn Guo <shawnguo@kernel.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: linuxppc-dev@lists.ozlabs.org
      Cc: robin.murphy@arm.com
      Cc: suzuki.poulose@arm.com
      Link: https://lkml.kernel.org/r/1547128414-50693-3-git-send-email-andrew.murray@arm.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      486efe9f
    • Andrew Murray's avatar
      perf/doc: Update design.txt for exclude_{host|guest} flags · 23e232bd
      Andrew Murray authored
      Update design.txt to reflect the presence of the exclude_host
      and exclude_guest perf flags.
      Signed-off-by: default avatarAndrew Murray <andrew.murray@arm.com>
      Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Matt Turner <mattst88@gmail.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Richard Henderson <rth@twiddle.net>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Sascha Hauer <s.hauer@pengutronix.de>
      Cc: Shawn Guo <shawnguo@kernel.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: linuxppc-dev@lists.ozlabs.org
      Cc: robin.murphy@arm.com
      Cc: suzuki.poulose@arm.com
      Link: https://lkml.kernel.org/r/1547128414-50693-2-git-send-email-andrew.murray@arm.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      23e232bd
  2. 18 Jan, 2019 4 commits
    • Linus Torvalds's avatar
      Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma · d7393226
      Linus Torvalds authored
      Pull rdma fixes frfom Jason Gunthorpe:
       "Not much so far. We have the usual batch of bugs and two fixes to code
        merged this cycle:
      
         - Restore valgrind support for the ioctl verbs interface merged this
           window, and fix a missed error code on an error path from that
           conversion
      
         - A user reported crash on obsolete mthca hardware
      
         - pvrdma was using the wrong command opcode toward the hypervisor
      
         - NULL pointer crash regression when dumping rdma-cm over netlink
      
         - Be conservative about exposing the global rkey"
      
      * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma:
        RDMA/uverbs: Mark ioctl responses with UVERBS_ATTR_F_VALID_OUTPUT
        RDMA/mthca: Clear QP objects during their allocation
        RDMA/vmw_pvrdma: Return the correct opcode when creating WR
        RDMA/cma: Add cm_id restrack resource based on kernel or user cm_id type
        RDMA/nldev: Don't expose unsafe global rkey to regular user
        RDMA/uverbs: Fix post send success return value in case of error
      d7393226
    • Linus Torvalds's avatar
      Merge tag 'drm-fixes-2019-01-18' of git://anongit.freedesktop.org/drm/drm · 1092a94f
      Linus Torvalds authored
      Pull drm fixes from Dave Airlie:
       "The rc3 fixes are a bit scattered:
      
         - meson, sun4i and rockchip all had missing of_node_put.
      
         - qxl and virtio both were advertising dma-buf to userspace when they
           really shouldn't have.
      
        Otherwise:
      
        meson:
         - modesetting regression fix
      
        i915 GVT:
         - one cmd parser failure fix
         - region cleanup fix in vGPU destroy
      
        amdgpu:
         - KFD fixes for arm64 mixed APU/DGPU
         - vega12 powerplay fix
         - raven DC fixes
         - freesync fix"
      
      * tag 'drm-fixes-2019-01-18' of git://anongit.freedesktop.org/drm/drm:
        drm/amd/display: Detach backlight from stream
        drm/sun4i: backend: add missing of_node_puts
        Revert "drm/amdgpu: validate user pitch alignment"
        Revert "drm/amdgpu: validate user GEM object size"
        drm/meson: Fix atomic mode switching regression
        drm/i915/gvt: Fix mmap range check
        drm/i915/gvt: free VFIO region space in vgpu detach
        drm/amd/display: Fix disabled cursor on top screen edge
        drm/amd/display: fix warning on raven hotplug
        drm/amd/display: fix PME notification not working in RV desktop
        drm/amd/display: Only get the connector state for VRR when toggled
        drm/amd/display: Pack DMCU iRAM alignment
        drm/amd/powerplay: run acg btc for Vega12
        drm/amdkfd: Don't assign dGPUs to APU topology devices
        drm/amdkfd: Allow building KFD on ARM64 (v2)
        drm/meson: add missing of_node_put
        drm/virtio: drop prime import/export callbacks
        drm/qxl: drop prime import/export callbacks
        drm/i915/gvt: Allow F_CMD_ACCESS on mmio 0x21f0
        drm/rockchip: add missing of_node_put
      1092a94f
    • Linus Torvalds's avatar
      Merge tag 'led-fix-for-5.0-rc3' of... · 2451f371
      Linus Torvalds authored
      Merge tag 'led-fix-for-5.0-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/j.anaszewski/linux-leds
      
      Pull LED fix from Jacek Anaszewski.
      
      * tag 'led-fix-for-5.0-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/j.anaszewski/linux-leds:
        leds: lp5523: fix a missing check of return value of lp55xx_read
      2451f371
    • Linus Torvalds's avatar
      Merge tag 'hwmon-for-v5.0-rc3' of... · 0a2fbed8
      Linus Torvalds authored
      Merge tag 'hwmon-for-v5.0-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging
      
      Pull hwmon fixes from Guenter Roeck:
       "Minor fixes/regressions"
      
      * tag 'hwmon-for-v5.0-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
        hwmon: (tmp421) Correct the misspelling of the tmp442 compatible attribute in OF device ID table
        hwmon: (occ) Fix potential integer overflow
        hwmon: (lm80) Fix missing unlock on error in set_fan_div()
        hwmon: (nct6775) Enable IO mapping for NCT6797D and NCT6798D
        hwmon: (nct6775) Fix chip ID for NCT6798D
      0a2fbed8
  3. 17 Jan, 2019 12 commits