1. 10 10月, 2019 13 次提交
  2. 09 10月, 2019 3 次提交
  3. 07 10月, 2019 2 次提交
  4. 01 10月, 2019 10 次提交
  5. 26 9月, 2019 9 次提交
    • A
      perf parser: Remove needless include directives · d6840d87
      Arnaldo Carvalho de Melo 提交于
      They go on accumulating there like the debug.h one, that was introduced
      here:
      
        f2361024 ("perf list: Add debug support for outputing alias string")
      
      But then, when that need is removed via:
      
        2073ad33 ("perf tools: Factor out PMU matching in parser")
      
      The thing stays there, so continue the house cleaning spree...
      
      list.h not needed, no macros from there are used, and 'struct
      list_head' is in linux/types.h, ditto for util.h, no need for that as
      well.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: https://lkml.kernel.org/n/tip-zkxr3mf6inun8m5mbnil4u0d@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      d6840d87
    • T
      perf jvmti: Include JVMTI support for s390 · 61bf4ee2
      Thomas Richter 提交于
      Enable JVMTI support for s390 perf tool chain.
      Signed-off-by: NThomas Richter <tmricht@linux.ibm.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Hendrik Brueckner <brueckner@linux.ibm.com>
      Cc: Vasily Gorbik <gor@linux.ibm.com>
      Link: http://lore.kernel.org/lkml/20190909114116.50469-3-tmricht@linux.ibm.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      61bf4ee2
    • A
      perf evlist: Fix access of freed id arrays · 7834fa94
      Andi Kleen 提交于
      I'm not fully sure if this is the correct fix, but without this I get
      crashes on more complex perf stat metric usages. The problem is that
      part of the state gets freed when a weak group fails, but then is later
      still used. Just don't free the ids, we're going to reuse them anyways
      on the weak group retry.
      
      For example:
      
        % perf stat -M IpB,IpCall,IpTB,IPC,Retiring_SMT,Frontend_Bound_SMT,Kernel_Utilization,CPU_Utilization --metric-only -a -I 1000 sleep 2
      
        crashes and gives in valgrind:
      
        =21527== Invalid write of size 8
        ==21527==    at 0x4EE582: hlist_add_head (list.h:644)
        ==21527==    by 0x4EFD3C: perf_evlist__id_hash (evlist.c:477)
        ==21527==    by 0x4EFD99: perf_evlist__id_add (evlist.c:483)
        ==21527==    by 0x4EFF15: perf_evlist__id_add_fd (evlist.c:524)
        ==21527==    by 0x4FC693: store_evsel_ids (evsel.c:2969)
        ==21527==    by 0x4FC76C: perf_evsel__store_ids (evsel.c:2986)
        ==21527==    by 0x450DA7: __run_perf_stat (builtin-stat.c:519)
        ==21527==    by 0x451285: run_perf_stat (builtin-stat.c:636)
        ==21527==    by 0x454619: cmd_stat (builtin-stat.c:1966)
        ==21527==    by 0x4D557D: run_builtin (perf.c:310)
        ==21527==    by 0x4D57EA: handle_internal_command (perf.c:362)
        ==21527==    by 0x4D5931: run_argv (perf.c:406)
        ==21527==  Address 0x12e3f008 is 104 bytes inside a block of size 2,056 free'd
        ==21527==    at 0x4839A0C: free (vg_replace_malloc.c:540)
        ==21527==    by 0x627139: xyarray__delete (xyarray.c:32)
        ==21527==    by 0x4F6BE4: perf_evsel__free_id (evsel.c:1253)
        ==21527==    by 0x4FA11F: evsel__close (evsel.c:1994)
        ==21527==    by 0x4F30A3: perf_evlist__reset_weak_group (evlist.c:1783)
        ==21527==    by 0x450B47: __run_perf_stat (builtin-stat.c:466)
        ==21527==    by 0x451285: run_perf_stat (builtin-stat.c:636)
        ==21527==    by 0x454619: cmd_stat (builtin-stat.c:1966)
        ==21527==    by 0x4D557D: run_builtin (perf.c:310)
        ==21527==    by 0x4D57EA: handle_internal_command (perf.c:362)
        ==21527==    by 0x4D5931: run_argv (perf.c:406)
        ==21527==    by 0x4D5CAE: main (perf.c:531)
        ==21527==  Block was alloc'd at
        ==21527==    at 0x483AB1A: calloc (vg_replace_malloc.c:762)
        ==21527==    by 0x627024: zalloc (zalloc.c:8)
        ==21527==    by 0x627088: xyarray__new (xyarray.c:10)
        ==21527==    by 0x4F6B20: perf_evsel__alloc_id (evsel.c:1237)
        ==21527==    by 0x4FC74E: perf_evsel__store_ids (evsel.c:2983)
        ==21527==    by 0x450DA7: __run_perf_stat (builtin-stat.c:519)
        ==21527==    by 0x451285: run_perf_stat (builtin-stat.c:636)
        ==21527==    by 0x454619: cmd_stat (builtin-stat.c:1966)
        ==21527==    by 0x4D557D: run_builtin (perf.c:310)
        ==21527==    by 0x4D57EA: handle_internal_command (perf.c:362)
        ==21527==    by 0x4D5931: run_argv (perf.c:406)
        ==21527==    by 0x4D5CAE: main (perf.c:531)
      Signed-off-by: NAndi Kleen <ak@linux.intel.com>
      Acked-by: NJiri Olsa <jolsa@kernel.org>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Link: http://lore.kernel.org/lkml/20190923233339.25326-1-andi@firstfloor.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      7834fa94
    • A
      perf stat: Fix free memory access / memory leaks in metrics · 6f6473c3
      Andi Kleen 提交于
      Make sure to not free the name passed in by the caller, but free all the
      allocated ids when parsing expressions.
      
      The loop at the end knows that the first entry shouldn't be freed, so
      make sure the caller name is the first entry.
      
      Fixes
      
        % perf stat -M IpB,IpCall,IpTB,IPC,Retiring_SMT,Frontend_Bound_SMT,Kernel_Utilization,CPU_Utilization --metric-only -a -I 1000 sleep 2
      
        valgrind:
             1.009943231 ==21527== Invalid read of size 1
        ==21527==    at 0x483CB74: strcmp (vg_replace_strmem.c:849)
        ==21527==    by 0x582CF8: collect_all_aliases (stat-display.c:554)
        ==21527==    by 0x582EB3: collect_data (stat-display.c:577)
        ==21527==    by 0x583A32: print_counter_aggr (stat-display.c:806)
        ==21527==    by 0x584FAD: perf_evlist__print_counters (stat-display.c:1200)
        ==21527==    by 0x45133A: print_counters (builtin-stat.c:655)
        ==21527==    by 0x450629: process_interval (builtin-stat.c:353)
        ==21527==    by 0x450FBD: __run_perf_stat (builtin-stat.c:564)
        ==21527==    by 0x451285: run_perf_stat (builtin-stat.c:636)
        ==21527==    by 0x454619: cmd_stat (builtin-stat.c:1966)
        ==21527==    by 0x4D557D: run_builtin (perf.c:310)
        ==21527==    by 0x4D57EA: handle_internal_command (perf.c:362)
        ==21527==  Address 0x12826cd0 is 0 bytes inside a block of size 25 free'd
        ==21527==    at 0x4839A0C: free (vg_replace_malloc.c:540)
        ==21527==    by 0x627041: __zfree (zalloc.c:13)
        ==21527==    by 0x57F66A: generic_metric (stat-shadow.c:814)
        ==21527==    by 0x580B21: perf_stat__print_shadow_stats (stat-shadow.c:1057)
        ==21527==    by 0x58418E: print_metric_headers (stat-display.c:943)
        ==21527==    by 0x5844BC: print_interval (stat-display.c:1004)
        ==21527==    by 0x584DEB: perf_evlist__print_counters (stat-display.c:1172)
        ==21527==    by 0x45133A: print_counters (builtin-stat.c:655)
        ==21527==    by 0x450629: process_interval (builtin-stat.c:353)
        ==21527==    by 0x450FBD: __run_perf_stat (builtin-stat.c:564)
        ==21527==    by 0x451285: run_perf_stat (builtin-stat.c:636)
        ==21527==    by 0x454619: cmd_stat (builtin-stat.c:1966)
        ==21527==  Block was alloc'd at
        ==21527==    at 0x483880B: malloc (vg_replace_malloc.c:309)
        ==21527==    by 0x51677DE: strdup (in /usr/lib64/libc-2.29.so)
        ==21527==    by 0x506457: parse_events_name (parse-events.c:1754)
        ==21527==    by 0x5550BB: parse_events_parse (parse-events.y:214)
        ==21527==    by 0x50694D: parse_events__scanner (parse-events.c:1887)
        ==21527==    by 0x506AEF: parse_events (parse-events.c:1927)
        ==21527==    by 0x521D8B: metricgroup__parse_groups (metricgroup.c:527)
        ==21527==    by 0x45156F: parse_metric_groups (builtin-stat.c:721)
        ==21527==    by 0x6228A9: get_value (parse-options.c:243)
        ==21527==    by 0x62363F: parse_short_opt (parse-options.c:348)
        ==21527==    by 0x62363F: parse_options_step (parse-options.c:536)
        ==21527==    by 0x62363F: parse_options_subcommand (parse-options.c:651)
        ==21527==    by 0x453C1D: cmd_stat (builtin-stat.c:1718)
        ==21527==    by 0x4D557D: run_builtin (perf.c:310)
      
      and also a leak report.
      
      Committer testing:
      
      Before:
      
        # perf stat -M IpB,IpCall,IpTB,IPC,Retiring_SMT,Frontend_Bound_SMT,Kernel_Utilization,CPU_Utilization --metric-only -a -I 1000 sleep 2
        #           time      CPU_Utilization
             1.000470810                      free(): double free detected in tcache 2
        Aborted (core dumped)
        #
      
      After:
      
        # perf stat -M IpB,IpCall,IpTB,IPC,Retiring_SMT,Frontend_Bound_SMT,Kernel_Utilization,CPU_Utilization --metric-only -a -I 1000 sleep 2
        #           time      CPU_Utilization
             1.000494752                  0.1
             2.001105112                  0.1
        #
      Signed-off-by: NAndi Kleen <ak@linux.intel.com>
      Acked-by: NJiri Olsa <jolsa@kernel.org>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Link: http://lore.kernel.org/lkml/20190923233339.25326-3-andi@firstfloor.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      6f6473c3
    • A
      perf tools: Replace needless mmap.h with what is needed, event.h · 252a2fdc
      Arnaldo Carvalho de Melo 提交于
      The perf_sample struct definition and the event_attr_init() are in
      util/event.h, but some places were getting it thru an otherwise needless
      util/mmap.h header, fix it by including util/event.h directly.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: https://lkml.kernel.org/n/tip-p1anwyjdbbvghrkl9dlxv7h5@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      252a2fdc
    • A
      perf evsel: Move config terms to a separate header · 95be9d19
      Arnaldo Carvalho de Melo 提交于
      Further reducing the size of util/evsel.h.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: https://lkml.kernel.org/n/tip-20zr7di9eynm0272mtjfdhfc@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      95be9d19
    • A
      perf evlist: Remove unused perf_evlist__fprintf() method · bd704620
      Arnaldo Carvalho de Melo 提交于
      Ditch it, noone is using it, one more stdio.h include in a hot header.
      
      Fix the fallout in parse-events.y, where we end up using a FILE pointer,
      I think due to YYDEBUG being set and in some places, like Amazon Linux 1
      we don't get stdio.h included by luck, like in most other places, add a
      explicit stdio.h include directive.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: https://lkml.kernel.org/n/tip-37k5q0lhdbo2hvvfbnnzn7og@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      bd704620
    • A
      perf evsel: Introduce evsel_fprintf.h · ca125277
      Arnaldo Carvalho de Melo 提交于
      We already had evsel_fprintf.c, add its counterpart, so that we can
      reduce evsel.h a bit more.
      
      We needed a new perf_event_attr_fprintf.c file so as to have a separate
      object to link with the python binding in tools/perf/util/python-ext-sources
      and not drag symbol_conf, etc into the python binding.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: https://lkml.kernel.org/n/tip-06bdmt1062d9unzgqmxwlv88@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      ca125277
    • A
      perf evsel: Remove need for symbol_conf in evsel_fprintf.c · 9620bc36
      Arnaldo Carvalho de Melo 提交于
      So that we an later link it to the python binding without having to
      drag the symbol object files.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: https://lkml.kernel.org/n/tip-8823tveyasocnuoelq4qopwf@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      9620bc36
  6. 25 9月, 2019 3 次提交