1. 05 7月, 2016 1 次提交
  2. 23 6月, 2016 1 次提交
  3. 12 5月, 2016 1 次提交
  4. 10 5月, 2016 1 次提交
  5. 12 3月, 2016 1 次提交
    • S
      perf test: Remove 'core_id' check in topo test · 4c9d6c18
      Sukadev Bhattiprolu 提交于
      The topology test case of 'perf test' seems to be broken on my x86
      system - due to the comparison of a "core-id" with # of CPUs online.
      
      There are 8 online CPUs:
      
      	$ cat /sys/devices/system/cpu/online
      	0-7
      
      but core-ids are not sequential and some core-ids exceed the number
      of online CPUs.
      
      	$ cat /sys/devices/system/cpu/cpu?/topology/core_id
      	0
      	1
      	9
      	10
      	0
      	1
      	9
      	10
      
      Looks like we can safely remove the check.  Output before:
      
      	$ perf --version
      	perf version 4.4.rc1.g34258a
      
      	$ perf test -v topo
      	36: Test topology in session                                 :
      	--- start ---
      	test child forked, pid 5906
      	templ file: /tmp/perf-test-vCwWG3
      	core_id number is too big.You may need to upgrade the perf tool.
      	test child interrupted
      	---- end ----
      	Test topology in session: FAILED!
      
      and after:
      
      	$ perf test -v topo
      	36: Test topology in session                                 :
      	--- start ---
      	test child forked, pid 6532
      	templ file: /tmp/perf-test-y10wFJ
      	CPU 0, core 0, socket 0
      	CPU 1, core 1, socket 0
      	CPU 2, core 9, socket 0
      	CPU 3, core 10, socket 0
      	CPU 4, core 0, socket 1
      	CPU 5, core 1, socket 1
      	CPU 6, core 9, socket 1
      	CPU 7, core 10, socket 1
      	test child finished with 0
      	---- end ----
      	Test topology in session: Ok
      Signed-off-by: NSukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
      Cc: Jan Stancek <jstancek@redhat.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Kan Liang <kan.liang@intel.com>
      Link: http://lkml.kernel.org/r/20151203233219.GA27696@us.ibm.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      4c9d6c18
  6. 17 2月, 2016 1 次提交
  7. 18 12月, 2015 7 次提交
  8. 10 12月, 2015 1 次提交
  9. 14 9月, 2015 4 次提交
  10. 13 9月, 2015 1 次提交
    • A
      perf header: Fixup reading of HEADER_NRCPUS feature · caa47047
      Arnaldo Carvalho de Melo 提交于
      The original patch introducing this header wrote the number of CPUs available
      and online in one order and then swapped those values when reading, fix it.
      
      Before:
      
        # perf record usleep 1
        # perf report --header-only | grep 'nrcpus \(online\|avail\)'
        # nrcpus online : 4
        # nrcpus avail : 4
        # echo 0 > /sys/devices/system/cpu/cpu2/online
        # perf record usleep 1
        # perf report --header-only | grep 'nrcpus \(online\|avail\)'
        # nrcpus online : 4
        # nrcpus avail : 3
        # echo 0 > /sys/devices/system/cpu/cpu1/online
        # perf record usleep 1
        # perf report --header-only | grep 'nrcpus \(online\|avail\)'
        # nrcpus online : 4
        # nrcpus avail : 2
      
      After the fix, bringing back the CPUs online:
      
        # perf report --header-only | grep 'nrcpus \(online\|avail\)'
        # nrcpus online : 2
        # nrcpus avail : 4
        # echo 1 > /sys/devices/system/cpu/cpu2/online
        # perf record usleep 1
        # perf report --header-only | grep 'nrcpus \(online\|avail\)'
        # nrcpus online : 3
        # nrcpus avail : 4
        # echo 1 > /sys/devices/system/cpu/cpu1/online
        # perf record usleep 1
        # perf report --header-only | grep 'nrcpus \(online\|avail\)'
        # nrcpus online : 4
        # nrcpus avail : 4
      Acked-by: NNamhyung Kim <namhyung@kernel.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kan Liang <kan.liang@intel.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Wang Nan <wangnan0@huawei.com>
      Fixes: fbe96f29 ("perf tools: Make perf.data more self-descriptive (v8)")
      Link: http://lkml.kernel.org/r/20150911153323.GP23511@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      caa47047
  11. 03 9月, 2015 1 次提交
    • K
      perf tools: Store the cpu socket and core ids in the perf.data header · 2bb00d2f
      Kan Liang 提交于
      This patch stores the cpu socket_id and core_id in a perf.data header,
      and reads them into the perf_env struct when processing perf.data files.
      
      The changes modifies the CPU_TOPOLOGY section, making sure it is
      backward/forward compatible.
      
      The patch checks the section size before reading the core and socket ids.
      
      It never reads data crossing the section boundary.  An old perf binary
      without this patch can also correctly read the perf.data from a new perf
      with this patch.
      
      Because the new info is added at the end of the cpu_topology section, an
      old perf tool ignores the extra data.
      
      Examples:
      
      1. New perf with this patch read perf.data from an old perf without the
         patch:
      
        $ perf_new report -i perf_old.data --header-only -I
        ......
        # sibling threads : 33
        # sibling threads : 34
        # sibling threads : 35
        # Core ID and Socket ID information is not available
        # node0 meminfo  : total = 32823872 kB, free = 29315548 kB
        # node0 cpu list : 0-17,36-53
        ......
      
      2. Old perf without the patch reads perf.data from a new perf with the
         patch:
      
        $ perf_old report -i perf_new.data --header-only -I
        ......
        # sibling threads : 33
        # sibling threads : 34
        # sibling threads : 35
        # node0 meminfo  : total = 32823872 kB, free = 29190932 kB
        # node0 cpu list : 0-17,36-53
        ......
      
      3. New perf read new perf.data:
      
        $ perf_new report -i perf_new.data --header-only -I
        ......
        # sibling threads : 33
        # sibling threads : 34
        # sibling threads : 35
        # CPU 0: Core ID 0, Socket ID 0
        # CPU 1: Core ID 1, Socket ID 0
        ......
        # CPU 61: Core ID 10, Socket ID 1
        # CPU 62: Core ID 11, Socket ID 1
        # CPU 63: Core ID 16, Socket ID 1
        # node0 meminfo  : total = 32823872 kB, free = 29190932 kB
        # node0 cpu list : 0-17,36-53
      Signed-off-by: NKan Liang <kan.liang@intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Link: http://lkml.kernel.org/r/1441115893-22006-2-git-send-email-kan.liang@intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      2bb00d2f
  12. 29 8月, 2015 1 次提交
  13. 22 7月, 2015 1 次提交
  14. 26 6月, 2015 1 次提交
  15. 08 6月, 2015 1 次提交
    • A
      perf tools: Reference count struct dso · d3a7c489
      Arnaldo Carvalho de Melo 提交于
      This has a different model than the 'thread' and 'map' struct lifetimes:
      there is not a definitive "don't use this DSO anymore" event, i.e. we may
      get many 'struct map' holding references to the '/usr/lib64/libc-2.20.so'
      DSO but then at some point some DSO may have no references but we still
      don't want to straight away release its resources, because "soon" we may
      get a new 'struct map' that needs it and we want to reuse its symtab or
      other resources.
      
      So we need some way to garbage collect it when crossing some memory
      usage threshold, which is left for anoter patch, for now it is
      sufficient to release it when calling dsos__exit(), i.e. when deleting
      the whole list as part of deleting the 'struct machine' containing it,
      which will leave only referenced objects being used.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: http://lkml.kernel.org/n/tip-majzgz07cm90t2tejrjy4clf@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      d3a7c489
  16. 03 6月, 2015 1 次提交
    • W
      perf tools: Deal with kernel module names in '[]' correctly · 1f121b03
      Wang Nan 提交于
      Before patch ba92732e ('perf kmaps: Check kmaps to make code more
      robust'), 'perf report' and 'perf annotate' will segfault if trace data
      contains kernel module information like this:
      
       # perf report -D -i ./perf.data
       ...
       0 0 0x188 [0x50]: PERF_RECORD_MMAP -1/0: [0xffffffbff1018000(0xf068000) @ 0]: x [test_module]
       ...
      
       # perf report -i ./perf.data --objdump=/path/to/objdump --kallsyms=/path/to/kallsyms
      
       perf: Segmentation fault
       -------- backtrace --------
       /path/to/perf[0x503478]
       /lib64/libc.so.6(+0x3545f)[0x7fb201f3745f]
       /path/to/perf[0x499b56]
       /path/to/perf(dso__load_kallsyms+0x13c)[0x49b56c]
       /path/to/perf(dso__load+0x72e)[0x49c21e]
       /path/to/perf(map__load+0x6e)[0x4ae9ee]
       /path/to/perf(thread__find_addr_map+0x24c)[0x47deec]
       /path/to/perf(perf_event__preprocess_sample+0x88)[0x47e238]
       /path/to/perf[0x43ad02]
       /path/to/perf[0x4b55bc]
       /path/to/perf(ordered_events__flush+0xca)[0x4b57ea]
       /path/to/perf[0x4b1a01]
       /path/to/perf(perf_session__process_events+0x3be)[0x4b428e]
       /path/to/perf(cmd_report+0xf11)[0x43bfc1]
       /path/to/perf[0x474702]
       /path/to/perf(main+0x5f5)[0x42de95]
       /lib64/libc.so.6(__libc_start_main+0xf4)[0x7fb201f23bd4]
       /path/to/perf[0x42dfc4]
      
      This is because __kmod_path__parse treats '[' leading names as kernel
      name instead of names of kernel module.
      
      If perf.data contains build information and the buildid of such modules
      can be found, the dso->kernel of it will be set to DSO_TYPE_KERNEL by
      __event_process_build_id(), not kernel module.
      
      It will then be passed to dso__load() -> dso__load_kernel_sym() ->
      dso__load_kcore() if --kallsyms is provided.
      
      The refered patch adds NULL pointer checker to avoid segfault. However,
      such kernel modules are still processed incorrectly.
      
      This patch fixes __kmod_path__parse, makes it treat names like
      '[test_module]' as kernel modules.
      
      kmod-path.c is also update to reflect the above changes.
      Signed-off-by: NWang Nan <wangnan0@huawei.com>
      Acked-by: NJiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Zefan Li <lizefan@huawei.com>
      Link: http://lkml.kernel.org/r/1433321541-170245-1-git-send-email-wangnan0@huawei.com
      [ Fixed the merged with 0443f36b ("perf machine: Fix the search
        for the kernel DSO on the unified list" ]
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      1f121b03
  17. 29 5月, 2015 2 次提交
  18. 05 5月, 2015 1 次提交
    • A
      perf tools: Add AUX area tracing index · 99fa2984
      Adrian Hunter 提交于
      Add an index of AUX area tracing events within a perf.data file.
      
      perf record uses a special user event PERF_RECORD_FINISHED_ROUND to
      enable sorting of events in chunks instead of having to sort all events
      altogether.
      
      AUX area tracing events contain data that can span back to the very
      beginning of the recording period. i.e. they do not obey the rules of
      PERF_RECORD_FINISHED_ROUND.
      
      By adding an index, AUX area tracing events can be found in advance and
      the PERF_RECORD_FINISHED_ROUND approach works as usual.
      
      The index is recorded with the auxtrace feature in the perf.data file.
      A session reads the index but does not process it.  An AUX area decoder
      can queue all the AUX area data in advance using
      auxtrace_queues__process_index() or otherwise process the index in some
      custom manner.
      Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com>
      Acked-by: NJiri Olsa <jolsa@kernel.org>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Namhyung Kim <namhyung@gmail.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/r/1430404667-10593-3-git-send-email-adrian.hunter@intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      99fa2984
  19. 29 4月, 2015 1 次提交
  20. 10 4月, 2015 1 次提交
  21. 08 4月, 2015 2 次提交
    • P
      perf tools: Merge all perf_event_attr print functions · 2c5e8c52
      Peter Zijlstra 提交于
      Currently there's 3 (that I found) different and incomplete
      implementations of printing perf_event_attr.
      
      This is quite silly. Merge the lot.
      
      While this patch does not retain the exact form all printing that I
      found is debug output and thus it should not be critical.
      
      Also, I cannot find a single print_event_desc() caller.
      
      Pre:
      
       $ perf record -vv -e cycles -- sleep 1
       ------------------------------------------------------------
       perf_event_attr:
        type                0
        size                104
        config              0
        sample_period       4000
        sample_freq         4000
        sample_type         0x107
        read_format         0
        disabled            1    inherit             1
        pinned              0    exclusive           0
        exclude_user        0    exclude_kernel      0
        exclude_hv          0    exclude_idle        0
        mmap                1    comm                1
        mmap2               1    comm_exec           1
        freq                1    inherit_stat        0
        enable_on_exec      1    task                1
        watermark           0    precise_ip          0
        mmap_data           0    sample_id_all       1
        exclude_host        0    exclude_guest       1
        excl.callchain_kern 0    excl.callchain_user 0
        wakeup_events       0
        wakeup_watermark    0
        bp_type             0
        bp_addr             0
        config1             0
        bp_len              0
        config2             0
        branch_sample_type  0
        sample_regs_user    0
        sample_stack_user   0
        sample_regs_intr    0
       ------------------------------------------------------------
      
       $ perf evlist  -vv
       cycles: sample_freq=4000, size: 104, sample_type: IP|TID|TIME|PERIOD,
       disabled: 1, inherit: 1, mmap: 1, mmap2: 1, comm: 1, comm_exec: 1,
       freq: 1, enable_on_exec: 1, task: 1, sample_id_all: 1, exclude_guest: 1
      
       Post:
      
       $ ./perf record -vv -e cycles -- sleep 1
       ------------------------------------------------------------
       perf_event_attr:
        size                             112
        { sample_period, sample_freq }   4000
        sample_type                      IP|TID|TIME|PERIOD
        disabled                         1
        inherit                          1
        mmap                             1
        comm                             1
        freq                             1
        enable_on_exec                   1
        task                             1
        sample_id_all                    1
        exclude_guest                    1
        mmap2                            1
        comm_exec                        1
      ------------------------------------------------------------
      
       $ ./perf evlist  -vv
       cycles: size: 112, { sample_period, sample_freq }: 4000, sample_type:
       IP|TID|TIME|PERIOD, disabled: 1, inherit: 1, mmap: 1, comm: 1, freq:
       1, enable_on_exec: 1, task: 1, sample_id_all: 1, exclude_guest: 1,
       mmap2: 1, comm_exec: 1
      Signed-off-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
      Acked-by: NAdrian Hunter <adrian.hunter@intel.com>
      Acked-by: NIngo Molnar <mingo@kernel.org>
      Acked-by: NJiri Olsa <jolsa@kernel.org>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: John Stultz <john.stultz@linaro.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Link: http://lkml.kernel.org/r/20150407091150.644238729@infradead.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      2c5e8c52
    • P
      perf record: Add clockid parameter · 814c8c38
      Peter Zijlstra 提交于
      Teach perf-record about the new perf_event_attr::{use_clockid, clockid}
      fields. Add a simple parameter to set the clock (if any) to be used for
      the events to be recorded into the data file.
      
      Since we store the entire perf_event_attr in the EVENT_DESC section we
      also already store the used clockid in the data file.
      Signed-off-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
      Acked-by: NDavid Ahern <dsahern@gmail.com>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: John Stultz <john.stultz@linaro.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Yunlong Song <yunlong.song@huawei.com>
      Link: http://lkml.kernel.org/r/20150407154851.GR23123@twins.programming.kicks-ass.net
      [ Conditionally define CLOCK_BOOTTIME, at least rhel6 doesn't have it - dsahern
        Ditto for CLOCK_MONOTONIC_RAW, sles11sp2 doesn't have it - yunlong.song ]
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      814c8c38
  22. 23 3月, 2015 1 次提交
  23. 30 1月, 2015 1 次提交
  24. 19 11月, 2014 1 次提交
  25. 16 11月, 2014 1 次提交
  26. 05 11月, 2014 3 次提交
    • N
      perf tools: Fix build-id matching on vmlinux · b837a8bd
      Namhyung Kim 提交于
      There's a problem on finding correct kernel symbols when perf report
      runs on a different kernel.  Although a part of the problem was solved
      by the prior commit 0a7e6d1b ("perf tools: Check recorded kernel
      version when finding vmlinux"), there's a remaining problem still.
      
      When perf records samples, it synthesizes the kernel map using
      machine__mmap_name() and ref_reloc_sym like "[kernel.kallsyms]_text".
      You can easily see it using 'perf report -D' command.
      
      After finishing record, it goes through the recorded events to find
      maps/dsos actually used.  And then record build-id info of them.
      
      During this process, it needs to load symbols in a dso and it'd call
      dso__load_vmlinux_path() since the default value of the symbol_conf.
      try_vmlinux_path is true.  However it changes dso->long_name to a real
      path of the vmlinux file (e.g. /lib/modules/3.16.4/build/vmlinux) if one
      is running on a custom kernel.
      
      It resulted in that perf report reads the build-id of the vmlinux, but
      cannot use it since it only knows about the [kernel.kallsyms] map.  It
      then falls back to possible vmlinux paths by using the recorded kernel
      version (in case of a recent version) or a running kernel silently.
      
      Even with the recent tools, this still has a possibility of breaking
      the result.  As the build directory is a symbolic link, if one built a
      new kernel in the same directory with different source/config, the old
      link to vmlinux will point the new file.  So it's absolutely needed to
      use build-id when finding a kernel image.
      
      In this patch, it's now changed to try to search a kernel dso in the
      existing dso list which was constructed during build-id table parsing
      so it'll always have a build-id.  If not found, search "[kernel.kallsyms]".
      
      Before:
      
        $ perf report
        # Children      Self  Command  Shared Object      Symbol
        # ........  ........  .......  .................  ...............................
        #
            72.15%     0.00%  swapper  [kernel.kallsyms]  [k] set_curr_task_rt
            72.15%     0.00%  swapper  [kernel.kallsyms]  [k] native_calibrate_tsc
            72.15%     0.00%  swapper  [kernel.kallsyms]  [k] tsc_refine_calibration_work
            71.87%    71.87%  swapper  [kernel.kallsyms]  [k] module_finalize
         ...
      
      After (for the same perf.data):
      
            72.15%     0.00%  swapper  vmlinux  [k] cpu_startup_entry
            72.15%     0.00%  swapper  vmlinux  [k] arch_cpu_idle
            72.15%     0.00%  swapper  vmlinux  [k] default_idle
            71.87%    71.87%  swapper  vmlinux  [k] native_safe_halt
         ...
      Signed-off-by: NNamhyung Kim <namhyung@kernel.org>
      Acked-by: NIngo Molnar <mingo@kernel.org>
      Link: http://lkml.kernel.org/r/20140924073356.GB1962@gmail.com
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung.kim@lge.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/r/1415063674-17206-8-git-send-email-namhyung@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      b837a8bd
    • N
      perf build-id: Move build-id related functions to util/build-id.c · e195fac8
      Namhyung Kim 提交于
      It'd be better managing those functions in a separate place as
      util/header.c file is already big.
      
      It now exports following 3 functions to others:
      
        bool perf_session__read_build_ids(struct perf_session *session, bool with_hits);
        int perf_session__write_buildid_table(struct perf_session *session, int fd);
        int perf_session__cache_build_ids(struct perf_session *session);
      Signed-off-by: NNamhyung Kim <namhyung@kernel.org>
      Acked-by: NAdrian Hunter <adrian.hunter@intel.com>
      Link: http://lkml.kernel.org/r/545733E7.6010105@intel.com
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung.kim@lge.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/r/1415063674-17206-5-git-send-email-namhyung@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      e195fac8
    • N
      perf build-id: Rename dsos__write_buildid_table() · 714c9c4a
      Namhyung Kim 提交于
      The dsos__write_buildid_table() is not use struct dso and it mostly
      uses perf_session struct.
      
      So rename it to perf_session__write_buildid_ table() so that it
      corresponds to other related functions such as
      perf_session__read_build_ids() and perf_session__cache_build_ids().
      Signed-off-by: NNamhyung Kim <namhyung@kernel.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung.kim@lge.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/r/1415063674-17206-4-git-send-email-namhyung@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      714c9c4a
  27. 29 10月, 2014 1 次提交
    • W
      perf tools: Ensure return negative value when write header error · ed307758
      Wang Nan 提交于
      When 'perf record' write headers, it calls write_xxx in
      tools/perf/util/header.c, and check return value. It rolls back all
      working only when return value is negative.
      
      This patch ensures write_cpudesc() and write_total_mem() return negative number
      when error. Without this patch, headers reported by 'perf report' header is
      error in some platform. Following output is caputured on ARM, which doesn't
      contain "Processor" field in /proc/cpuinfo. See "cpudesc", "total memory" and
      "cmdline" field.
      
         bash-4.2# perf record ls
         ...
         [ perf record: Woken up 1 times to write data ]
         [ perf record: Captured and wrote 0.001 MB perf.data (~36 samples) ]
         bash-4.2# perf report --stdio --header
         Error:
         The perf.data file has no samples!
         # ========
         # captured on: Fri Sep 12 10:09:10 2014
         # hostname : arma15el
         # os release : 3.17.0+
         # perf version : 3.10.53
         # arch : armv7l
         # nrcpus online : 4
         # nrcpus avail : 1
         # cpudesc : (null)
         # total memory : 0 kB
         # cmdline :
         # event : name = cycles, type = 0, config = 0x0, config1 = 0x0, config2 = 0x0, excl_usr = 0, excl_kern = 0, excl_host = 0, excl_guest = 1, precise_ip = 0
         # pmu mappings: not available
         # ========
         #
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Li Zefan <lizefan@huawei.com>
      Cc: Namhyung Kim <namhyung.kim@lge.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Waiman Long <Waiman.Long@hp.com>
      Link: http://lkml.kernel.org/r/1413428909-80017-1-git-send-email-wangnan0@huawei.comSigned-off-by: NWang Nan <wangnan0@huawei.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      ed307758