1. 29 11月, 2019 1 次提交
  2. 20 10月, 2019 3 次提交
  3. 16 10月, 2019 1 次提交
  4. 15 10月, 2019 2 次提交
  5. 10 10月, 2019 17 次提交
  6. 09 10月, 2019 3 次提交
  7. 07 10月, 2019 1 次提交
  8. 26 9月, 2019 2 次提交
    • 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 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
  9. 25 9月, 2019 10 次提交