1. 23 4月, 2018 1 次提交
  2. 17 4月, 2018 1 次提交
    • T
      perf list: Add s390 support for detailed/verbose PMU event description · 038586c3
      Thomas Richter 提交于
      'perf list' with flags -d and -v print a description (-d) or a very
      verbose explanation (-v) of CPU specific counter events.  These
      descriptions are provided with the json files in directory
      pmu-events/arch/s390/*.json.
      
      Display of these descriptions on s390 requires the corresponding json
      files.
      
      On s390 this does not work because function is_pmu_core() does not
      detect the s390 directory name where the CPU specific events are listed.
      On x86 it is:
      
        /sys/bus/event_source/devices/cpu
      
      whereas on s390 it is:
      
        /sys/bus/event_source/devices/cpum_cf
        /sys/bus/event_source/devices/cpum_sf
      
      Fix this by adding s390 directory name testing to function
      is_pmu_core(). This is the same approach as taken for the ARM platform.
      
      Output before:
      
      [root@s35lp76 perf]# ./perf list -d pmu
      List of pre-defined events (to be used in -e):
      
        cpum_cf/AES_BLOCKED_CYCLES/      [Kernel PMU event]
        cpum_cf/AES_BLOCKED_FUNCTIONS/   [Kernel PMU event]
        cpum_cf/AES_CYCLES/              [Kernel PMU event]
        cpum_cf/AES_FUNCTIONS/           [Kernel PMU event]
        ....
        cpum_cf/TX_NC_TEND/              [Kernel PMU event]
        cpum_cf/VX_BCD_EXECUTION_SLOTS/  [Kernel PMU event]
        cpum_sf/SF_CYCLES_BASIC/         [Kernel PMU event]
      
      Output after:
      
      [root@s35lp76 perf]# ./perf list -d pmu
      List of pre-defined events (to be used in -e):
      
        cpum_cf/AES_BLOCKED_CYCLES/      [Kernel PMU event]
        cpum_cf/AES_BLOCKED_FUNCTIONS/   [Kernel PMU event]
        cpum_cf/AES_CYCLES/              [Kernel PMU event]
        cpum_cf/AES_FUNCTIONS/           [Kernel PMU event]
        ....
        cpum_cf/TX_NC_TEND/              [Kernel PMU event]
        cpum_cf/VX_BCD_EXECUTION_SLOTS/  [Kernel PMU event]
        cpum_sf/SF_CYCLES_BASIC/         [Kernel PMU event]
      
      3906:
        bcd_dfp_execution_slots
             [BCD DFP Execution Slots]
        decimal_instructions
             [Decimal Instructions]
        dtlb2_gpage_writes
             [DTLB2 GPAGE Writes]
        dtlb2_hpage_writes
             [DTLB2 HPAGE Writes]
        dtlb2_misses
             [DTLB2 Misses]
        dtlb2_writes
             [DTLB2 Writes]
        itlb2_misses
             [ITLB2 Misses]
        itlb2_writes
             [ITLB2 Writes]
        l1c_tlb2_misses
             [L1C TLB2 Misses]
        .....
      
      cfvn 3:
        cpu_cycles
             [CPU Cycles]
        instructions
             [Instructions]
        l1d_dir_writes
             [L1D Directory Writes]
        l1d_penalty_cycles
             [L1D Penalty Cycles]
        l1i_dir_writes
             [L1I Directory Writes]
        l1i_penalty_cycles
             [L1I Penalty Cycles]
        problem_state_cpu_cycles
             [Problem State CPU Cycles]
        problem_state_instructions
             [Problem State Instructions]
        ....
      
      csvn generic:
        aes_blocked_cycles
             [AES Blocked Cycles]
        aes_blocked_functions
             [AES Blocked Functions]
        aes_cycles
             [AES Cycles]
        aes_functions
             [AES Functions]
        dea_blocked_cycles
             [DEA Blocked Cycles]
        dea_blocked_functions
             [DEA Blocked Functions]
        ....
      Signed-off-by: NThomas Richter <tmricht@linux.vnet.ibm.com>
      Reviewed-by: NHendrik Brueckner <brueckner@linux.vnet.ibm.com>
      Acked-by: NMark Rutland <mark.rutland@arm.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Link: http://lkml.kernel.org/r/20180416132314.33249-1-tmricht@linux.ibm.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      038586c3
  3. 19 3月, 2018 1 次提交
    • J
      perf tools: Fix snprint warnings for gcc 8 · 77f18153
      Jiri Olsa 提交于
      With gcc 8 we get new set of snprintf() warnings that breaks the
      compilation, one example:
      
        tests/mem.c: In function ‘check’:
        tests/mem.c:19:48: error: ‘%s’ directive output may be truncated writing \
              up to 99 bytes into a region of size 89 [-Werror=format-truncation=]
          snprintf(failure, sizeof failure, "unexpected %s", out);
      
      The gcc docs says:
      
       To avoid the warning either use a bigger buffer or handle the
       function's return value which indicates whether or not its output
       has been truncated.
      
      Given that all these warnings are harmless, because the code either
      properly fails due to uncomplete file path or we don't care for
      truncated output at all, I'm changing all those snprintf() calls to
      scnprintf(), which actually 'checks' for the snprint return value so the
      gcc stays silent.
      Signed-off-by: NJiri Olsa <jolsa@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Josh Poimboeuf <jpoimboe@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
      Link: http://lkml.kernel.org/r/20180319082902.4518-1-jolsa@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      77f18153
  4. 17 2月, 2018 1 次提交
  5. 06 12月, 2017 3 次提交
  6. 05 12月, 2017 1 次提交
  7. 29 11月, 2017 1 次提交
  8. 17 11月, 2017 1 次提交
  9. 02 11月, 2017 1 次提交
    • G
      License cleanup: add SPDX GPL-2.0 license identifier to files with no license · b2441318
      Greg Kroah-Hartman 提交于
      Many source files in the tree are missing licensing information, which
      makes it harder for compliance tools to determine the correct license.
      
      By default all files without license information are under the default
      license of the kernel, which is GPL version 2.
      
      Update the files which contain no license information with the 'GPL-2.0'
      SPDX license identifier.  The SPDX identifier is a legally binding
      shorthand, which can be used instead of the full boiler plate text.
      
      This patch is based on work done by Thomas Gleixner and Kate Stewart and
      Philippe Ombredanne.
      
      How this work was done:
      
      Patches were generated and checked against linux-4.14-rc6 for a subset of
      the use cases:
       - file had no licensing information it it.
       - file was a */uapi/* one with no licensing information in it,
       - file was a */uapi/* one with existing licensing information,
      
      Further patches will be generated in subsequent months to fix up cases
      where non-standard license headers were used, and references to license
      had to be inferred by heuristics based on keywords.
      
      The analysis to determine which SPDX License Identifier to be applied to
      a file was done in a spreadsheet of side by side results from of the
      output of two independent scanners (ScanCode & Windriver) producing SPDX
      tag:value files created by Philippe Ombredanne.  Philippe prepared the
      base worksheet, and did an initial spot review of a few 1000 files.
      
      The 4.13 kernel was the starting point of the analysis with 60,537 files
      assessed.  Kate Stewart did a file by file comparison of the scanner
      results in the spreadsheet to determine which SPDX license identifier(s)
      to be applied to the file. She confirmed any determination that was not
      immediately clear with lawyers working with the Linux Foundation.
      
      Criteria used to select files for SPDX license identifier tagging was:
       - Files considered eligible had to be source code files.
       - Make and config files were included as candidates if they contained >5
         lines of source
       - File already had some variant of a license header in it (even if <5
         lines).
      
      All documentation files were explicitly excluded.
      
      The following heuristics were used to determine which SPDX license
      identifiers to apply.
      
       - when both scanners couldn't find any license traces, file was
         considered to have no license information in it, and the top level
         COPYING file license applied.
      
         For non */uapi/* files that summary was:
      
         SPDX license identifier                            # files
         ---------------------------------------------------|-------
         GPL-2.0                                              11139
      
         and resulted in the first patch in this series.
      
         If that file was a */uapi/* path one, it was "GPL-2.0 WITH
         Linux-syscall-note" otherwise it was "GPL-2.0".  Results of that was:
      
         SPDX license identifier                            # files
         ---------------------------------------------------|-------
         GPL-2.0 WITH Linux-syscall-note                        930
      
         and resulted in the second patch in this series.
      
       - if a file had some form of licensing information in it, and was one
         of the */uapi/* ones, it was denoted with the Linux-syscall-note if
         any GPL family license was found in the file or had no licensing in
         it (per prior point).  Results summary:
      
         SPDX license identifier                            # files
         ---------------------------------------------------|------
         GPL-2.0 WITH Linux-syscall-note                       270
         GPL-2.0+ WITH Linux-syscall-note                      169
         ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause)    21
         ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)    17
         LGPL-2.1+ WITH Linux-syscall-note                      15
         GPL-1.0+ WITH Linux-syscall-note                       14
         ((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause)    5
         LGPL-2.0+ WITH Linux-syscall-note                       4
         LGPL-2.1 WITH Linux-syscall-note                        3
         ((GPL-2.0 WITH Linux-syscall-note) OR MIT)              3
         ((GPL-2.0 WITH Linux-syscall-note) AND MIT)             1
      
         and that resulted in the third patch in this series.
      
       - when the two scanners agreed on the detected license(s), that became
         the concluded license(s).
      
       - when there was disagreement between the two scanners (one detected a
         license but the other didn't, or they both detected different
         licenses) a manual inspection of the file occurred.
      
       - In most cases a manual inspection of the information in the file
         resulted in a clear resolution of the license that should apply (and
         which scanner probably needed to revisit its heuristics).
      
       - When it was not immediately clear, the license identifier was
         confirmed with lawyers working with the Linux Foundation.
      
       - If there was any question as to the appropriate license identifier,
         the file was flagged for further research and to be revisited later
         in time.
      
      In total, over 70 hours of logged manual review was done on the
      spreadsheet to determine the SPDX license identifiers to apply to the
      source files by Kate, Philippe, Thomas and, in some cases, confirmation
      by lawyers working with the Linux Foundation.
      
      Kate also obtained a third independent scan of the 4.13 code base from
      FOSSology, and compared selected files where the other two scanners
      disagreed against that SPDX file, to see if there was new insights.  The
      Windriver scanner is based on an older version of FOSSology in part, so
      they are related.
      
      Thomas did random spot checks in about 500 files from the spreadsheets
      for the uapi headers and agreed with SPDX license identifier in the
      files he inspected. For the non-uapi files Thomas did random spot checks
      in about 15000 files.
      
      In initial set of patches against 4.14-rc6, 3 files were found to have
      copy/paste license identifier errors, and have been fixed to reflect the
      correct identifier.
      
      Additionally Philippe spent 10 hours this week doing a detailed manual
      inspection and review of the 12,461 patched files from the initial patch
      version early this week with:
       - a full scancode scan run, collecting the matched texts, detected
         license ids and scores
       - reviewing anything where there was a license detected (about 500+
         files) to ensure that the applied SPDX license was correct
       - reviewing anything where there was no detection but the patch license
         was not GPL-2.0 WITH Linux-syscall-note to ensure that the applied
         SPDX license was correct
      
      This produced a worksheet with 20 files needing minor correction.  This
      worksheet was then exported into 3 different .csv files for the
      different types of files to be modified.
      
      These .csv files were then reviewed by Greg.  Thomas wrote a script to
      parse the csv files and add the proper SPDX tag to the file, in the
      format that the file expected.  This script was further refined by Greg
      based on the output to detect more types of files automatically and to
      distinguish between header and source .c files (which need different
      comment types.)  Finally Greg ran the script using the .csv files to
      generate the patches.
      Reviewed-by: NKate Stewart <kstewart@linuxfoundation.org>
      Reviewed-by: NPhilippe Ombredanne <pombredanne@nexb.com>
      Reviewed-by: NThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b2441318
  10. 10 10月, 2017 1 次提交
    • M
      perf pmu: Unbreak perf record for arm/arm64 with events with explicit PMU · 66ec1191
      Mark Rutland 提交于
      Currently, perf record is broken on arm/arm64 systems when the PMU is
      specified explicitly as part of the event, e.g.
      
      $ ./perf record -e armv8_cortex_a53/cpu_cycles/u true
      
      In such cases, perf record fails to open events unless
      perf_event_paranoid is set to -1, even if the PMU in question supports
      mode exclusion. Further, even when perf_event_paranoid is toggled, no
      samples are recorded.
      
      This is an unintended side effect of commit:
      
        e3ba76de ("perf tools: Force uncore events to system wide monitoring)
      
      ... which assumes that if a PMU has an associated cpu_map, it is an
      uncore PMU, and forces events for such PMUs to be system-wide.
      
      This is not true for arm/arm64 systems, which can have heterogeneous
      CPUs. To account for this, multiple CPU PMUs are exposed, each with a
      "cpus" field under sysfs, which the perf tool parses into a cpu_map. ARM
      PMUs do not have a "cpumask" file, and only have a "cpus" file. For the
      gory details as to why, see commit:
      
       7e3fcffe ("perf pmu: Support alternative sysfs cpumask")
      
      Given all of this, we can instead identify uncore PMUs by explicitly
      checking for a "cpumask" file, and restore arm/arm64 PMU support back to
      a working state. This patch does so, adding a new perf_pmu::is_uncore
      field, and splitting the existing cpumask parsing so that it can be
      reused.
      Signed-off-by: NMark Rutland <mark.rutland@arm.com>
      Tested-by Will Deacon <will.deacon@arm.com>
      Acked-by: NJiri Olsa <jolsa@kernel.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: 4.12+ <stable@vger.kernel.org>
      Fixes: e3ba76de ("perf tools: Force uncore events to system wide monitoring)
      Link: http://lkml.kernel.org/r/1507315102-5942-1-git-send-email-mark.rutland@arm.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      66ec1191
  11. 13 9月, 2017 3 次提交
  12. 25 4月, 2017 1 次提交
  13. 20 4月, 2017 2 次提交
  14. 11 4月, 2017 1 次提交
  15. 23 3月, 2017 5 次提交
  16. 20 2月, 2017 1 次提交
  17. 18 2月, 2017 1 次提交
  18. 15 2月, 2017 1 次提交
  19. 08 2月, 2017 3 次提交
  20. 17 1月, 2017 1 次提交
  21. 28 10月, 2016 1 次提交
    • A
      perf list: Support matching by topic · 67bdc35f
      Andi Kleen 提交于
      Add support in perf list topic to only show events belonging to a
      specific vendor events topic. For example the following works now:
      
        % perf list frontend
        List of pre-defined events (to be used in -e):
      
          stalled-cycles-frontend OR idle-cycles-frontend    [Hardware event]
      
          stalled-cycles-frontend OR cpu/stalled-cycles-frontend/ [Kernel PMU event]
      
        frontend:
          dsb2mite_switches.count
               [Decode Stream Buffer (DSB)-to-MITE switches]
          dsb2mite_switches.penalty_cycles
               [Decode Stream Buffer (DSB)-to-MITE switch true penalty cycles]
          dsb_fill.exceed_dsb_lines
               [Cycles when Decode Stream Buffer (DSB) fill encounter more than 3 Decode Stream Buffer (DSB)
                lines]
          icache.hit
               [Number of Instruction Cache, Streaming Buffer and Victim Cache Reads. both cacheable and
                noncacheable, including UC fetches]
        ...
      Signed-off-by: NAndi Kleen <ak@linux.intel.com>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Link: http://lkml.kernel.org/r/1476902724-9586-2-git-send-email-andi@firstfloor.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      67bdc35f
  22. 24 10月, 2016 2 次提交
  23. 04 10月, 2016 6 次提交