1. 19 7月, 2017 12 次提交
  2. 20 6月, 2017 1 次提交
  3. 15 6月, 2017 1 次提交
    • J
      perf tools: Fix build with ARCH=x86_64 · 7a759cd8
      Jiada Wang 提交于
      With commit: 0a943cb1 (tools build: Add HOSTARCH Makefile variable)
      when building for ARCH=x86_64, ARCH=x86_64 is passed to perf instead of
      ARCH=x86, so the perf build process searchs header files from
      tools/arch/x86_64/include, which doesn't exist.
      
      The following build failure is seen:
      
        In file included from util/event.c:2:0:
          tools/include/uapi/linux/mman.h:4:27: fatal error: uapi/asm/mman.h: No such file or directory
          compilation terminated.
      
      Fix this issue by using SRCARCH instead of ARCH in perf, just like the
      main kernel Makefile and tools/objtool's.
      Signed-off-by: NJiada Wang <jiada_wang@mentor.com>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Acked-by: NJiri Olsa <jolsa@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Eugeniu Rosca <erosca@de.adit-jv.com>
      Cc: Jan Stancek <jstancek@redhat.com>
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
      Cc: Rui Teng <rui.teng@linux.vnet.ibm.com>
      Cc: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
      Cc: Wang Nan <wangnan0@huawei.com>
      Fixes: 0a943cb1 ("tools build: Add HOSTARCH Makefile variable")
      Link: http://lkml.kernel.org/r/1491793357-14977-2-git-send-email-jiada_wang@mentor.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      7a759cd8
  4. 06 6月, 2017 2 次提交
    • N
      perf symbols: Set module info when build-id event found · 6b335e8f
      Namhyung Kim 提交于
      Like machine__findnew_module_dso(), it should set necessary info for
      kernel modules to find symbol info from the file.  Factor out
      dso__set_module_info() to do it.
      
      This is needed for dso__needs_decompress() to detect such DSOs.
      Signed-off-by: NNamhyung Kim <namhyung@kernel.org>
      Acked-by: NJiri Olsa <jolsa@kernel.org>
      Cc: Andi Kleen <andi@firstfloor.org>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: kernel-team@lge.com
      Link: http://lkml.kernel.org/r/20170531120105.21731-2-namhyung@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      6b335e8f
    • N
      perf header: Set proper module name when build-id event found · 1deec1bd
      Namhyung Kim 提交于
      When perf processes build-id event, it creates DSOs with the build-id.
      But it didn't set the module short name (like '[module-name]') so when
      processing a kernel mmap event of the module, it cannot found the DSO as
      it only checks the short names.
      
      That leads for perf to create a same DSO without the build-id info and
      it'll lookup the system path even if the DSO is already in the build-id
      cache.  After kernel was updated, perf cannot find the DSO  and cannot
      show symbols in it anymore.
      
      You can see this if you have an old data file (w/ old kernel version):
      
        $ perf report -i perf.data.old -v |& grep scsi_mod
        build id event received for /lib/modules/3.19.2-1-ARCH/kernel/drivers/scsi/scsi_mod.ko.gz : cafe1ce6ca13a98a5d9ed3425cde249e57a27fc1
        Failed to open /lib/modules/3.19.2-1-ARCH/kernel/drivers/scsi/scsi_mod.ko.gz, continuing without symbols
        ...
      
      The second message didn't show the build-id.  With this patch:
      
        $ perf report -i perf.data.old -v |& grep scsi_mod
        build id event received for /lib/modules/3.19.2-1-ARCH/kernel/drivers/scsi/scsi_mod.ko.gz: cafe1ce6ca13a98a5d9ed3425cde249e57a27fc1
        /lib/modules/3.19.2-1-ARCH/kernel/drivers/scsi/scsi_mod.ko.gz with build id cafe1ce6ca13a98a5d9ed3425cde249e57a27fc1 not found, continuing without symbols
        ...
      
      Now it shows the build-id but still cannot load the symbol table.  This
      is a different problem which will be fixed in the next patch.
      Signed-off-by: NNamhyung Kim <namhyung@kernel.org>
      Acked-by: NJiri Olsa <jolsa@kernel.org>
      Cc: Andi Kleen <andi@firstfloor.org>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: kernel-team@lge.com
      Link: http://lkml.kernel.org/r/20170531120105.21731-1-namhyung@kernel.org
      [ Fix the build on older compilers (debian <= 8, fedora <= 21, etc) wrt kmod_path var init ]
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      1deec1bd
  5. 26 4月, 2017 1 次提交
  6. 25 4月, 2017 2 次提交
  7. 20 4月, 2017 4 次提交
  8. 12 4月, 2017 1 次提交
  9. 28 3月, 2017 2 次提交
  10. 17 2月, 2017 2 次提交
    • J
      perf tools: Replace _SC_NPROCESSORS_CONF with max_present_cpu in cpu_topology_map · da8a58b5
      Jan Stancek 提交于
      There are 2 problems wrt. cpu_topology_map on systems with sparse CPUs:
      
      1. offline/absent CPUs will have their socket_id and core_id set to -1
         which triggers:
         "socket_id number is too big.You may need to upgrade the perf tool."
      
      2. size of cpu_topology_map (perf_env.cpu[]) is allocated based on
         _SC_NPROCESSORS_CONF, but can be indexed with CPU ids going above.
         Users of perf_env.cpu[] are using CPU id as index. This can lead
         to read beyond what was allocated:
         ==19991== Invalid read of size 4
         ==19991==    at 0x490CEB: check_cpu_topology (topology.c:69)
         ==19991==    by 0x490CEB: test_session_topology (topology.c:106)
         ...
      
      For example:
        _SC_NPROCESSORS_CONF == 16
        available: 2 nodes (0-1)
        node 0 cpus: 0 6 8 10 16 22 24 26
        node 0 size: 12004 MB
        node 0 free: 9470 MB
        node 1 cpus: 1 7 9 11 23 25 27
        node 1 size: 12093 MB
        node 1 free: 9406 MB
        node distances:
        node   0   1
          0:  10  20
          1:  20  10
      
      This patch changes HEADER_NRCPUS.nr_cpus_available from _SC_NPROCESSORS_CONF
      to max_present_cpu and updates any user of cpu_topology_map to iterate
      with nr_cpus_avail.
      
      As a consequence HEADER_CPU_TOPOLOGY core_id and socket_id lists get longer,
      but maintain compatibility with pre-patch state - index to cpu_topology_map is
      CPU id.
      
        perf test 36 -v
        36: Session topology                           :
        --- start ---
        test child forked, pid 22211
        templ file: /tmp/perf-test-gmdX5i
        CPU 0, core 0, socket 0
        CPU 1, core 0, socket 1
        CPU 6, core 10, socket 0
        CPU 7, core 10, socket 1
        CPU 8, core 1, socket 0
        CPU 9, core 1, socket 1
        CPU 10, core 9, socket 0
        CPU 11, core 9, socket 1
        CPU 16, core 0, socket 0
        CPU 22, core 10, socket 0
        CPU 23, core 10, socket 1
        CPU 24, core 1, socket 0
        CPU 25, core 1, socket 1
        CPU 26, core 9, socket 0
        CPU 27, core 9, socket 1
        test child finished with 0
        ---- end ----
        Session topology: Ok
      Signed-off-by: NJan Stancek <jstancek@redhat.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/d7c05c6445fca74a8442c2c73cfffd349c52c44f.1487146877.git.jstancek@redhat.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      da8a58b5
    • J
      perf header: Make build_cpu_topology skip offline/absent CPUs · 43db2843
      Jan Stancek 提交于
      When build_cpu_topo() encounters offline/absent CPUs, it fails to find any
      sysfs entries and returns failure.
      
      This leads to build_cpu_topology() and write_cpu_topology() failing as
      well.
      
      Because HEADER_CPU_TOPOLOGY has not been written, read leaves cpu_topology_map
      NULL and we get NULL ptr deref at:
      
        ...
         cmd_test
          __cmd_test
           test_and_print
            run_test
             test_session_topology
              check_cpu_topology
      
        36: Session topology                           :
        --- start ---
        test child forked, pid 14902
        templ file: /tmp/perf-test-4CKocW
        failed to write feature HEADER_CPU_TOPOLOGY
        perf: Segmentation fault
        Obtained 9 stack frames.
        ./perf(sighandler_dump_stack+0x41) [0x5095f1]
        /lib64/libc.so.6(+0x35250) [0x7f4b7c3c9250]
        ./perf(test_session_topology+0x1db) [0x490ceb]
        ./perf() [0x475b68]
        ./perf(cmd_test+0x5b9) [0x4763c9]
        ./perf() [0x4945a3]
        ./perf(main+0x69f) [0x427e8f]
        /lib64/libc.so.6(__libc_start_main+0xf5) [0x7f4b7c3b5b35]
        ./perf() [0x427fb9]
        test child interrupted
        ---- end ----
        Session topology: FAILED!
      
      This patch makes build_cpu_topology() skip offline/absent CPUs, by checking
      their presence against cpu_map built from online CPUs.
      Signed-off-by: NJan Stancek <jstancek@redhat.com>
      Acked-by: NJiri Olsa <jolsa@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/a271b770175524f4961d4903af33798358a4a518.1487146877.git.jstancek@redhat.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      43db2843
  11. 09 2月, 2017 1 次提交
    • A
      perf header: Fix handling of PERF_EVENT_UPDATE__SCALE · 8434a2ec
      Arnaldo Carvalho de Melo 提交于
      In commit daeecbc0 ("perf tools: Add event_update event scale type"), the
      handling of PERF_EVENT_UPDATE__SCALE cast struct event_update_event->data to a
      pointer to event_update_event_scale, uses some field from this casted struct
      and then ends up falling through to the handling of another event type,
      PERF_EVENT_UPDATE__CPUS were it casts that ev->data to yet another type, oops,
      fix it by inserting the missing break.
      
      Noticed when building perf using gcc 7 on Fedora Rawhide:
      
        util/header.c: In function 'perf_event__process_event_update':
        util/header.c:3207:16: error: this statement may fall through [-Werror=implicit-fallthrough=]
           evsel->scale = ev_scale->scale;
           ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
        util/header.c:3208:2: note: here
          case PERF_EVENT_UPDATE__CPUS:
          ^~~~
      
      This wasn't noticed because probably PERF_EVENT_UPDATE__CPUS comes after
      PERF_EVENT_UPDATE__SCALE, so we would just create a bogus evsel->own_cpus when
      processing a PERF_EVENT_UPDATE__SCALE to then leak it and create a new cpu map
      with the correct data.
      
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kan Liang <kan.liang@intel.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Fixes: daeecbc0 ("perf tools: Add event_update event scale type")
      Link: http://lkml.kernel.org/n/tip-lukcf9hdj092ax2914ss95at@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      8434a2ec
  12. 26 1月, 2017 1 次提交
  13. 17 1月, 2017 1 次提交
  14. 24 10月, 2016 3 次提交
  15. 13 10月, 2016 1 次提交
  16. 24 8月, 2016 1 次提交
  17. 05 7月, 2016 1 次提交
  18. 23 6月, 2016 1 次提交
  19. 12 5月, 2016 1 次提交
  20. 10 5月, 2016 1 次提交