1. 13 4月, 2017 1 次提交
  2. 01 2月, 2017 1 次提交
  3. 12 1月, 2017 1 次提交
  4. 02 12月, 2016 1 次提交
    • D
      perf tools: Move parse_nsec_time to time-utils.c · c284d669
      David Ahern 提交于
      Code move only; no functional change intended.
      
      Committer notes:
      
      Fix the build on Ubuntu 16.04 x86-64 cross-compiling to S/390, with this
      set of auto-detected features:
      
        ...                         dwarf: [ on  ]
        ...            dwarf_getlocations: [ on  ]
        ...                         glibc: [ on  ]
        ...                          gtk2: [ OFF ]
        ...                      libaudit: [ OFF ]
        ...                        libbfd: [ OFF ]
        ...                        libelf: [ on  ]
        ...                       libnuma: [ OFF ]
        ...        numa_num_possible_cpus: [ OFF ]
        ...                       libperl: [ OFF ]
        ...                     libpython: [ OFF ]
        ...                      libslang: [ OFF ]
        ...                     libcrypto: [ OFF ]
        ...                     libunwind: [ OFF ]
        ...            libdw-dwarf-unwind: [ on  ]
        ...                          zlib: [ on  ]
        ...                          lzma: [ OFF ]
        ...                     get_cpuid: [ OFF ]
        ...                           bpf: [ on  ]
      
      Where it was failing with:
      
          CC       /tmp/build/perf/util/time-utils.o
        util/time-utils.c: In function 'parse_nsec_time':
        util/time-utils.c:17:13: error: implicit declaration of function 'strtoul' [-Werror=implicit-function-declaration]
          time_sec = strtoul(str, &end, 10);
                     ^
        util/time-utils.c:17:2: error: nested extern declaration of 'strtoul' [-Werror=nested-externs]
          time_sec = strtoul(str, &end, 10);
          ^
        util/time-utils.c: In function 'perf_time__parse_str':
        util/time-utils.c:93:2: error: implicit declaration of function 'free' [-Werror=implicit-function-declaration]
          free(str);
          ^
        util/time-utils.c:93:2: error: incompatible implicit declaration of built-in function 'free' [-Werror]
        util/time-utils.c:93:2: note: include '<stdlib.h>' or provide a declaration of 'free'
      
      Do as suggested and add a '#include <stdlib.h>' to get the free() and strtoul()
      declarations and fix the build.
      Signed-off-by: NDavid Ahern <dsahern@gmail.com>
      Acked-by: NNamhyung Kim <namhyung@kernel.org>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/1480439746-42695-3-git-send-email-dsahern@gmail.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      c284d669
  5. 25 11月, 2016 1 次提交
    • W
      perf tools: Fix kernel version error in ubuntu · d18acd15
      Wang Nan 提交于
      On ubuntu the internal kernel version code is different from what can
      be retrived from uname:
      
       $ uname -r
       4.4.0-47-generic
       $ cat /lib/modules/`uname -r`/build/include/generated/uapi/linux/version.h
       #define LINUX_VERSION_CODE 263192
       #define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
       $ cat /lib/modules/`uname -r`/build/include/generated/utsrelease.h
       #define UTS_RELEASE "4.4.0-47-generic"
       #define UTS_UBUNTU_RELEASE_ABI 47
       $ cat /proc/version_signature
       Ubuntu 4.4.0-47.68-generic 4.4.24
      
      The macro LINUX_VERSION_CODE is set to 4.4.24 (263192 == 0x40418), but
      `uname -r` reports 4.4.0.
      
      This mismatch causes LINUX_VERSION_CODE macro passed to BPF script become
      an incorrect value, results in magic failure in BPF loading:
      
       $ sudo ./buildperf/perf record -e ./tools/perf/tests/bpf-script-example.c ls
       event syntax error: './tools/perf/tests/bpf-script-example.c'
                            \___ Failed to load program for unknown reason
      
      According to Ubuntu document (https://wiki.ubuntu.com/Kernel/FAQ), the
      correct kernel version can be retrived through /proc/version_signature, which
      is ubuntu specific.
      
      This patch checks the existance of /proc/version_signature, and returns
      version number through parsing this file instead of uname. Version string
      is untouched (value returns from uname) because `uname -r` is required
      to be consistence with path of kbuild directory in /lib/module.
      Signed-off-by: NWang Nan <wangnan0@huawei.com>
      Cc: Alexei Starovoitov <ast@fb.com>
      Cc: He Kuang <hekuang@huawei.com>
      Cc: Zefan Li <lizefan@huawei.com>
      Cc: pi3orama@163.com
      Link: http://lkml.kernel.org/r/20161115040617.69788-2-wangnan0@huawei.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      d18acd15
  6. 28 10月, 2016 1 次提交
    • N
      perf tools: Introduce timestamp__scnprintf_usec() · 99620a5d
      Namhyung Kim 提交于
      Joonwoo reported that there's a mismatch between timestamps in script
      and sched commands.  This was because of difference in printing the
      timestamp.  Factor out the code and share it so that they can be in
      sync.  Also I found that sched map has similar problem, fix it too.
      
      Committer notes:
      
      Fixed the max_lat_at bug introduced by Namhyung's original patch, as
      pointed out by Joonwoo, and made it a function following the scnprintf()
      model, i.e. returning the number of bytes formatted, and receiving as
      the first parameter the object from where the data to the formatting is
      obtained, renaming it from:
      
         char *timestamp_in_usec(char *bf, size_t size, u64 timestamp)
      
      to
      
         int timestamp__scnprintf_usec(u64 timestamp, char *bf, size_t size)
      Reported-by: NJoonwoo Park <joonwoop@codeaurora.org>
      Signed-off-by: NNamhyung Kim <namhyung@kernel.org>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/20161024020246.14928-3-namhyung@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      99620a5d
  7. 24 8月, 2016 1 次提交
  8. 19 7月, 2016 1 次提交
  9. 05 7月, 2016 1 次提交
  10. 14 6月, 2016 1 次提交
  11. 17 5月, 2016 1 次提交
    • A
      perf tools: Separate accounting of contexts and real addresses in a stack trace · a29d5c9b
      Arnaldo Carvalho de Melo 提交于
      The perf_sample->ip_callchain->nr value includes all the entries in the
      ip_callchain->ip[] array, real addresses and PERF_CONTEXT_{KERNEL,USER,etc},
      while what the user expects is that what is in the kernel.perf_event_max_stack
      sysctl or in the upcoming per event perf_event_attr.sample_max_stack knob be
      honoured in terms of IP addresses in the stack trace.
      
      So match the kernel support and validate chain->nr taking into account
      both kernel.perf_event_max_stack and kernel.perf_event_max_contexts_per_stack.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Alexei Starovoitov <ast@kernel.org>
      Cc: Brendan Gregg <brendan.d.gregg@gmail.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: He Kuang <hekuang@huawei.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Cc: Milian Wolff <milian.wolff@kdab.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Vince Weaver <vincent.weaver@maine.edu>
      Cc: Wang Nan <wangnan0@huawei.com>
      Cc: Zefan Li <lizefan@huawei.com>
      Link: http://lkml.kernel.org/n/tip-mgx0jpzfdq4uq4abfa40byu0@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      a29d5c9b
  12. 12 5月, 2016 1 次提交
  13. 10 5月, 2016 1 次提交
  14. 27 4月, 2016 2 次提交
  15. 24 2月, 2016 1 次提交
  16. 17 2月, 2016 1 次提交
  17. 30 1月, 2016 1 次提交
  18. 26 1月, 2016 1 次提交
  19. 12 1月, 2016 1 次提交
  20. 09 1月, 2016 1 次提交
    • N
      perf report: Show random usage tip on the help line · 14cbfbeb
      Namhyung Kim 提交于
      Currently perf report only shows a help message "For a higher level
      overview, try: perf report --sort comm,dso" unconditionally (even if
      the sort keys were used).  Add more help tips and show randomly.
      
      Load tips from ${prefix}/share/doc/perf-tip/tips.txt file.
      
        $ perf report | tail
            0.10%  swapper  [kernel.vmlinux]   [k] irq_exit
            0.09%  swapper  [kernel.vmlinux]   [k] flush_smp_call_function_queue
            0.08%  swapper  [kernel.vmlinux]   [k] native_write_msr_safe
            0.03%  swapper  [kernel.vmlinux]   [k] group_sched_in
            0.01%  perf     [kernel.vmlinux]   [k] native_write_msr_safe
      
        #
        # (Tip: Search options using a keyword: perf report -h <keyword>)
        #
      Signed-off-by: NNamhyung Kim <namhyung@kernel.org>
      Acked-by: NIngo Molnar <mingo@kernel.org>
      Cc: Andi Kleen <andi@firstfloor.org>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/r/1452166913-27046-1-git-send-email-namhyung@kernel.org
      [ Renamed it to perf_tip() and the parameter dirname to dirpath to fix the build on older distros ]
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      14cbfbeb
  21. 14 12月, 2015 1 次提交
  22. 10 12月, 2015 1 次提交
  23. 20 11月, 2015 1 次提交
    • N
      perf report: Add callchain value option · f2af0086
      Namhyung Kim 提交于
      Now -g/--call-graph option supports how to display callchain values.
      Possible values are 'percent', 'period' and 'count'.  The percent is
      same as before and it's the default behavior.  The period displays the
      raw period value rather than the percentage.  The count displays the
      number of occurrences.
      
        $ perf report --no-children --stdio -g percent
        ...
          39.93%  swapper  [kernel.vmlinux]  [k] intel_idel
                  |
                  ---intel_idle
                     cpuidle_enter_state
                     cpuidle_enter
                     call_cpuidle
                     cpu_startup_entry
                     |
                     |--28.63%-- start_secondary
                     |
                      --11.30%-- rest_init
      
        $ perf report --no-children --show-total-period --stdio -g period
        ...
          39.93%   13018705  swapper  [kernel.vmlinux]  [k] intel_idel
                  |
                  ---intel_idle
                     cpuidle_enter_state
                     cpuidle_enter
                     call_cpuidle
                     cpu_startup_entry
                     |
                     |--9334403-- start_secondary
                     |
                      --3684302-- rest_init
      
        $ perf report --no-children --show-nr-samples --stdio -g count
        ...
          39.93%     80  swapper  [kernel.vmlinux]  [k] intel_idel
                  |
                  ---intel_idle
                     cpuidle_enter_state
                     cpuidle_enter
                     call_cpuidle
                     cpu_startup_entry
                     |
                     |--57-- start_secondary
                     |
                      --23-- rest_init
      Signed-off-by: NNamhyung Kim <namhyung@kernel.org>
      Acked-by: NBrendan Gregg <brendan.d.gregg@gmail.com>
      Cc: Andi Kleen <andi@firstfloor.org>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Kan Liang <kan.liang@intel.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1447047946-1691-6-git-send-email-namhyung@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      f2af0086
  24. 07 11月, 2015 1 次提交
  25. 23 10月, 2015 1 次提交
  26. 06 10月, 2015 1 次提交
  27. 18 9月, 2015 1 次提交
  28. 04 9月, 2015 1 次提交
  29. 03 9月, 2015 2 次提交
  30. 29 8月, 2015 2 次提交
  31. 09 8月, 2015 1 次提交
  32. 10 6月, 2015 1 次提交
    • M
      perf tools: Avoid possible race condition in copyfile() · d7c72606
      Milos Vyletel 提交于
      Use unique temporary files when copying to buildid dir to prevent races
      in case multiple instances are trying to copy same file. This is done by
      
      - creating template in form <path>/.<filename>.XXXXXX where the suffix is
        used by mkstemp() to create unique file
      - change file mode
      - copy content
      - if successful link temp file to target file
      - unlink temp file
      
      At this point the only file left at target path should be the desired
      one either created by us or other instance if we raced. This should also
      prevent not yet fully copied files to be visible to to other perf
      instances that could try to parse them.
      
      On top of that slow_copyfile no longer needs to deal with file mode when
      creating file since temporary file is already created and mode is set.
      
      Succesfully tested by myself by running perf record, archive and reading
      the data on other system and by running perf buildid-cache on perf
      binary itself. I also did revert fix from 0635b0f7 that to exposes
      previously fixed race with EEXIST and recreator test passed sucessfully.
      Signed-off-by: NMilos Vyletel <milos@redhat.com>
      Acked-by: NIngo Molnar <mingo@kernel.org>
      Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
      Cc: Don Zickus <dzickus@redhat.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Link: http://lkml.kernel.org/r/1433775018-19868-1-git-send-email-milos@redhat.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      d7c72606
  33. 18 5月, 2015 2 次提交
  34. 25 2月, 2015 1 次提交
  35. 11 2月, 2015 1 次提交
  36. 12 12月, 2014 1 次提交