Skip to content
  1. Mar 12, 2019
    • Andi Kleen's avatar
      perf report: Implement browsing of individual samples · 4968ac8f
      Andi Kleen authored
      
      
      Now 'perf report' can show whole time periods with 'perf script', but
      the user still has to find individual samples of interest manually.
      
      It would be expensive and complicated to search for the right samples in
      the whole perf file. Typically users only need to look at a small number
      of samples for useful analysis.
      
      Also the full scripts tend to show samples of all CPUs and all threads
      mixed up, which can be very confusing on larger systems.
      
      Add a new --samples option to save a small random number of samples per
      hist entry.
      
      Use a reservoir sample technique to select a representatve number of
      samples.
      
      Then allow browsing the samples using 'perf script' as part of the hist
      entry context menu. This automatically adds the right filters, so only
      the thread or cpu of the sample is displayed. Then we use less' search
      functionality to directly jump the to the time stamp of the selected
      sample.
      
      It uses different menus for assembler and source display.  Assembler
      needs xed installed and source needs debuginfo.
      
      Currently it only supports as many samples as fit on the screen due to
      some limitations in the slang ui code.
      
      Signed-off-by: default avatarAndi Kleen <ak@linux.intel.com>
      Tested-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Acked-by: default avatarJiri Olsa <jolsa@kernel.org>
      Link: http://lkml.kernel.org/r/20190311174605.GA29294@tassilo.jf.intel.com
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      4968ac8f
    • Andi Kleen's avatar
      perf report: Support builtin perf script in scripts menu · 6f3da20e
      Andi Kleen authored
      
      
      The scripts menu traditionally only showed custom perf scripts.
      
      Allow to run standard perf script with useful default options too.
      
      - Normal perf script
      - perf script with assembler (needs xed installed)
      - perf script with source code output (needs debuginfo)
      - perf script with custom arguments
      
      Then we automatically select the right options to display the
      information in the perf.data file.
      
      For example with -b display branch contexts.
      
      It's not easily possible to check for xed's existence in advance.  perf
      script usually gives sensible error messages when it's not available.
      
      Signed-off-by: default avatarAndi Kleen <ak@linux.intel.com>
      Acked-by: default avatarJiri Olsa <jolsa@kernel.org>
      Link: http://lkml.kernel.org/r/20190311144502.15423-7-andi@firstfloor.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      6f3da20e
    • Andi Kleen's avatar
      perf report: Support running scripts for current time range · 1d6c49df
      Andi Kleen authored
      
      
      When using the time sort key, add new context menus to run scripts for
      only the currently selected time range. Compute the correct range for
      the selection add pass it as the --time option to perf script.
      
      Signed-off-by: default avatarAndi Kleen <ak@linux.intel.com>
      Acked-by: default avatarJiri Olsa <jolsa@kernel.org>
      Link: http://lkml.kernel.org/r/20190311144502.15423-6-andi@firstfloor.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      1d6c49df
    • Andi Kleen's avatar
      perf report: Support time sort key · 3723908d
      Andi Kleen authored
      
      
      Add a time sort key to perf report to display samples for different time
      quantums separately. This allows easier analysis of workloads that
      change over time, and also will allow looking at the context of samples.
      
      % perf record ...
      % perf report --sort time,overhead,symbol --time-quantum 1ms --stdio
      ...
           0.67%  277061.87300  [.] _dl_start
           0.50%  277061.87300  [.] f1
           0.50%  277061.87300  [.] f2
           0.33%  277061.87300  [.] main
           0.29%  277061.87300  [.] _dl_lookup_symbol_x
           0.29%  277061.87300  [.] dl_main
           0.29%  277061.87300  [.] do_lookup_x
           0.17%  277061.87300  [.] _dl_debug_initialize
           0.17%  277061.87300  [.] _dl_init_paths
           0.08%  277061.87300  [.] check_match
           0.04%  277061.87300  [.] _dl_count_modids
           1.33%  277061.87400  [.] f1
           1.33%  277061.87400  [.] f2
           1.33%  277061.87400  [.] main
           1.17%  277061.87500  [.] main
           1.08%  277061.87500  [.] f1
           1.08%  277061.87500  [.] f2
           1.00%  277061.87600  [.] main
           0.83%  277061.87600  [.] f1
           0.83%  277061.87600  [.] f2
           1.00%  277061.87700  [.] main
      
      Committer notes:
      
      Rename 'time' argument to hist_time() to htime to overcome this in older
      distros:
      
        cc1: warnings being treated as errors
        util/hist.c: In function 'hist_time':
        util/hist.c:251: error: declaration of 'time' shadows a global declaration
        /usr/include/time.h:186: error: shadowed declaration is here
      
      Signed-off-by: default avatarAndi Kleen <ak@linux.intel.com>
      Acked-by: default avatarJiri Olsa <jolsa@kernel.org>
      Link: http://lkml.kernel.org/r/20190311144502.15423-4-andi@firstfloor.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      3723908d
    • Andi Kleen's avatar
      perf script: Filter COMM/FORK/.. events by CPU · e87e5481
      Andi Kleen authored
      
      
      The --cpu option only filtered samples. Filter other perf events, such
      as COMM, FORK, SWITCH by the CPU too.
      
      Reported-by: default avatarJiri Olsa <jolsa@kernel.org>
      Signed-off-by: default avatarAndi Kleen <ak@linux.intel.com>
      Acked-by: default avatarJiri Olsa <jolsa@kernel.org>
      Link: http://lkml.kernel.org/r/20190311144502.15423-2-andi@firstfloor.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      e87e5481
    • Arnaldo Carvalho de Melo's avatar
      tools headers uapi: Update linux/in.h copy · 2fb71043
      Arnaldo Carvalho de Melo authored
      To get the changes in:
      
        4effd28c
      
       ("bridge: join all-snoopers multicast address")
      
      That do not generate any changes in tools/ use of this file.
      
      Silences this tools/perf build warning:
      
        Warning: Kernel ABI header at 'tools/include/uapi/linux/in.h' differs from latest version at 'include/uapi/linux/in.h'
        diff -u tools/include/uapi/linux/in.h include/uapi/linux/in.h
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Linus Lüssing <linus.luessing@c0d3.blue>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: https://lkml.kernel.org/n/tip-ifpl634035266ho6wxuqgo81@git.kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      2fb71043
    • Arnaldo Carvalho de Melo's avatar
      tools headers uapi: Sync copy of asm-generic/unistd.h with the kernel sources · 1a787fc5
      Arnaldo Carvalho de Melo authored
      To get the changes in:
      
        c8ce48f0
      
       ("asm-generic: Make time32 syscall numbers optional")
      
      Silencing these tools/perf build warnings:
      
        Warning: Kernel ABI header at 'tools/arch/arm64/include/uapi/asm/unistd.h' differs from latest version at 'arch/arm64/include/uapi/asm/unistd.h'
        diff -u tools/arch/arm64/include/uapi/asm/unistd.h arch/arm64/include/uapi/asm/unistd.h
        Warning: Kernel ABI header at 'tools/include/uapi/asm-generic/unistd.h' differs from latest version at 'include/uapi/asm-generic/unistd.h'
        diff -u tools/include/uapi/asm-generic/unistd.h include/uapi/asm-generic/unistd.h
      
      Test built it under the ubuntu:14.04.4-x-linaro-arm64 cross build
      environment and looked at the syscall table at
      /tmp/build/perf/arch/arm64/include/generated/asm/syscalls.c, looks ok.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Kim Phillips <kim.phillips@arm.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
      Cc: Thomas Richter <tmricht@linux.vnet.ibm.com>
      Link: https://lkml.kernel.org/n/tip-e4w7ngsmkq48bd6st52ty2kb@git.kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      1a787fc5
    • Arnaldo Carvalho de Melo's avatar
      perf tools: Update x86's syscall_64.tbl, no change in tools/perf behaviour · df94bb44
      Arnaldo Carvalho de Melo authored
      To pick the changes in 7948450d
      
       ("x86/x32: use time64 versions of
      sigtimedwait and recvmmsg"), that doesn't cause any change in behaviour
      in tools/perf/ as it deals just with the x32 entries.
      
      This silences this tools/perf build warning:
      
        Warning: Kernel ABI header at 'tools/perf/arch/x86/entry/syscalls/syscall_64.tbl' differs from latest version at 'arch/x86/entry/syscalls/syscall_64.tbl'
        diff -u tools/perf/arch/x86/entry/syscalls/syscall_64.tbl arch/x86/entry/syscalls/syscall_64.tbl
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: https://lkml.kernel.org/n/tip-mqpvshayeqidlulx5qpioa59@git.kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      df94bb44
    • Tony Jones's avatar
      perf script python: Add printdate function to SQL exporters · 49f93bbf
      Tony Jones authored
      
      
      Introduce a printdate function to eliminate the repetitive use of
      datetime.datetime.today() in the SQL exporting scripts.
      
      Signed-off-by: default avatarTony Jones <tonyj@suse.de>
      Acked-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
      Link: http://lkml.kernel.org/r/20190309000518.2438-5-tonyj@suse.de
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      49f93bbf
    • Tony Jones's avatar
      perf script python: Add Python3 support to export-to-sqlite.py · ebf6c5c1
      Tony Jones authored
      
      
      Support both Python2 and Python3 in the export-to-sqlite.py script
      
      The use of 'from __future__' implies the minimum supported Python2 version
      is now v2.6
      
      Signed-off-by: default avatarTony Jones <tonyj@suse.de>
      Acked-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
      Link: http://lkml.kernel.org/r/20190309000518.2438-4-tonyj@suse.de
      Signed-off-by: default avatarSeeteena Thoufeek <s1seetee@linux.vnet.ibm.com>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      ebf6c5c1
    • Tony Jones's avatar
      perf script python: Add Python3 support to export-to-postgresql.py · 1937b056
      Tony Jones authored
      
      
      Support both Python2 and Python3 in the export-to-postgresql.py script.
      
      The use of 'from __future__' implies the minimum supported Python2 version
      is now v2.6
      
      Signed-off-by: default avatarTony Jones <tonyj@suse.de>
      Link: http://lkml.kernel.org/r/20190309000518.2438-3-tonyj@suse.de
      Signed-off-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
      Signed-off-by: default avatarSeeteena Thoufeek <s1seetee@linux.vnet.ibm.com>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      1937b056
    • Tony Jones's avatar
      perf script python: Add Python3 support to exported-sql-viewer.py · beda0e72
      Tony Jones authored
      
      
      Support both Python2 and Python3 in the exported-sql-viewer.py script.
      
      The use of 'from __future__' implies the minimum supported Python2 version
      is now v2.6
      
      Signed-off-by: default avatarTony Jones <tonyj@suse.de>
      Acked-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
      Link: http://lkml.kernel.org/r/20190309000518.2438-2-tonyj@suse.de
      Signed-off-by: default avatarSeeteena Thoufeek <s1seetee@linux.vnet.ibm.com>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      beda0e72
    • Andi Kleen's avatar
      perf report: Use less for scripts output · 75065a85
      Andi Kleen authored
      
      
      The UI viewer for scripts output has a lot of limitations: limited size,
      no search or save function, slow, and various other issues.
      
      Just use 'less' to display directly on the terminal instead.
      
      This won't work in GTK mode, but GTK doesn't support these context menus
      anyways. If that is ever done could use an terminal for the output.
      
      Signed-off-by: default avatarAndi Kleen <ak@linux.intel.com>
      Acked-by: default avatarFeng Tang <feng.tang@intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Link: http://lkml.kernel.org/r/20190309055628.21617-8-andi@firstfloor.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      75065a85
  2. Mar 11, 2019
    • Jiri Olsa's avatar
      perf session: Add process callback to reader object · e51f8061
      Jiri Olsa authored
      
      
      Adding callback function to reader object so callers can process data in
      different ways.
      
      Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Alexey Budankov <alexey.budankov@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.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/20190308134745.5057-7-jolsa@kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      e51f8061
    • Jiri Olsa's avatar
      perf header: Add DIR_FORMAT feature to describe directory data · 258031c0
      Jiri Olsa authored
      
      
      The data files layout is described by HEADER_DIR_FORMAT feature.
      Currently it holds only version number (1):
      
           uint64_t version;
      
      The current version holds only version value (1) means that data files:
      
        - Follow the 'data.*' name format.
      
        - Contain raw events data in standard perf format as read from kernel
          (and need to be sorted)
      
      Future versions are expected to describe different data files layout
      according to special needs.
      
      Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Alexey Budankov <alexey.budankov@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.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/20190308134745.5057-6-jolsa@kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      258031c0
    • Jiri Olsa's avatar
      perf data: Make perf_data__size() work over directory · 29583c17
      Jiri Olsa authored
      
      
      Make perf_data__size() return proper size for directory data, summing up
      all the individual file sizes.
      
      Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Alexey Budankov <alexey.budankov@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.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/20190308134745.5057-5-jolsa@kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      29583c17
    • Jiri Olsa's avatar
      perf data: Add perf_data__update_dir() function · e8be1357
      Jiri Olsa authored
      
      
      Add perf_data__update_dir() to update the size for every file within the
      perf.data directory.
      
      Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Alexey Budankov <alexey.budankov@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.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/20190308134745.5057-4-jolsa@kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      e8be1357
    • Jiri Olsa's avatar
      perf data: Don't store auxtrace index for directory data file · cd3dd8dd
      Jiri Olsa authored
      
      
      We can't store the auxtrace index when we store into multiple files,
      because we keep only offset for it, not the file.
      
      The auxtrace data will be processed correctly in the 'pipe' mode.
      
      Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Alexey Budankov <alexey.budankov@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.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/20190308134745.5057-3-jolsa@kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      cd3dd8dd
    • Jiri Olsa's avatar
      perf data: Support having perf.data stored as a directory · ec65def1
      Jiri Olsa authored
      
      
      The caller needs to set 'struct perf_data::is_dir flag and the path will
      be treated as a directory.
      
      The 'struct perf_data::file' is initialized and open as 'path/header'
      file.
      
      Add a check to the direcory interface functions to check the is_dir flag.
      
      Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Alexey Budankov <alexey.budankov@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.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/20190308134745.5057-2-jolsa@kernel.org
      [ Be consistent on how to signal failure, i.e. use -1 and let users check errno ]
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      ec65def1
    • Martin Liška's avatar
      perf vendor events amd: perf PMU events for AMD Family 17h · 98c07a8f
      Martin Liška authored
      
      
      Thi patch adds PMC events for AMD Family 17 CPUs as defined in [1].  It
      covers events described in section: 2.1.13. Regex pattern in mapfile.csv
      covers all CPUs of the family.
      
      [1] https://support.amd.com/TechDocs/54945_PPR_Family_17h_Models_00h-0Fh.pdf
      
      Signed-off-by: default avatarMartin Liška <mliska@suse.cz>
      Acked-by: default avatarBorislav Petkov <bp@suse.de>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Jon Grimm <jon.grimm@amd.com>
      Cc: Martin Jambor <mjambor@suse.cz>
      Cc: William Cohen <wcohen@redhat.com>
      Link: https://lkml.kernel.org/r/d65873ca-e402-b198-4fe9-8c4af81258c8@suse.cz
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      98c07a8f
    • Adrian Hunter's avatar
      perf probe: Fix getting the kernel map · eaeffeb9
      Adrian Hunter authored
      Since commit 4d99e413
      
       ("perf machine: Workaround missing maps for
      x86 PTI entry trampolines"), perf tools has been creating more than one
      kernel map, however 'perf probe' assumed there could be only one.
      
      Fix by using machine__kernel_map() to get the main kernel map.
      
      Signed-off-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
      Tested-by: default avatarJoseph Qi <joseph.qi@linux.alibaba.com>
      Acked-by: default avatarMasami Hiramatsu <mhiramat@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Jiufei Xue <jiufei.xue@linux.alibaba.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: stable@vger.kernel.org
      Cc: Xu Yu <xuyu@linux.alibaba.com>
      Fixes: 4d99e413 ("perf machine: Workaround missing maps for x86 PTI entry trampolines")
      Fixes: d83212d5
      
       ("kallsyms, x86: Export addresses of PTI entry trampolines")
      Link: http://lkml.kernel.org/r/2ed432de-e904-85d2-5c36-5897ddc5b23b@intel.com
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      eaeffeb9
    • Andi Kleen's avatar
      perf report: Parse time quantum · 2a1292cb
      Andi Kleen authored
      
      
      Many workloads change over time. 'perf report' currently aggregates the
      whole time range reported in perf.data.
      
      This patch adds an option for a time quantum to quantisize the perf.data
      over time.
      
      This just adds the option, will be used in follow on patches for a time
      sort key.
      
      Signed-off-by: default avatarAndi Kleen <ak@linux.intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: http://lkml.kernel.org/r/20190305144758.12397-6-andi@firstfloor.org
      [ Use NSEC_PER_[MU]SEC ]
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      2a1292cb
    • Andi Kleen's avatar
      perf time-utils: Add utility function to print time stamps in nanoseconds · f8c856cb
      Andi Kleen authored
      
      
      Add a utility function to print nanosecond timestamps.
      
      Signed-off-by: default avatarAndi Kleen <ak@linux.intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: http://lkml.kernel.org/r/20190305144758.12397-11-andi@firstfloor.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      f8c856cb
    • Andi Kleen's avatar
      perf report: Support output in nanoseconds · 52bab886
      Andi Kleen authored
      
      
      Upcoming changes add timestamp output in perf report. Add a --ns
      argument similar to perf script to support nanoseconds resolution when
      needed.
      
      Signed-off-by: default avatarAndi Kleen <ak@linux.intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: http://lkml.kernel.org/r/20190305144758.12397-5-andi@firstfloor.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      52bab886
    • Andi Kleen's avatar
      perf script: Support insn output for normal samples · 3ab481a1
      Andi Kleen authored
      
      
      perf script -F +insn was only working for PT traces because the PT
      instruction decoder was filling in the insn/insn_len sample attributes.
      Support it for non PT samples too on x86 using the existing x86
      instruction decoder.
      
      This adds some extra checking to ensure that we don't try to decode
      instructions when using perf.data from a different architecture.
      
        % perf record -a sleep 1
        % perf script -F ip,sym,insn --xed
         ffffffff811704c9 remote_function               movl  %eax, 0x18(%rbx)
         ffffffff8100bb50 intel_bts_enable_local                retq
         ffffffff81048612 native_apic_mem_write                 movl  %esi, -0xa04000(%rdi)
         ffffffff81048612 native_apic_mem_write                 movl  %esi, -0xa04000(%rdi)
         ffffffff81048612 native_apic_mem_write                 movl  %esi, -0xa04000(%rdi)
         ffffffff810f1f79 generic_exec_single           xor %eax, %eax
         ffffffff811704c9 remote_function               movl  %eax, 0x18(%rbx)
         ffffffff8100bb34 intel_bts_enable_local                movl  0x2000(%rax), %edx
         ffffffff81048610 native_apic_mem_write                 mov %edi, %edi
        ...
      
      Committer testing:
      
      Before:
      
        # perf script -F ip,sym,insn --xed | head -5
         ffffffffa4068804 native_write_msr 		addb  %al, (%rax)
         ffffffffa4068804 native_write_msr 		addb  %al, (%rax)
         ffffffffa4068804 native_write_msr 		addb  %al, (%rax)
         ffffffffa4068806 native_write_msr 		addb  %al, (%rax)
         ffffffffa4068806 native_write_msr 		addb  %al, (%rax)
        # perf script -F ip,sym,insn --xed | grep -v "addb  %al, (%rax)"
        #
      
      After:
      
        # perf script -F ip,sym,insn --xed | head -5
         ffffffffa4068804 native_write_msr 		wrmsr
         ffffffffa4068804 native_write_msr 		wrmsr
         ffffffffa4068804 native_write_msr 		wrmsr
         ffffffffa4068806 native_write_msr 		nopl  %eax, (%rax,%rax,1)
         ffffffffa4068806 native_write_msr 		nopl  %eax, (%rax,%rax,1)
        # perf script -F ip,sym,insn --xed | grep -v "addb  %al, (%rax)" | head -5
         ffffffffa4068804 native_write_msr 		wrmsr
         ffffffffa4068804 native_write_msr 		wrmsr
         ffffffffa4068804 native_write_msr 		wrmsr
         ffffffffa4068806 native_write_msr 		nopl  %eax, (%rax,%rax,1)
         ffffffffa4068806 native_write_msr 		nopl  %eax, (%rax,%rax,1)
        #
      
      More examples:
      
        # perf script -F ip,sym,insn --xed | grep -v native_write_msr | head
         ffffffffa416b90e tick_check_broadcast_expired 		btq  %rax, 0x1a5f42a(%rip)
         ffffffffa4956bd0 nmi_cpu_backtrace 		pushq  %r13
         ffffffffa415b95e __hrtimer_next_event_base 		movq  0x18(%rax), %rdx
         ffffffffa4956bf3 nmi_cpu_backtrace 		popq  %r12
         ffffffffa4171d5c smp_call_function_single 		pause
         ffffffffa4956bdd nmi_cpu_backtrace 		mov %ebp, %r12d
         ffffffffa4797e4d menu_select 		cmp $0x190, %rax
         ffffffffa4171d5c smp_call_function_single 		pause
         ffffffffa405a7d8 nmi_cpu_backtrace_handler 		callq  0xffffffffa4956bd0
         ffffffffa4797f7a menu_select 		shr $0x3, %rax
        #
      
      Which matches the annotate output modulo resolving callqs:
      
        # perf annotate --stdio2 nmi_cpu_backtrace_handler
        Samples: 4  of event 'cycles:ppp', 4000 Hz, Event count (approx.): 35908, [percent: local period]
        nmi_cpu_backtrace_handler() /lib/modules/5.0.0+/build/vmlinux
        Percent
                    Disassembly of section .text:
      
                    ffffffff8105a7d0 <nmi_cpu_backtrace_handler>:
                    nmi_cpu_backtrace_handler():
                            nmi_trigger_cpumask_backtrace(mask, exclude_self,
                                                          nmi_raise_cpu_backtrace);
                    }
      
                    static int nmi_cpu_backtrace_handler(unsigned int cmd, struct pt_regs *regs)
                    {
         24.45      → callq  __fentry__
                            if (nmi_cpu_backtrace(regs))
                      mov    %rsi,%rdi
         75.55      → callq  nmi_cpu_backtrace
                                    return NMI_HANDLED;
                      movzbl %al,%eax
      
                            return NMI_DONE;
                    }
                    ← retq
          #
      
        # perf annotate --stdio2 __hrtimer_next_event_base
        Samples: 4  of event 'cycles:ppp', 4000 Hz, Event count (approx.): 767977, [percent: local period]
        __hrtimer_next_event_base() /lib/modules/5.0.0+/build/vmlinux
        Percent
                    Disassembly of section .text:
      
                    ffffffff8115b910 <__hrtimer_next_event_base>:
                    __hrtimer_next_event_base():
      
                    static ktime_t __hrtimer_next_event_base(struct hrtimer_cpu_base *cpu_base,
                                                             const struct hrtimer *exclude,
                                                             unsigned int active,
                                                             ktime_t expires_next)
                    {
                    → callq  __fentry__
      <SNIP>
                4a:   add    $0x1,%r14
         77.31        mov    0x18(%rax),%rdx
                      shl    $0x6,%r14
                      sub    0x38(%rbx,%r14,1),%rdx
                                    if (expires < expires_next) {
                      cmp    %r12,%rdx
                    ↓ jge    68
      <SNIP>
      
      Signed-off-by: default avatarAndi Kleen <ak@linux.intel.com>
      Tested-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: http://lkml.kernel.org/r/20190305144758.12397-3-andi@firstfloor.org
      [ Converted fetch_exe() to use the name it ended up having when merged: thread__memcpy() ]
      [ archinsn.c needs the instruction decoder that is only build when CONFIG_AUXTRACE=y, fix that ]
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      3ab481a1
    • Stephane Eranian's avatar
      perf/core: Restore mmap record type correctly · d9c1bb2f
      Stephane Eranian authored
      
      
      On mmap(), perf_events generates a RECORD_MMAP record and then checks
      which events are interested in this record. There are currently 2
      versions of mmap records: RECORD_MMAP and RECORD_MMAP2. MMAP2 is larger.
      The event configuration controls which version the user level tool
      accepts.
      
      If the event->attr.mmap2=1 field then MMAP2 record is returned.  The
      perf_event_mmap_output() takes care of this. It checks attr->mmap2 and
      corrects the record fields before putting it in the sampling buffer of
      the event.  At the end the function restores the modified MMAP record
      fields.
      
      The problem is that the function restores the size but not the type.
      Thus, if a subsequent event only accepts MMAP type, then it would
      instead receive an MMAP2 record with a size of MMAP record.
      
      This patch fixes the problem by restoring the record type on exit.
      
      Signed-off-by: default avatarStephane Eranian <eranian@google.com>
      Acked-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Fixes: 13d7a241
      
       ("perf: Add attr->mmap2 attribute to an event")
      Link: http://lkml.kernel.org/r/20190307185233.225521-1-eranian@google.com
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      d9c1bb2f
  3. Mar 10, 2019
    • Ingo Molnar's avatar
      Merge tag 'perf-core-for-mingo-5.1-20190307' of... · b339da48
      Ingo Molnar authored
      
      Merge tag 'perf-core-for-mingo-5.1-20190307' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent
      
      Pull perf/core changes from Arnaldo Carvalho de Melo:
      
      perf bpf:
      
        Arnaldo Carvalho de Melo:
      
        - Automatically add BTF ELF markers to 'perf trace' BPF programs, so that
          tools such as 'bpftool map dump' can pretty print map keys and values.
      
      perf c2c:
      
        Jiri Olsa:
      
        - Fix report for empty NUMA node.
      
      perf diff:
      
        Jin Yao:
      
        - Support --time, --cpu, --pid and --tid filter options.
      
      perf probe:
      
        Arnaldo Carvalho de Melo:
      
        - Clarify error message about not finding kernel modules debuginfo.
      
      perf record:
      
        Jiri Olsa:
      
        - Fixup probing for max attr.precise_ip.
      
      perf trace:
      
        Arnaldo Carvalho de Melo:
      
        - Add missing %s lost in the 'msg_flags' recvmmsg arg when adding prefix suppression logic.
      
      perf annotate:
      
        Arnaldo Carvalho de Melo:
      
        - Calculate the max instruction name, align column to that, removing the
          hardcoded max 6 chars and cope with instructions with names longer than that,
          such as vpmovmskb, vpcmpeqb, etc.
      
      kernel:
      
        Song Liu:
      
        - Consider events with attr.bpf_event set as side-band.
      
        Gustavo A. R. Silva:
      
        - Mark expected switch fall-through in perf_event_parse_addr_filter().
      
      Libraries:
      
        Jiri Olsa:
      
        - Fix leaks and double frees on error paths.
      
      libtraceevent:
      
        Tony Jones:
      
        - Fix buffer overflow in arg_eval().
      
      python scripting:
      
        Tony Jones:
      
        - More python3 fixes.
      
      Trivial:
      
        Yang Wei:
      
        - Remove needless extra semicolon in clang C++ glue code.
      
      Intel PT/BTS:
      
        Adrian Hunter:
      
        - Improve auxtrace address filter error message when there is no DSO.
      
        - Fix divide by zero when TSC is not available.
      
        - Further improvements to the export to sqlite/posgresql python scripts
          and to the GUI sqlviewer, exporting 'parent_id' so that we have enable
          the creation of call trees.
      
        Andi Kleen:
      
        - Generalize function to copy from thread addr space from intel-bts code.
      
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      b339da48
  4. Mar 09, 2019
    • Gustavo A. R. Silva's avatar
      perf/core: Mark expected switch fall-through · 43aa378b
      Gustavo A. R. Silva authored
      
      
      In preparation to enabling -Wimplicit-fallthrough, mark switch cases
      where we are expecting to fall through.
      
      This patch fixes the following warning:
      
        kernel/events/core.c: In function ‘perf_event_parse_addr_filter’:
        kernel/events/core.c:9154:11: warning: this statement may fall through [-Wimplicit-fallthrough=]
            kernel = 1;
            ~~~~~~~^~~
        kernel/events/core.c:9156:3: note: here
           case IF_SRC_FILEADDR:
           ^~~~
      
      Warning level 3 was used: -Wimplicit-fallthrough=3
      
      This patch is part of the ongoing efforts to enable -Wimplicit-fallthrough.
      
      Signed-off-by: default avatarGustavo A. R. Silva <gustavo@embeddedor.com>
      Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Kees Cook <keescook@chromium.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Rik van Riel <riel@surriel.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Vince Weaver <vincent.weaver@maine.edu>
      Link: https://lkml.kernel.org/r/20190212205430.GA8446@embeddedor
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      43aa378b
    • Kan Liang's avatar
      perf/x86/intel/uncore: Fix client IMC events return huge result · 8041ffd3
      Kan Liang authored
      
      
      The client IMC bandwidth events currently return very large values:
      
        $ perf stat -e uncore_imc/data_reads/ -e uncore_imc/data_writes/ -I 10000 -a
      
        10.000117222 34,788.76 MiB uncore_imc/data_reads/
        10.000117222 8.26 MiB uncore_imc/data_writes/
        20.000374584 34,842.89 MiB uncore_imc/data_reads/
        20.000374584 10.45 MiB uncore_imc/data_writes/
        30.000633299 37,965.29 MiB uncore_imc/data_reads/
        30.000633299 323.62 MiB uncore_imc/data_writes/
        40.000891548 41,012.88 MiB uncore_imc/data_reads/
        40.000891548 6.98 MiB uncore_imc/data_writes/
        50.001142480 1,125,899,906,621,494.75 MiB uncore_imc/data_reads/
        50.001142480 6.97 MiB uncore_imc/data_writes/
      
      The client IMC events are freerunning counters. They still use the
      old event encoding format (0x1 for data_read and 0x2 for data write).
      The counter bit width is calculated by common code, which assume that
      the standard encoding format is used for the freerunning counters.
      Error bit width information is calculated.
      
      The patch intends to convert the old client IMC event encoding to the
      standard encoding format.
      
      Current common code uses event->attr.config which directly copy from
      user space. We should not implicitly modify it for a converted event.
      The event->hw.config is used to replace the event->attr.config in
      common code.
      
      For client IMC events, the event->attr.config is used to calculate a
      converted event with standard encoding format in the custom
      event_init(). The converted event is stored in event->hw.config.
      For other events of freerunning counters, they already use the standard
      encoding format. The same value as event->attr.config is assigned to
      event->hw.config in common event_init().
      
      Reported-by: default avatarJin Yao <yao.jin@linux.intel.com>
      Tested-by: default avatarJin Yao <yao.jin@linux.intel.com>
      Signed-off-by: default avatarKan Liang <kan.liang@linux.intel.com>
      Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Rik van Riel <riel@surriel.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Vince Weaver <vincent.weaver@maine.edu>
      Cc: stable@kernel.org # v4.18+
      Fixes: 9aae1780
      
       ("perf/x86/intel/uncore: Clean up client IMC uncore")
      Link: https://lkml.kernel.org/r/20190227165729.1861-1-kan.liang@linux.intel.com
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      8041ffd3
    • Alexander Shishkin's avatar
      perf/ring_buffer: Use high order allocations for AUX buffers optimistically · 5768402f
      Alexander Shishkin authored
      
      
      Currently, the AUX buffer allocator will use high-order allocations
      for PMUs that don't support hardware scatter-gather chaining to ensure
      large contiguous blocks of pages, and always use an array of single
      pages otherwise.
      
      There is, however, a tangible performance benefit in using larger chunks
      of contiguous memory even in the latter case, that comes from not having
      to fetch the next page's address at every page boundary. In particular,
      a task running under Intel PT on an Atom CPU shows 1.5%-2% less runtime
      penalty with a single multi-page output region in snapshot mode (no PMI)
      than with multiple single-page output regions, from ~6% down to ~4%. For
      the snapshot mode it does make a difference as it is intended to run over
      long periods of time.
      
      For this reason, change the allocation policy to always optimistically
      start with the highest possible order when allocating pages for the AUX
      buffer, desceding until the allocation succeeds or order zero allocation
      fails.
      
      Signed-off-by: default avatarAlexander Shishkin <alexander.shishkin@linux.intel.com>
      Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Rik van Riel <riel@surriel.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Vince Weaver <vincent.weaver@maine.edu>
      Link: https://lkml.kernel.org/r/20190215114727.62648-2-alexander.shishkin@linux.intel.com
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      5768402f
  5. Mar 07, 2019
    • Jiri Olsa's avatar
      perf data: Force perf_data__open|close zero data->file.path · b8f7d86b
      Jiri Olsa authored
      
      
      Making sure the data->file.path is zeroed on perf_data__open error path
      and in perf_data__close, so we don't double free it in case someone call
      it twice.
      
      Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Jonas Rabenstein <jonas.rabenstein@studium.uni-erlangen.de>
      Cc: Nageswara R Sastry <nasastry@in.ibm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Ravi Bangoria <ravi.bangoria@linux.ibm.com>
      Link: http://lkml.kernel.org/r/20190305152536.21035-9-jolsa@kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      b8f7d86b
    • Jiri Olsa's avatar
      perf session: Fix double free in perf_data__close · befa09b6
      Jiri Olsa authored
      
      
      We can't call perf_data__close and subsequently perf_session__delete,
      because it will call perf_data__close again and cause double free for
      data->file.path.
      
        $ perf report -i .
        incompatible file format (rerun with -v to learn more)
        free(): double free detected in tcache 2
        Aborted (core dumped)
      
      In fact we don't need to call perf_data__close at all, because at the
      time the got out_close is reached, session->data is already initialized,
      so the perf_data__close call will be triggered from
      perf_session__delete.
      
      Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Jonas Rabenstein <jonas.rabenstein@studium.uni-erlangen.de>
      Cc: Nageswara R Sastry <nasastry@in.ibm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Ravi Bangoria <ravi.bangoria@linux.ibm.com>
      Fixes: 2d4f2799
      
       ("perf data: Add global path holder")
      Link: http://lkml.kernel.org/r/20190305152536.21035-8-jolsa@kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      befa09b6
    • Jiri Olsa's avatar
      perf evsel: Probe for precise_ip with simple attr · 5b61adb1
      Jiri Olsa authored
      
      
      Currently we probe for precise_ip with user specified perf_event_attr,
      which might fail because of unsupported kernel features, which would get
      disabled during the open time anyway.
      
      Switching the probe to take place on simple hw cycles, so the following
      record sets proper precise_ip:
      
        # perf record -e cycles:P ls
        # perf evlist -v
        cycles:P: size: 112, ... precise_ip: 3, ...
      
      Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Jonas Rabenstein <jonas.rabenstein@studium.uni-erlangen.de>
      Cc: Nageswara R Sastry <nasastry@in.ibm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Ravi Bangoria <ravi.bangoria@linux.ibm.com>
      Link: http://lkml.kernel.org/r/20190305152536.21035-7-jolsa@kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      5b61adb1
    • Jiri Olsa's avatar
      perf tools: Read and store caps/max_precise in perf_pmu · 90a86bde
      Jiri Olsa authored
      
      
      Read the caps/max_precise value and store it in struct perf_pmu to be
      used when setting the maximum precise_ip field in following patch.
      
      Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Jonas Rabenstein <jonas.rabenstein@studium.uni-erlangen.de>
      Cc: Nageswara R Sastry <nasastry@in.ibm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Ravi Bangoria <ravi.bangoria@linux.ibm.com>
      Link: http://lkml.kernel.org/r/20190305152536.21035-5-jolsa@kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      90a86bde
    • Jiri Olsa's avatar
      perf hist: Fix memory leak of srcline · 26349585
      Jiri Olsa authored
      
      
      We can't allocate he->srcline unconditionaly, only when new hist_entry
      is created. Moving he->srcline allocation into hist_entry__init
      function.
      
      Original-patch-by: default avatarJonas Rabenstein <jonas.rabenstein@studium.uni-erlangen.de>
      Suggested-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Nageswara R Sastry <nasastry@in.ibm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Ravi Bangoria <ravi.bangoria@linux.ibm.com>
      Link: http://lkml.kernel.org/r/20190305152536.21035-4-jolsa@kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      26349585
    • Jiri Olsa's avatar
      perf hist: Add error path into hist_entry__init · c5758910
      Jiri Olsa authored
      
      
      Adding error path into hist_entry__init to unify error handling, so
      every new member does not need to free everything else.
      
      Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Jonas Rabenstein <jonas.rabenstein@studium.uni-erlangen.de>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Ravi Bangoria <ravi.bangoria@linux.ibm.com>
      Cc: nageswara r sastry <nasastry@in.ibm.com>
      Link: http://lkml.kernel.org/r/20190305152536.21035-3-jolsa@kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      c5758910
    • Jiri Olsa's avatar
      perf c2c: Fix c2c report for empty numa node · e34c9402
      Jiri Olsa authored
      
      
      Ravi Bangoria reported that we fail with an empty NUMA node with the
      following message:
      
        $ lscpu
        NUMA node0 CPU(s):
        NUMA node1 CPU(s):   0-4
      
        $ sudo ./perf c2c report
        node/cpu topology bugFailed setup nodes
      
      Fix this by detecting the empty node and keeping its CPU set empty.
      
      Reported-by: default avatarNageswara R Sastry <nasastry@in.ibm.com>
      Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
      Tested-by: default avatarRavi Bangoria <ravi.bangoria@linux.ibm.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Jonas Rabenstein <jonas.rabenstein@studium.uni-erlangen.de>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/20190305152536.21035-2-jolsa@kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      e34c9402
    • Tony Jones's avatar
      perf script python: Add Python3 support to intel-pt-events.py · fdf2460c
      Tony Jones authored
      
      
      Support both Python2 and Python3 in the intel-pt-events.py script
      
      There may be differences in the ordering of output lines due to
      differences in dictionary ordering etc.  However the format within lines
      should be unchanged.
      
      The use of 'from __future__' implies the minimum supported Python2 version
      is now v2.6
      
      Signed-off-by: default avatarTony Jones <tonyj@suse.de>
      Acked-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
      Link: http://lkml.kernel.org/r/fd26acf9-0c0f-717f-9664-a3c33043ce19@suse.de
      Signed-off-by: default avatarSeeteena Thoufeek <s1seetee@linux.vnet.ibm.com>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      fdf2460c
    • Tony Jones's avatar
      perf script python: Add Python3 support to event_analyzing_sample.py · c253c72e
      Tony Jones authored
      
      
      Support both Python2 and Python3 in the event_analyzing_sample.py script
      
      There may be differences in the ordering of output lines due to
      differences in dictionary ordering etc.  However the format within lines
      should be unchanged.
      
      The use of 'from __future__' implies the minimum supported Python2 version
      is now v2.6
      
      Signed-off-by: default avatarTony Jones <tonyj@suse.de>
      Cc: Feng Tang <feng.tang@intel.com>
      Link: http://lkml.kernel.org/r/20190302011903.2416-5-tonyj@suse.de
      Signed-off-by: default avatarSeeteena Thoufeek <s1seetee@linux.vnet.ibm.com>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      c253c72e
    • Tony Jones's avatar
      perf script python: add Python3 support to check-perf-trace.py · 57e604b1
      Tony Jones authored
      
      
      Support both Python 2 and Python 3 in the check-perf-trace.py script.
      
      There may be differences in the ordering of output lines due to
      differences in dictionary ordering etc.  However the format within lines
      should be unchanged.
      
      The use of from __future__ implies the minimum supported version of
      Python2 is now v2.6
      
      Signed-off-by: default avatarTony Jones <tonyj@suse.de>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      Link: http://lkml.kernel.org/r/20190302011903.2416-4-tonyj@suse.de
      Signed-off-by: default avatarSeeteena Thoufeek <s1seetee@linux.vnet.ibm.com>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      57e604b1