1. 26 6月, 2019 8 次提交
  2. 25 6月, 2019 8 次提交
  3. 19 6月, 2019 3 次提交
  4. 18 6月, 2019 12 次提交
  5. 11 6月, 2019 9 次提交
    • T
      perf report: Support s390 diag event display on x86 · 180ca71c
      Thomas Richter 提交于
      Perf report fails to display s390 specific event numbered bd000
      on an x86 platform. For example on s390 this works without error:
      
      [root@m35lp76 perf]# uname -m
      s390x
      [root@m35lp76 perf]# ./perf record -e rbd000 -- find / >/dev/null
      [ perf record: Woken up 3 times to write data ]
      [ perf record: Captured and wrote 0.549 MB perf.data ]
      [root@m35lp76 perf]# ./perf report -D --stdio  > /dev/null
      [root@m35lp76 perf]#
      
      Transfering this perf.data file to an x86 platform and executing
      the same report command produces:
      
      [root@f29 perf]# uname -m
      x86_64
      [root@f29 perf]# ./perf report -i ~/perf.data.m35lp76 --stdio
      interpreting bpf_prog_info from systems with endianity is not yet supported
      interpreting btf from systems with endianity is not yet supported
      0x8c890 [0x8]: failed to process type: 68
      Error:
      failed to process sample
      
      Event bd000 generates auxiliary data which is stored in big endian
      format in the perf data file.
      This error is caused by missing endianess handling on the x86 platform
      when the data is displayed. Fix this by handling s390 auxiliary event
      data depending on the local platform endianness.
      
      Output after on x86:
      
      [root@f29 perf]# ./perf report -D -i ~/perf.data.m35lp76 --stdio > /dev/null
      interpreting bpf_prog_info from systems with endianity is not yet supported
      interpreting btf from systems with endianity is not yet supported
      [root@f29 perf]#
      
      Committer notes:
      
      Fix build breakage on older systems, such as CentOS:6 where using
      nesting calls to the endian.h macros end up redefining local variables:
      
        util/s390-cpumsf.c: In function 's390_cpumsf_trailer_show':
        util/s390-cpumsf.c:333: error: declaration of '__v' shadows a previous local
        util/s390-cpumsf.c:333: error: shadowed declaration is here
        util/s390-cpumsf.c:333: error: declaration of '__x' shadows a previous local
        util/s390-cpumsf.c:333: error: shadowed declaration is here
        util/s390-cpumsf.c:334: error: declaration of '__v' shadows a previous local
        util/s390-cpumsf.c:334: error: shadowed declaration is here
        util/s390-cpumsf.c:334: error: declaration of '__x' shadows a previous local
        util/s390-cpumsf.c:334: error: shadowed declaration is here
      
        [perfbuilder@455a63ef60dc perf]$ gcc -v |& tail -1
        gcc version 4.4.7 20120313 (Red Hat 4.4.7-23) (GCC)
        [perfbuilder@455a63ef60dc perf]$
      
      Since there are several uses of
      
        be64toh(te->flags)
      
      Introduce a variable to hold that and then use it, avoiding this case
      that causes the above problems:
      
        -       local.bsdes = be16toh((be64toh(te->flags) >> 16 & 0xffff));
        +       local.bsdes = be16toh((flags >> 16 & 0xffff));
      
      Its the same construct used in s390_cpumsf_diag_show() where we have a
      'word' variable that is used just once, s390_cpumsf_basic_show() has
      lots of uses and also uses a variable to hold the result of be16toh().
      
      Some of those temp variables needed to be converted from 'unsigned long'
      to 'unsigned long long' so as to build on 32-bit arches such as
      debian:experimental-x-mipsel, the android NDK ones and
      fedora:24-x-ARC-uClibc.
      Signed-off-by: NThomas Richter <tmricht@linux.ibm.com>
      Reviewed-by: NHendrik Brueckner <brueckner@linux.ibm.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Link: http://lkml.kernel.org/r/20190522064325.25596-1-tmricht@linux.ibm.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      180ca71c
    • T
      perf report: Fix OOM error in TUI mode on s390 · 8a07aa4e
      Thomas Richter 提交于
      Debugging a OOM error using the TUI interface revealed this issue
      on s390:
      
      [tmricht@m83lp54 perf]$ cat /proc/kallsyms |sort
      ....
      00000001119b7158 B radix_tree_node_cachep
      00000001119b8000 B __bss_stop
      00000001119b8000 B _end
      000003ff80002850 t autofs_mount	[autofs4]
      000003ff80002868 t autofs_show_options	[autofs4]
      000003ff80002a98 t autofs_evict_inode	[autofs4]
      ....
      
      There is a huge gap between the last kernel symbol
      __bss_stop/_end and the first kernel module symbol
      autofs_mount (from autofs4 module).
      
      After reading the kernel symbol table via functions:
      
       dso__load()
       +--> dso__load_kernel_sym()
            +--> dso__load_kallsyms()
      	   +--> __dso_load_kallsyms()
      	        +--> symbols__fixup_end()
      
      the symbol __bss_stop has a start address of 1119b8000 and
      an end address of 3ff80002850, as can be seen by this debug statement:
      
        symbols__fixup_end __bss_stop start:0x1119b8000 end:0x3ff80002850
      
      The size of symbol __bss_stop is 0x3fe6e64a850 bytes!
      It is the last kernel symbol and fills up the space until
      the first kernel module symbol.
      
      This size kills the TUI interface when executing the following
      code:
      
        process_sample_event()
          hist_entry_iter__add()
            hist_iter__report_callback()
              hist_entry__inc_addr_samples()
                symbol__inc_addr_samples(symbol = __bss_stop)
                  symbol__cycles_hist()
                     annotated_source__alloc_histograms(...,
      				                symbol__size(sym),
      		                                ...)
      
      This function allocates memory to save sample histograms.
      The symbol_size() marco is defined as sym->end - sym->start, which
      results in above value of 0x3fe6e64a850 bytes and
      the call to calloc() in annotated_source__alloc_histograms() fails.
      
      The histgram memory allocation might fail, make this failure
      no-fatal and continue processing.
      
      Output before:
      [tmricht@m83lp54 perf]$ ./perf --debug stderr=1 report -vvvvv \
      					      -i ~/slow.data 2>/tmp/2
      [tmricht@m83lp54 perf]$ tail -5 /tmp/2
        __symbol__inc_addr_samples(875): ENOMEM! sym->name=__bss_stop,
      		start=0x1119b8000, addr=0x2aa0005eb08, end=0x3ff80002850,
      		func: 0
      problem adding hist entry, skipping event
      0x938b8 [0x8]: failed to process type: 68 [Cannot allocate memory]
      [tmricht@m83lp54 perf]$
      
      Output after:
      [tmricht@m83lp54 perf]$ ./perf --debug stderr=1 report -vvvvv \
      					      -i ~/slow.data 2>/tmp/2
      [tmricht@m83lp54 perf]$ tail -5 /tmp/2
         symbol__inc_addr_samples map:0x1597830 start:0x110730000 end:0x3ff80002850
         symbol__hists notes->src:0x2aa2a70 nr_hists:1
         symbol__inc_addr_samples sym:unlink_anon_vmas src:0x2aa2a70
         __symbol__inc_addr_samples: addr=0x11094c69e
         0x11094c670 unlink_anon_vmas: period++ [addr: 0x11094c69e, 0x2e, evidx=0]
         	=> nr_samples: 1, period: 526008
      [tmricht@m83lp54 perf]$
      
      There is no error about failed memory allocation and the TUI interface
      shows all entries.
      Signed-off-by: NThomas Richter <tmricht@linux.ibm.com>
      Reviewed-by: NHendrik Brueckner <brueckner@linux.ibm.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
      Link: http://lkml.kernel.org/r/90cb5607-3e12-5167-682d-978eba7dafa8@linux.ibm.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      8a07aa4e
    • A
      perf time-utils: Add support for multiple explicit time intervals · a77a05e2
      Adrian Hunter 提交于
      Currently only a single explicit time range is accepted. Add support for
      multiple ranges separated by spaces, which requires the string to be
      quoted. Update the time utils test accordingly.
      Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com>
      Cc: Jin Yao <yao.jin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Link: http://lkml.kernel.org/r/20190604130017.31207-20-adrian.hunter@intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      a77a05e2
    • A
      perf time-utils: Make perf_time__parse_for_ranges() more logical · 929afa00
      Adrian Hunter 提交于
      Explicit time ranges never contain a percent sign whereas percentage
      ranges always do, so it is possible to call the correct parser.
      Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com>
      Cc: Jin Yao <yao.jin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Link: http://lkml.kernel.org/r/20190604130017.31207-18-adrian.hunter@intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      929afa00
    • A
      perf time-utils: Simplify perf_time__parse_for_ranges() error paths slightly · 2a8afddc
      Adrian Hunter 提交于
      Simplify perf_time__parse_for_ranges() error paths slightly.
      Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com>
      Cc: Jin Yao <yao.jin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Link: http://lkml.kernel.org/r/20190604130017.31207-17-adrian.hunter@intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      2a8afddc
    • A
      perf time-utils: Prevent percentage time range overlap · b16bfeb3
      Adrian Hunter 提交于
      Prevent percentage time range overlap. This is only a 1 nanosecond
      change but makes the results more logical e.g. a sample cannot be in
      both the first 10% and the second 20%.
      
      Note, there is a later patch that adds a test for time-utils.
      Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com>
      Cc: Jin Yao <yao.jin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Link: http://lkml.kernel.org/r/20190604130017.31207-15-adrian.hunter@intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      b16bfeb3
    • A
      perf time-utils: Factor out set_percent_time() · c763242a
      Adrian Hunter 提交于
      Factor out set_percent_time() so it can be reused.
      Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com>
      Cc: Jin Yao <yao.jin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Link: http://lkml.kernel.org/r/20190604130017.31207-14-adrian.hunter@intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      c763242a
    • A
      perf time-utils: Treat time ranges consistently · f79a7689
      Adrian Hunter 提交于
      Currently, options allow only 1 explicit (non-percentage) time range.
      In preparation for adding support for multiple explicit time ranges,
      treat time ranges consistently.
      
      Instead of treating some time ranges as inclusive and some as excluding
      the end time, treat all time ranges as inclusive. This is only a 1
      nanosecond change but is necessary to treat multiple explicit time
      ranges in a consistent manner.
      
      Note, there is a later patch that adds a test for time-utils.
      Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com>
      Cc: Jin Yao <yao.jin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Link: http://lkml.kernel.org/r/20190604130017.31207-13-adrian.hunter@intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      f79a7689
    • A
      perf intel-pt: Add support for efficient time interval filtering · 2c47db90
      Adrian Hunter 提交于
      Set up time ranges for efficient time interval filtering using the new
      "fast forward" facility.
      
      Because decoding is done in time order, intel_pt_time_filter() needs to
      look only at the next start or end timestamp - refer intel_pt_next_time().
      Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com>
      Cc: Jin Yao <yao.jin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Link: http://lkml.kernel.org/r/20190604130017.31207-12-adrian.hunter@intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      2c47db90