1. 14 12月, 2009 7 次提交
    • A
      perf session: Move the global threads list to perf_session · b3165f41
      Arnaldo Carvalho de Melo 提交于
      So that we can process two perf.data files.
      
      We still need to add a O_MMAP mode for perf_session so that we
      can do all the mmap stuff in it.
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      LKML-Reference: <1260741029-4430-5-git-send-email-acme@infradead.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      b3165f41
    • A
      perf session: Reduce the number of parms to perf_session__process_events · ec913369
      Arnaldo Carvalho de Melo 提交于
      By having the cwd/cwdlen in the perf_session struct and
      full_paths in perf_event_ops.
      
      Now its just a matter of passing the ops.
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      LKML-Reference: <1260741029-4430-4-git-send-email-acme@infradead.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      ec913369
    • A
      perf session: Register the idle thread in perf_session__process_events · 13df45ca
      Arnaldo Carvalho de Melo 提交于
      No need for all tools to register it and then immediately call
      perf_session__process_events.
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      LKML-Reference: <1260741029-4430-3-git-send-email-acme@infradead.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      13df45ca
    • A
      perf session: Ditch register_perf_file_handler · 301a0b02
      Arnaldo Carvalho de Melo 提交于
      Pass the event_ops to perf_session__process_events instead.
      
      Also move the event_ops definition to session.h, starting to
      move things around to their right place, trimming the many
      unneeded headers we have.
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      LKML-Reference: <1260741029-4430-2-git-send-email-acme@infradead.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      301a0b02
    • A
      perf session: Pass the perf_session to the event handling operations · d8f66248
      Arnaldo Carvalho de Melo 提交于
      They will need it to get the right threads list, etc.
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      LKML-Reference: <1260741029-4430-1-git-send-email-acme@infradead.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      d8f66248
    • D
      perf sched: Fix build failure on sparc · 2cd9046c
      David Miller 提交于
      Here, tvec->tv_usec is "unsigned int" not "unsigned long".
      
      Since the type is different on every platform, it's probably
      best to just use long printf formats and cast.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <20091213.235622.53363059.davem@davemloft.net>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      2cd9046c
    • H
      perf bench: Add "all" pseudo subsystem and "all" pseudo suite · 2044279d
      Hitoshi Mitake 提交于
      This patch adds a new "all" pseudo subsystem and an "all" pseudo
      suite. These are for testing all subsystem and its all suite, or
      all suite of one subsystem.
      
      (This patch also contains a few trivial comment fixes for
      bench/* and output style fixes. I judged that there are no
      necessity to make them into individual patch.)
      
      Example of use:
      
      | % ./perf bench sched all                      # Test all suites of sched subsystem
      | # Running sched/messaging benchmark...
      | # 20 sender and receiver processes per group
      | # 10 groups == 400 processes run
      |
      |      Total time: 0.414 [sec]
      |
      | # Running sched/pipe benchmark...
      | # Extecuted 1000000 pipe operations between two tasks
      |
      |      Total time: 10.999 [sec]
      |
      |       10.999317 usecs/op
      |           90914 ops/sec
      |
      | % ./perf bench all                            # Test all suites of all subsystems
      | # Running sched/messaging benchmark...
      | # 20 sender and receiver processes per group
      | # 10 groups == 400 processes run
      |
      |      Total time: 0.420 [sec]
      |
      | # Running sched/pipe benchmark...
      | # Extecuted 1000000 pipe operations between two tasks
      |
      |      Total time: 11.741 [sec]
      |
      |       11.741346 usecs/op
      |           85169 ops/sec
      |
      | # Running mem/memcpy benchmark...
      | # Copying 1MB Bytes from 0x7ff33e920010 to 0x7ff3401ae010 ...
      |
      |      808.407437 MB/Sec
      Signed-off-by: NHitoshi Mitake <mitake@dcl.info.waseda.ac.jp>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <1260691319-4683-1-git-send-email-mitake@dcl.info.waseda.ac.jp>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      2044279d
  2. 12 12月, 2009 8 次提交
    • A
      perf tools: Introduce perf_session class · 94c744b6
      Arnaldo Carvalho de Melo 提交于
      That does all the initialization boilerplate, opening the file,
      reading the header, checking if it is valid, etc.
      
      And that will as well have the threads list, kmap (now) global
      variable, etc, so that we can handle two (or more) perf.data files
      describing sessions to compare.
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      LKML-Reference: <1260573842-19720-1-git-send-email-acme@infradead.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      94c744b6
    • A
      perf symbols: Ditch dso->find_symbol · ea08d8cb
      Arnaldo Carvalho de Melo 提交于
      It is always wired to dso__find_symbol.
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      LKML-Reference: <1260564999-13371-1-git-send-email-acme@infradead.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      ea08d8cb
    • A
      perf symbols: Allow lookups by symbol name too · 79406cd7
      Arnaldo Carvalho de Melo 提交于
      Configurable via symbol_conf.sort_by_name, so that the cost of an
      extra rb_node on all 'struct symbol' instances is not paid by tools
      that only want to decode addresses.
      
      How to use it:
      
      	symbol_conf.sort_by_name = true;
      	symbol_init(&symbol_conf);
      
      	struct map *map = map_groups__find_by_name(kmaps, MAP__VARIABLE, "[kernel.kallsyms]");
      
      	if (map == NULL) {
      		pr_err("couldn't find map!\n");
      		kernel_maps__fprintf(stdout);
      	} else {
      		struct symbol *sym = map__find_symbol_by_name(map, sym_filter, NULL);
      		if (sym == NULL)
      			pr_err("couldn't find symbol %s!\n", sym_filter);
      		else
      			pr_info("symbol %s: %#Lx-%#Lx \n", sym_filter, sym->start, sym->end);
      	}
      
      Looking over the vmlinux/kallsyms is common enough that I'll add a
      variable to the upcoming struct perf_session to avoid the need to
      use map_groups__find_by_name to get the main vmlinux/kallsyms map.
      
      The above example looks on the 'variable' symtab, but it is just
      like that for the functions one.
      
      Also the sort operation is done when we first use
      map__find_symbol_by_name, in a lazy way.
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      Cc: Masami Hiramatsu <mhiramat@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      LKML-Reference: <1260564622-12392-1-git-send-email-acme@infradead.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      79406cd7
    • A
      perf symbols: Add missing "Variables" entry to map_type__name · 22ccec57
      Arnaldo Carvalho de Melo 提交于
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      LKML-Reference: <1260552208-6824-1-git-send-email-acme@infradead.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      22ccec57
    • A
      perf symbols: Add support for 'variable' symtabs · f1dfa0b1
      Arnaldo Carvalho de Melo 提交于
      Example:
      
      {
      	u64 addr = strtoull(sym_filter, NULL, 16);
      	struct map *map = map_groups__find(kmaps, MAP__VARIABLE, addr);
      
      	if (map == NULL)
      		pr_err("couldn't find map!\n");
      	else {
      		struct symbol *sym = map__find_symbol(map, addr, NULL);
      		if (sym == NULL)
      			pr_err("couldn't find addr!\n");
      		else
      			pr_info("addr %#Lx is in %s global var\n", addr, sym->name);
      	}
      	exit(0);
      }
      
      Added just after symbol__init() call in 'perf top', then:
      
      {
              u64 addr = strtoull(sym_filter, NULL, 16);
              struct map *map = map_groups__find(kmaps, MAP__VARIABLE, addr);
      
              if (map == NULL)
                      pr_err("couldn't find map!\n");
              else {
                      struct symbol *sym = map__find_symbol(map, addr, NULL);
                      if (sym == NULL)
                              pr_err("couldn't find addr!\n");
                      else
                              pr_info("addr %#Lx is in %s global var\n", addr, sym->name);
              }
              exit(0);
      }
      
      [root@doppio linux-2.6-tip]# grep ' [dD] ' /proc/kallsyms | grep ' sched'
      ffffffff817827d8 d sched_nr_latency
      ffffffff81782ce0 d sched_domains_mutex
      ffffffff8178c070 d schedstr.22423
      ffffffff817909a0 d sched_register_mutex
      ffffffff81823490 d sched_feat_names
      ffffffff81823558 d scheduler_running
      ffffffff818235b8 d sched_clock_running
      ffffffff818235bc D sched_clock_stable
      ffffffff81824f00 d sched_switch_trace
      [root@doppio linux-2.6-tip]# perf top -s 0xffffffff817827d9
      addr 0xffffffff817827d9 is in sched_nr_latency global var
      [root@doppio linux-2.6-tip]# perf top -s ffffffff81782ce0
      addr 0xffffffff81782ce0 is in sched_domains_mutex global var
      [root@doppio linux-2.6-tip]#
      [root@doppio linux-2.6-tip]# perf top -s ffffffff81782ce0 --vmlinux OFF
      The file OFF cannot be used, trying to use /proc/kallsyms...addr 0xffffffff81782ce0 is in sched_domains_mutex global var
      [root@doppio linux-2.6-tip]# perf top -s ffffffff818235bc --vmlinux OFF
      The file OFF cannot be used, trying to use /proc/kallsyms...addr 0xffffffff818235bc is in sched_clock_stable global var
      [root@doppio linux-2.6-tip]#
      
      So it works with both /proc/kallsyms and with ELF symtabs, either
      the one on the vmlinux explicitely passed via --vmlinux or in one
      in the vmlinux_path that matches the buildid for the running kernel
      or the one found in the buildid header section in a perf.data file.
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      LKML-Reference: <1260550239-5372-4-git-send-email-acme@infradead.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      f1dfa0b1
    • A
      perf symbols: Introduce ELF counterparts to symbol_type__is_a · d45868d3
      Arnaldo Carvalho de Melo 提交于
      For selecting the right types of symbols in ELF symtabs.
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      LKML-Reference: <1260550239-5372-3-git-send-email-acme@infradead.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      d45868d3
    • A
      perf symbols: Introduce symbol_type__is_a · 6893d4ee
      Arnaldo Carvalho de Melo 提交于
      For selecting the right types of symbols in /proc/kallsyms, will be
      followed by elf_symbol_type__is_a, for the same purpose on ELF
      symtabs.
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      LKML-Reference: <1260550239-5372-2-git-send-email-acme@infradead.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      6893d4ee
    • A
      perf symbols: Rename kthreads to kmaps, using another abstraction for it · 9958e1f0
      Arnaldo Carvalho de Melo 提交于
      Using a struct thread instance just to hold the kernel space maps
      (vmlinux + modules) is overkill and confuses people trying to
      understand the perf symbols abstractions.
      
      The kernel maps are really present in all threads, i.e. the kernel
      is a library, not a separate thread.
      
      So introduce the 'map_groups' abstraction and use it for the kernel
      maps, now in the kmaps global variable.
      
      It, in turn, will move, together with the threads list to the
      perf_file abstraction, so that we can support multiple perf_file
      instances, needed by perf diff.
      
      Brainstormed-with: Eduardo Habkost <ehabkost@redhat.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Eduardo Habkost <ehabkost@redhat.com>
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      LKML-Reference: <1260550239-5372-1-git-send-email-acme@infradead.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      9958e1f0
  3. 11 12月, 2009 7 次提交
    • J
      perf tools: Allow building for ARM · 58e9f941
      Jamie Iles 提交于
      Add definitions of rmb() and cpu_relax() and include the ARM
      unistd.h header. The __kuser_memory_barrier helper in the helper
      page is used to provide the correct memory barrier depending on
      the CPU type.
      
      [ The rmb() will work on v6 and v7, segfault on v5. Dynamic
        detection to add v5 support will be added later. ]
      Signed-off-by: NJamie Iles <jamie.iles@picochip.com>
      Cc: Russell King <linux@arm.linux.org.uk>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Mikael Pettersson <mikpe@it.uu.se>
      LKML-Reference: <1260534009-5394-1-git-send-email-jamie.iles@picochip.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      58e9f941
    • F
      hw-breakpoints: Handle bad modify_user_hw_breakpoint off-case return value · 99ac64c8
      Frederic Weisbecker 提交于
      While converting modify_user_hw_breakpoint() return value, we
      forgot to handle the off-case. It's not returning a pointer
      anymore.
      
      This solves the build warning reported by Stephen Rothwell against
      linux-next.
      Reported-by: NStephen Rothwell <sfr@canb.auug.org.au>
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Prasad <prasad@linux.vnet.ibm.com>
      LKML-Reference: <1260529122-6260-1-git-send-regression-fweisbec@gmail.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      Cc: Prasad <prasad@linux.vnet.ibm.com>
      99ac64c8
    • J
      perf tools: Allow cross compiling · cc835752
      Jamie Iles 提交于
      For embedded platforms, we want to be able to build the perf
      tools on a build machine to run on a different arch. This patch
      allows $CROSS_COMPILE to set the cross compiler.
      
      Additionally, if NO_LIBPERL is set, then don't use perl include
      paths as they will be for the host arch.
      Signed-off-by: NJamie Iles <jamie.iles@picochip.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      LKML-Reference: <1260523260-15694-2-git-send-email-jamie.iles@picochip.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      cc835752
    • L
      tracing, slab: Fix no callsite ifndef CONFIG_KMEMTRACE · 0bb38a5c
      Li Zefan 提交于
      For slab, if CONFIG_KMEMTRACE and CONFIG_DEBUG_SLAB are not set,
      __do_kmalloc() will not track callers:
      
       # ./perf record -f -a -R -e kmem:kmalloc
       ^C
       # ./perf trace
       ...
                perf-2204  [000]   147.376774: kmalloc: call_site=c0529d2d ...
                perf-2204  [000]   147.400997: kmalloc: call_site=c0529d2d ...
                Xorg-1461  [001]   147.405413: kmalloc: call_site=0 ...
                Xorg-1461  [001]   147.405609: kmalloc: call_site=0 ...
             konsole-1776  [001]   147.405786: kmalloc: call_site=0 ...
      Signed-off-by: NLi Zefan <lizf@cn.fujitsu.com>
      Reviewed-by: NPekka Enberg <penberg@cs.helsinki.fi>
      Cc: Christoph Lameter <cl@linux-foundation.org>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: linux-mm@kvack.org <linux-mm@kvack.org>
      Cc: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro>
      LKML-Reference: <4B21F8AE.6020804@cn.fujitsu.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      0bb38a5c
    • L
      tracing, slab: Define kmem_cache_alloc_notrace ifdef CONFIG_TRACING · 0f24f128
      Li Zefan 提交于
      Define kmem_trace_alloc_{,node}_notrace() if CONFIG_TRACING is
      enabled, otherwise perf-kmem will show wrong stats ifndef
      CONFIG_KMEM_TRACE, because a kmalloc() memory allocation may
      be traced by both trace_kmalloc() and trace_kmem_cache_alloc().
      Signed-off-by: NLi Zefan <lizf@cn.fujitsu.com>
      Reviewed-by: NPekka Enberg <penberg@cs.helsinki.fi>
      Cc: Christoph Lameter <cl@linux-foundation.org>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: linux-mm@kvack.org <linux-mm@kvack.org>
      Cc: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro>
      LKML-Reference: <4B21F89A.7000801@cn.fujitsu.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      0f24f128
    • C
      x86, perf events: Check if we have APIC enabled · 12558038
      Cyrill Gorcunov 提交于
      Ralf Hildebrandt reported this boot warning:
      
      | Running a vanilla 2.6.32 as Xen DomU, I'm getting:
      |
      | [    0.000999] CPU: Physical Processor ID: 0
      | [    0.000999] CPU: Processor Core ID: 1
      | [    0.000999] Performance Events: AMD PMU driver.
      | [    0.000999] ------------[ cut here ]------------
      | [    0.000999] WARNING: at arch/x86/kernel/apic/apic.c:249 native_apic_write_dummy
      
      So we need to check if APIC functionality is available, and
      not just in the P6 driver but elsewhere as well.
      Reported-by: NRalf Hildebrandt <Ralf.Hildebrandt@charite.de>
      Signed-off-by: NCyrill Gorcunov <gorcunov@openvz.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <20091210165634.GF5086@lenovo>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      12558038
    • X
      perf_event: Fix variable initialization in other codepaths · 5e855db5
      Xiao Guangrong 提交于
      Signed-off-by: NXiao Guangrong <xiaoguangrong@cn.fujitsu.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Paul Mackerras <paulus@samba.org>
      LKML-Reference: <4B20BAA6.7010609@cn.fujitsu.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      5e855db5
  4. 10 12月, 2009 9 次提交
  5. 09 12月, 2009 9 次提交
    • X
      perf sched: Fix for getting task's execution time · c0c9e721
      Xiao Guangrong 提交于
      In current code, task's execute time is got by reading
      '/proc/<pid>/sched' file, it's wrong if the task is created
      by pthread_create(), because every thread task has same pid.
      
      This way also has two demerits:
      
       1: 'perf sched replay' can't work if the kernel is not
          compiled with the 'CONFIG_SCHED_DEBUG' option
      
       2: perf tool should depend on proc file system
      
      So, this patch uses PERF_COUNT_SW_TASK_CLOCK to get task's
      execution time instead of reading /proc file.
      
      Changelog v2 -> v3:
      use PERF_COUNT_SW_TASK_CLOCK instead of rusage() as Ingo's
      suggestion
      Reported-by: NTorok Edwin <edwintorok@gmail.com>
      Signed-off-by: NXiao Guangrong <xiaoguangrong@cn.fujitsu.com>
      Cc: Xiao Guangrong <ericxiao.gr@gmail.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Paul Mackerras <paulus@samba.org>
      LKML-Reference: <4B1F7322.80103@cn.fujitsu.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      c0c9e721
    • F
      tracing/kprobes: Fix field creation's bad error handling · 822a6961
      Frederic Weisbecker 提交于
      When we define the common event fields in kprobe, we invert the error
      handling and return immediately in case of success. Then we omit
      to define specific kprobes fields (ip and nargs), and specific
      kretprobes fields (func, ret_ip, nargs). And we only define them
      when we fail to create common fields.
      
      The most visible consequence is that we can't create filter for
      k(ret)probes specific fields.
      
      This patch re-invert the success/error handling to fix it.
      Reported-by: NLai Jiangshan <laijs@cn.fujitsu.com>
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Acked-by: NMasami Hiramatsu <mhiramat@redhat.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Li Zefan <lizf@cn.fujitsu.com>
      LKML-Reference: <1260263815-5167-1-git-send-regression-fweisbec@gmail.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      822a6961
    • X
      perf_event: Cleanup for cpu_clock_perf_event_update() · ec89a06f
      Xiao Guangrong 提交于
      Using atomic64_xchg() instead of atomic64_read() and
      atomic64_set().
      Signed-off-by: NXiao Guangrong <xiaoguangrong@cn.fujitsu.com>
      Reviewed-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Paul Mackerras <paulus@samba.org>
      LKML-Reference: <4B1F19DC.90204@cn.fujitsu.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      ec89a06f
    • X
      perf_event: Allocate children's perf_event_ctxp at the right time · b93f7978
      Xiao Guangrong 提交于
      In current code, children task will allocate memory for
      'child->perf_event_ctxp' if the parent is counted, we can
      do it only if the parent allowed children inherit it.
      
      It can save memory and reduce overhead.
      Signed-off-by: NXiao Guangrong <xiaoguangrong@cn.fujitsu.com>
      Reviewed-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Paul Mackerras <paulus@samba.org>
      LKML-Reference: <4B1F19A8.5040805@cn.fujitsu.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      b93f7978
    • X
      perf_event: Clean up __perf_event_init_context() · aa5452d7
      Xiao Guangrong 提交于
      Clean up the code a bit:
      
       - define 'perf_cpu_context' variable with 'static'
       - use kzalloc() instead of kmalloc() and memset()
      Signed-off-by: NXiao Guangrong <xiaoguangrong@cn.fujitsu.com>
      Reviewed-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Paul Mackerras <paulus@samba.org>
      LKML-Reference: <4B1F194D.7080306@cn.fujitsu.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      aa5452d7
    • F
      hw-breakpoints: Modify breakpoints without unregistering them · 44234adc
      Frederic Weisbecker 提交于
      Currently, when ptrace needs to modify a breakpoint, like disabling
      it, changing its address, type or len, it calls
      modify_user_hw_breakpoint(). This latter will perform the heavy and
      racy task of unregistering the old breakpoint and registering a new
      one.
      
      This is racy as someone else might steal the reserved breakpoint
      slot under us, which is undesired as the breakpoint is only
      supposed to be modified, sometimes in the middle of a debugging
      workflow. We don't want our slot to be stolen in the middle.
      
      So instead of unregistering/registering the breakpoint, just
      disable it while we modify its breakpoint fields and re-enable it
      after if necessary.
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Prasad <prasad@linux.vnet.ibm.com>
      LKML-Reference: <1260347148-5519-1-git-send-regression-fweisbec@gmail.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      44234adc
    • M
      perf probe: Update perf-probe document · c937fe20
      Masami Hiramatsu 提交于
      Add --list and --del option descriptions to perf-probe.txt.
      Signed-off-by: NMasami Hiramatsu <mhiramat@redhat.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Jim Keniston <jkenisto@us.ibm.com>
      Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
      Cc: Christoph Hellwig <hch@infradead.org>
      Cc: Frank Ch. Eigler <fche@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jason Baron <jbaron@redhat.com>
      Cc: K.Prasad <prasad@linux.vnet.ibm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: systemtap <systemtap@sources.redhat.com>
      Cc: DLE <dle-develop@lists.sourceforge.net>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <20091208220330.10142.73296.stgit@dhcp-100-2-132.bos.redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      c937fe20
    • M
      perf probe: Support --del option · fa28244d
      Masami Hiramatsu 提交于
      Support perf probe --del <event> option. Currently,
      perf probe can have only one event for each --del option.
      If you'd like to delete several probe events, you need
      to specify --del for each events.
      Signed-off-by: NMasami Hiramatsu <mhiramat@redhat.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Jim Keniston <jkenisto@us.ibm.com>
      Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
      Cc: Christoph Hellwig <hch@infradead.org>
      Cc: Frank Ch. Eigler <fche@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jason Baron <jbaron@redhat.com>
      Cc: K.Prasad <prasad@linux.vnet.ibm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: systemtap <systemtap@sources.redhat.com>
      Cc: DLE <dle-develop@lists.sourceforge.net>
      LKML-Reference: <20091208220323.10142.62079.stgit@dhcp-100-2-132.bos.redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      fa28244d
    • M
      trace-kprobe: Support delete probe syntax · a7c312be
      Masami Hiramatsu 提交于
      Support delete probe syntax. The syntax is "-:[group/]event".
      Signed-off-by: NMasami Hiramatsu <mhiramat@redhat.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Jim Keniston <jkenisto@us.ibm.com>
      Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
      Cc: Christoph Hellwig <hch@infradead.org>
      Cc: Frank Ch. Eigler <fche@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jason Baron <jbaron@redhat.com>
      Cc: K.Prasad <prasad@linux.vnet.ibm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: systemtap <systemtap@sources.redhat.com>
      Cc: DLE <dle-develop@lists.sourceforge.net>
      LKML-Reference: <20091208220316.10142.39192.stgit@dhcp-100-2-132.bos.redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Jim Keniston <jkenisto@us.ibm.com>
      Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
      Cc: Christoph Hellwig <hch@infradead.org>
      Cc: Frank Ch. Eigler <fche@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jason Baron <jbaron@redhat.com>
      Cc: K.Prasad <prasad@linux.vnet.ibm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      a7c312be