1. 17 Dec, 2018 34 commits
  2. 22 Nov, 2018 6 commits
    • Ingo Molnar's avatar
      Merge tag 'perf-core-for-mingo-4.21-20181122' of... · e8e94fce
      Ingo Molnar authored
      Merge tag 'perf-core-for-mingo-4.21-20181122' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core
      
      Pull perf/core improvements and fixes from Arnaldo Carvalho de Melo:
      
      - Start using BPF maps in 'perf trace' for filters in the augmented syscalls
        code, keeping the existing code for tracepoint filters so that we can switch
        back and forth while getting everything BPFied (Arnaldo Carvalho de Melo)
      
      - Suppress potential format-truncation warning in the PMU code (Ben Hutchings)
      
      - Introduce 'perf bench epoll', with "wait" and "ctl" benchmarks (Davidlohr Bueso)
      
      - Fix slowness due to -ffunction-section, do it by sorting the maps by name, so
        avoiding the using rb_first/next to traverse all entries looking for a map name,
        that with --ffunction-section gets to thousands of maps (Eric Saint-Etienne)
      
      - Separate jvmti cmlr check (Jiri Olsa)
      
      - Allow using the stepping when figuring out which JSON files to use for a x86
        processor, so that Cascadelake server can be support, which has the same
        cpuid as some other processor, being different only in the stepping (Kan Liang)
      
      - Share code and output format for uregs and iregs 'perf script' output (Milian Wolff)
      
      - Use perf_evsel__is_clocki() for clock events in 'perf stat' (Ravi Bangoria)
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      e8e94fce
    • Kan Liang's avatar
      perf pmu: Move *_cpuid_str() weak functions to header.c · f4a0742b
      Kan Liang authored
      The weak functions, strcmp_cpuid_str() and get_cpuid_str(), are defined
      in pmu.c.
      
      Most of the cpuid related functions, including *_cpuid_str()'s
      declaration and platform specific definition, are in header.c/h.
      
      To make the declaration and definition of all cpuid related functions in
      a consistent place, move the weak functions to header.c.
      
      There is no functional change.
      Suggested-by: default avatarJiri Olsa <jolsa@kernel.org>
      Signed-off-by: default avatarKan Liang <kan.liang@linux.intel.com>
      Link: http://lkml.kernel.org/r/20181121164939.13482-1-kan.liang@linux.intel.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      f4a0742b
    • Eric Saint-Etienne's avatar
      perf symbols: Fix slowness due to -ffunction-section · 1e628569
      Eric Saint-Etienne authored
      Perf can take minutes to parse an image when -ffunction-section is used.
      This is especially true with the kernel image when it is compiled this
      way, which is the arm64 default since the patcheset "Enable deadcode
      elimination at link time".
      
      Perf organize maps using a rbtree. Whenever perf finds a new symbols, it
      first searches this rbtree for the map it belongs to, by strcmp()'aring
      section names.  When it finds the map with the right name, it uses it to
      add the symbol. With a usual image there aren't so many maps but when
      using -ffunction-section there's basically one map per function.  With
      the kernel image that's north of 40,000 maps. For most symbols perf has
      to parses the entire rbtree to eventually create a new map and add it.
      Consequently perf spends most of the time browsing a rbtree that keeps
      getting larger.
      
      This performance fix introduces a secondary rbtree that indexes maps
      based on the section name.
      Signed-off-by: default avatarEric Saint-Etienne <eric.saint.etienne@oracle.com>
      Reviewed-by: default avatarDave Kleikamp <dave.kleikamp@oracle.com>
      Reviewed-by: default avatarDavid Aldridge <david.aldridge@oracle.com>
      Reviewed-by: default avatarRob Gardner <rob.gardner@oracle.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/1542822679-25591-1-git-send-email-eric.saint.etienne@oracle.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      1e628569
    • Jiri Olsa's avatar
      perf jvmti: Separate jvmti cmlr check · dd1d0044
      Jiri Olsa authored
      The Compiled Method Load Record (cmlr) is JDK specific interface to
      access JVM stack info. This makes the jvmti agent code not compile under
      another jdk, which does not support that.
      
      Separating jvmti cmlr check into special feature check, and adding
      HAVE_JVMTI_CMLR macro to indicate that.
      
      Mark cmlr code in jvmti/libjvmti.c with HAVE_JVMTI_CMLR, so we can
      compile it on system without cmlr support.
      
      This change makes the jvmti compile with java-1.8.0-ibm package. It's
      without the line numbers support, but the rest works.
      
      Adding NO_JVMTI_CMLR compile variable for testing.
      Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Ben Gainey <ben.gainey@arm.com>
      Cc: Gustavo Luiz Duarte <gduarte@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/r/20181121154341.21521-1-jolsa@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      dd1d0044
    • Kan Liang's avatar
      perf vendor events: Add JSON metrics for Cascadelake server · ecd94f1b
      Kan Liang authored
      Add JSON metrics (based on event list v1) for Cascadelake server
      Signed-off-by: default avatarKan Liang <kan.liang@linux.intel.com>
      Acked-by: default avatarJiri Olsa <jolsa@kernel.org>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/3ab97c73-c197-8555-1a35-b54636e667e6@linux.intel.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      ecd94f1b
    • Kan Liang's avatar
      perf vendor events: Add stepping in CPUID string for x86 · 3b54411a
      Kan Liang authored
      The perf tools cannot find the proper event list for the Cascadelake
      server.  Because the Cascadelake server and the Skylake server have the
      same CPU model number, which are used by the perf tools to find the
      event list.
      
      The stepping for Skylake server is up to 4.
      
      The stepping for Cascadelake server starts from 5.
      
      The stepping can be used to distinguish between them.
      
      The stepping is added in get_cpuid_str().
      
      The stepping information for Skylake server is updated in mapfile.csv.
      
      A x86 specific strcmp_cpuid_cmp() function is added to handle two CPUID
      formats in mapfile.csv, "vendor-family-model-stepping" and
      "vendor-family-model":
      
      - If a cpuid-regular-expression from the mapfile.csv using the new
        stepping format, a cpuid-string generated on the machine must include
        stepping. Otherwise, it is a mismatch.
      
      - If the cpuid-regular-expression using the old non-stepping format,
        the stepping in the cpuid-string will be ignored.
      
      The script, using environment string "PERF_CPUID" without stepping on
      Skylake server, will be broken. If so, users must fix their scripts.
      
      Committer notes:
      
      Fixed this build error on centos:6 and debian:7:
      
        arch/x86/util/header.c: In function 'is_full_cpuid':
        arch/x86/util/header.c:82:39: error: declaration of 'cpuid' shadows a global declaration [-Werror=shadow]
        arch/x86/util/header.c:12:1: error: shadowed declaration is here [-Werror=shadow]
        arch/x86/util/header.c: In function 'strcmp_cpuid_str':
        arch/x86/util/header.c:98:56: error: declaration of 'cpuid' shadows a global declaration [-Werror=shadow]
        arch/x86/util/header.c:12:1: error: shadowed declaration is here [-Werror=shadow]
        cc1: all warnings being treated as errors
      Signed-off-by: default avatarKan Liang <kan.liang@linux.intel.com>
      Reviewed-by: default avatarJiri Olsa <jolsa@kernel.org>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/20181114212416.15665-1-kan.liang@linux.intel.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      3b54411a