1. 27 4月, 2016 1 次提交
  2. 18 4月, 2016 2 次提交
  3. 12 4月, 2016 1 次提交
  4. 24 3月, 2016 1 次提交
  5. 23 3月, 2016 2 次提交
  6. 27 2月, 2016 1 次提交
  7. 25 2月, 2016 1 次提交
  8. 03 2月, 2016 2 次提交
  9. 07 1月, 2016 3 次提交
  10. 18 12月, 2015 1 次提交
  11. 11 12月, 2015 6 次提交
  12. 23 10月, 2015 3 次提交
  13. 01 10月, 2015 2 次提交
  14. 29 9月, 2015 1 次提交
  15. 14 9月, 2015 2 次提交
  16. 20 8月, 2015 1 次提交
    • A
      perf top: Show backtrace when handling a SIGSEGV on --stdio mode · 09f4d78a
      Arnaldo Carvalho de Melo 提交于
      It was just freezing instead of informing about the SEGV, fix it and
      also print a backtrace, just like in the TUI mode and in 'perf trace'.
      
      Tested by provoking a NULL deref when pressing 'z':
      
           0.31%  libc-2.20.so     [.] malloc_consolidate
           0.31%  ld-2.20.so       [.] _dl_relocate_object
           0.28%  cc1              [.] ht_lookup
           0.28%  cc1              [.] ira_init_register_move_cost
        perf: Segmentation fault
        Obtained 7 stack frames.
        perf(dump_stack+0x32) [0x4d69f2]
        perf(sighandler_dump_stack+0x29) [0x4d6a89]
        /lib64/libc.so.6(+0x34960) [0x7f5064333960]
        perf() [0x438790]
        /lib64/libpthread.so.0(+0x752a) [0x7f50663dd52a]
        /lib64/libc.so.6(clone+0x6d) [0x7f50643ff22d]
        #
      Reported-by: NLinus Torvalds <torvalds@linux-foundation.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@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/n/tip-pewrpzqd29rgmhu2wkk7fhww@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      09f4d78a
  17. 07 8月, 2015 1 次提交
  18. 22 6月, 2015 1 次提交
  19. 20 6月, 2015 3 次提交
  20. 18 6月, 2015 1 次提交
    • A
      perf top: Allow disabling/enabling events dynamicly · 5d484f99
      Arnaldo Carvalho de Melo 提交于
      Now it is possible to press CTRL+z at anytime and that will disable the
      events being monitored, essentially turning 'top' into 'report', with
      pressing CTRL+z again making it enable the events again, returning to
      the 'top' behaviour, i.e. dynamic + decaying of older samples.
      
      One may want, for instance, play with:
      
          -d, --delay <n>       number of seconds to delay between refreshes
      
      and:
      
          -z, --zero            zero history across updates
      
      Plus CTRL+z to see only the events since last zeroing, etc.
      Suggested-by: NIngo Molnar <mingo@kernel.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Don Zickus <dzickus@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/n/tip-zq7tnh5462blt2yda0bcxh5b@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      5d484f99
  21. 27 5月, 2015 1 次提交
  22. 09 5月, 2015 1 次提交
    • A
      perf machine: Protect the machine->threads with a rwlock · b91fc39f
      Arnaldo Carvalho de Melo 提交于
      In addition to using refcounts for the struct thread lifetime
      management, we need to protect access to machine->threads from
      concurrent access.
      
      That happens in 'perf top', where a thread processes events, inserting
      and deleting entries from that rb_tree while another thread decays
      hist_entries, that end up dropping references and ultimately deleting
      threads from the rb_tree and releasing its resources when no further
      hist_entry (or other data structures, like in 'perf sched') references
      it.
      
      So the rule is the same for refcounts + protected trees in the kernel,
      get the tree lock, find object, bump the refcount, drop the tree lock,
      return, use object, drop the refcount if no more use of it is needed,
      keep it if storing it in some other data structure, drop when releasing
      that data structure.
      
      I.e. pair "t = machine__find(new)_thread()" with a "thread__put(t)", and
      "perf_event__preprocess_sample(&al)" with "addr_location__put(&al)".
      
      The addr_location__put() one is because as we return references to
      several data structures, we may end up adding more reference counting
      for the other data structures and then we'll drop it at
      addr_location__put() time.
      Acked-by: NDavid Ahern <dsahern@gmail.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: Don Zickus <dzickus@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/n/tip-bs9rt4n0jw3hi9f3zxyy3xln@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      b91fc39f
  23. 28 4月, 2015 1 次提交
    • W
      perf top: Fix a segfault when kernel map is restricted. · c6718350
      Wang Nan 提交于
      Perf top raise a warning if a kernel sample is collected but kernel map
      is restricted. The warning message needs to dereference al.map->dso...
      
      However, previous perf_event__preprocess_sample() doesn't always
      guarantee al.map != NULL, for example, when kernel map is restricted.
      
      This patch validates al.map before dereferencing, avoid the segfault.
      
      Before this patch:
      
       $ cat /proc/sys/kernel/kptr_restrict
       1
       $ perf top -p  120183
       perf: Segmentation fault
       -------- backtrace --------
       /path/to/perf[0x509868]
       /lib64/libc.so.6(+0x3545f)[0x7f9a1540045f]
       /path/to/perf[0x448820]
       /path/to/perf(cmd_top+0xe3c)[0x44a5dc]
       /path/to/perf[0x4766a2]
       /path/to/perf(main+0x5f5)[0x42e545]
       /lib64/libc.so.6(__libc_start_main+0xf4)[0x7f9a153ecbd4]
       /path/to/perf[0x42e674]
      
      And gdb call trace:
      
       Program received signal SIGSEGV, Segmentation fault.
       perf_event__process_sample (machine=0xa44030, sample=0x7fffffffa4c0, evsel=0xa43b00, event=0x7ffff41c3000, tool=0x7fffffffa8a0)
          at builtin-top.c:736
       736				  !RB_EMPTY_ROOT(&al.map->dso->symbols[MAP__FUNCTION]) ?
       (gdb) bt
       #0  perf_event__process_sample (machine=0xa44030, sample=0x7fffffffa4c0, evsel=0xa43b00, event=0x7ffff41c3000, tool=0x7fffffffa8a0)
           at builtin-top.c:736
       #1  perf_top__mmap_read_idx (top=top@entry=0x7fffffffa8a0, idx=idx@entry=0) at builtin-top.c:855
       #2  0x000000000044a5dd in perf_top__mmap_read (top=0x7fffffffa8a0) at builtin-top.c:872
       #3  __cmd_top (top=0x7fffffffa8a0) at builtin-top.c:997
       #4  cmd_top (argc=<optimized out>, argv=<optimized out>, prefix=<optimized out>) at builtin-top.c:1267
       #5  0x00000000004766a3 in run_builtin (p=p@entry=0x8a6ce8 <commands+264>, argc=argc@entry=3, argv=argv@entry=0x7fffffffdf70)
            at perf.c:371
       #6  0x000000000042e546 in handle_internal_command (argv=0x7fffffffdf70, argc=3) at perf.c:430
       #7  run_argv (argv=0x7fffffffdcf0, argcp=0x7fffffffdcfc) at perf.c:474
       #8  main (argc=3, argv=0x7fffffffdf70) at perf.c:589
       (gdb)
      Signed-off-by: NWang Nan <wangnan0@huawei.com>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Zefan Li <lizefan@huawei.com>
      Link: http://lkml.kernel.org/r/1429946703-80807-1-git-send-email-wangnan0@huawei.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      c6718350
  24. 24 3月, 2015 1 次提交
    • A
      perf symbols: Save DSO loading errno to better report errors · 18425f13
      Arnaldo Carvalho de Melo 提交于
      Before, when some problem happened while trying to load the kernel
      symtab, 'perf top' would show:
      
            ┌─Warning:───────────────────────────┐
            │The vmlinux file can't be used.     │
            │Kernel samples will not be resolved.│
            │                                    │
            │                                    │
            │Press any key...                    │
            └────────────────────────────────────┘
      
      Now, it reports:
      
        # perf top --vmlinux /dev/null
      
            ┌─Warning:───────────────────────────────────────────┐
            │The /tmp/passwd file can't be used: Invalid ELF file│
            │Kernel samples will not be resolved.                │
            │                                                    │
            │                                                    │
            │Press any key...                                    │
            └────────────────────────────────────────────────────┘
      
      This is possible because we now register the reason for not being able
      to load the symtab in the dso->load_errno member, and provide a
      dso__strerror_load() routine to format this error into a strerror like
      string with a short reason for the error while loading.
      
      That can be just forwarding the dso__strerror_load() call to
      strerror_r(), or, for a separate errno range providing a custom message.
      Reported-by: NIngo Molnar <mingo@kernel.org>
      Acked-by: NJiri Olsa <jolsa@kernel.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Don Zickus <dzickus@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/n/tip-u5rb5uq63xqhkfb8uv2lxd5u@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      18425f13