1. 01 12月, 2009 5 次提交
    • M
      perf probe: Add probe-finder.h without libdwarf · 57d250df
      Masami Hiramatsu 提交于
      Add probe-finder.h as LIB_H without libdwarf, because that
      header is included even if no libdwarf.
      Signed-off-by: NMasami Hiramatsu <mhiramat@redhat.com>
      Cc: systemtap <systemtap@sources.redhat.com>
      Cc: DLE <dle-develop@lists.sourceforge.net>
      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: Frederic Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <20091201001934.10235.44656.stgit@harusame>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      57d250df
    • M
      perf probe: Change a debugging message from pr_info to pr_debug · f41b1e43
      Masami Hiramatsu 提交于
      Change annoying debug-info using notice from pr_info() to
      pr_debug(), since the message always printed when user adds a
      probe point which requires debug-info.
      Signed-off-by: NMasami Hiramatsu <mhiramat@redhat.com>
      Cc: systemtap <systemtap@sources.redhat.com>
      Cc: DLE <dle-develop@lists.sourceforge.net>
      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: Frederic Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <20091201001927.10235.63645.stgit@harusame>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      f41b1e43
    • M
      trace_kprobes: Fix a memory leak bug and check kstrdup() return value · ba8665d7
      Masami Hiramatsu 提交于
      Fix a memory leak case in create_trace_probe(). When an argument
      is too long (> MAX_ARGSTR_LEN), it just jumps to error path. In
      that case tp->args[i].name is not released.
      This also fixes a bug to check kstrdup()'s return value.
      Signed-off-by: NMasami Hiramatsu <mhiramat@redhat.com>
      Cc: systemtap <systemtap@sources.redhat.com>
      Cc: DLE <dle-develop@lists.sourceforge.net>
      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: Frederic Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <20091201001919.10235.56455.stgit@harusame>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      ba8665d7
    • L
      perf timechart: Remove open-coded event parsing code · 5cbd0805
      Li Zefan 提交于
      Convert builtin-timechart.c to mmap_dispatch_perf_file() +
      perf_file_handler.
      Signed-off-by: NLi Zefan <lizf@cn.fujitsu.com>
      Acked-by: NArjan van de Ven <arjan@infradead.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Arnaldo Carvalho de Melo <acme@infradead.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      LKML-Reference: <4B14B21C.2040406@cn.fujitsu.com>
      [ v2: cleaned up the printout, fixed a whitespace detail ]
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      5cbd0805
    • L
      perf annotate: Fix perf data parsing · bab81b62
      Li Zefan 提交于
      perf-annotate doesn't parse perf.data correctly in that it
      doesn't read perf header. Fix this by using
      mmap_dispatch_perf_file().
      
      Before:
      
      TOTAL events:      17565
            MMAP events:       3221
            LOST events:         10
            COMM events:        235
            EXIT events:          2
        THROTTLE events:          1
      UNTHROTTLE events:          2
            FORK events:         10
            READ events:          1
          SAMPLE events:      14083
      
      After:
      
      TOTAL events:      17290
            MMAP events:       3203
            LOST events:          0
            COMM events:        234
            EXIT events:          1
        THROTTLE events:          0
      UNTHROTTLE events:          0
            FORK events:          0
            READ events:          0
          SAMPLE events:      13852
      Signed-off-by: NLi Zefan <lizf@cn.fujitsu.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Arnaldo Carvalho de Melo <acme@infradead.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Arjan van de Ven <arjan@infradead.org>
      LKML-Reference: <4B14B201.9030708@cn.fujitsu.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      bab81b62
  2. 28 11月, 2009 12 次提交
    • A
      perf tools: Consolidate symbol resolving across all tools · 1ed091c4
      Arnaldo Carvalho de Melo 提交于
      Now we have a very high level routine for simple tools to
      process IP sample events:
      
      	int event__preprocess_sample(const event_t *self,
      				     struct addr_location *al,
      				     symbol_filter_t filter)
      
      It receives the event itself and will insert new threads in the
      global threads list and resolve the map and symbol, filling all
      this info into the new addr_location struct, so that tools like
      annotate and report can further process the event by creating
      hist_entries in their specific way (with or without callgraphs,
      etc).
      
      It in turn uses the new next layer function:
      
      	void thread__find_addr_location(struct thread *self, u8 cpumode,
      					enum map_type type, u64 addr,
      					struct addr_location *al,
      					symbol_filter_t filter)
      
      This one will, given a thread (userspace or the kernel kthread
      one), will find the given type (MAP__FUNCTION now, MAP__VARIABLE
      too in the near future) at the given cpumode, taking vdsos into
      account (userspace hit, but kernel symbol) and will fill all
      these details in the addr_location given.
      
      Tools that need a more compact API for plain function
      resolution, like 'kmem', can use this other one:
      
      	struct symbol *thread__find_function(struct thread *self, u64 addr,
      					     symbol_filter_t filter)
      
      So, to resolve a kernel symbol, that is all the 'kmem' tool
      needs, its just a matter of calling:
      
      	sym = thread__find_function(kthread, addr, NULL);
      
      The 'filter' parameter is needed because we do lazy
      parsing/loading of ELF symtabs or /proc/kallsyms.
      
      With this we remove more code duplication all around, which is
      always good, huh? :-)
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      Cc: John Kacur <jkacur@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      LKML-Reference: <1259346563-12568-12-git-send-email-acme@infradead.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      1ed091c4
    • A
      perf tools: Reorganize event processing routines, lotsa dups killed · 62daacb5
      Arnaldo Carvalho de Melo 提交于
      While implementing event__preprocess_sample, that will do all of
      the symbol lookup in one convenient function, I noticed that
      util/process_event.[ch] were not being used at all, then started
      looking if there were other functions that could be shared
      and...
      
      All those functions really don't need to receive offset + head,
      the only thing they did was common to all of them, so do it at
      one place instead.
      
      Stats about number of each type of event processed now is done
      in a central place.
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      Cc: John Kacur <jkacur@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      LKML-Reference: <1259346563-12568-11-git-send-email-acme@infradead.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      62daacb5
    • A
      perf symbols: When not using modules, discard its symbols · 1de8e245
      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: <1259346563-12568-10-git-send-email-acme@infradead.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      1de8e245
    • A
      perf symbols: Support multiple symtabs in struct thread · 95011c60
      Arnaldo Carvalho de Melo 提交于
      Making the routines that were so far specific to the kernel maps
      useful for all threads.
      
      This is done by making the kernel maps be contained in a kernel
      "thread".
      
      This gets the kernel specific routines closer to the userspace
      counterparts, which will help in reducing the boilerplate for
      resolving a symbol, as will be demonstrated in the next patches.
      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: <1259346563-12568-9-git-send-email-acme@infradead.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      95011c60
    • A
      perf symbols: Kernel_maps should be an array of MAP__NR_TYPES entries · 23ea4a3f
      Arnaldo Carvalho de Melo 提交于
      So that we can support multiple symbol table types.
      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: <1259346563-12568-8-git-send-email-acme@infradead.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      23ea4a3f
    • A
      perf symbols: Make the kallsyms loading routines part of the dso class · 4e06255f
      Arnaldo Carvalho de Melo 提交于
      So that the kallsyms loading routines are the direct counterpart
      of the vmlinux loading ones, i.e. dso__load_kallsyms is the
      counterpart of dso__load_vmlinux.
      
      In the process make them also use the symbols rb tree indexed by
      map->type, paving the way for supporting other types of symtabs,
      such as the next one to be supported: variables.
      
      This also allowed removal of yet another global variable:
      kernel_map__functions.
      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: <1259346563-12568-7-git-send-email-acme@infradead.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      4e06255f
    • A
      perf symbols: Better support for multiple symbol tables per dso · 6a4694a4
      Arnaldo Carvalho de Melo 提交于
      By using an array of rb_roots in struct dso we can, from a
      struct map instance to get the right symbol rb_tree more easily.
      This way we can have just one symbol lookup method for struct
      map instances, map__find_symbol, instead of one per symtab type
      (functions, variables).
      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: <1259346563-12568-6-git-send-email-acme@infradead.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      6a4694a4
    • A
      perf symbols: Add a 'type' field to struct map · 3610583c
      Arnaldo Carvalho de Melo 提交于
      That way we will be able to check if the right symtab is loaded
      in the underlying DSO.
      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: <1259346563-12568-5-git-send-email-acme@infradead.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      3610583c
    • A
      perf symbols: Unexport kernel_map__functions · 605ca4ba
      Arnaldo Carvalho de Melo 提交于
      perf annotate was the only user, and it doesn't really need 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: <1259346563-12568-4-git-send-email-acme@infradead.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      605ca4ba
    • A
      perf symbols: Split the dsos list into kernel and user parts · b0da954a
      Arnaldo Carvalho de Melo 提交于
      We don't need to look at modules in dsos__findnew because the
      kernel events come only with user DSOs. Also we need a way to
      list just the module DSOs so that we can create multiple sets of
      maps, now that we will support maps for the variables in a
      symtab.
      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: <1259346563-12568-3-git-send-email-acme@infradead.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      b0da954a
    • A
      perf symbols: Rename kernel_mapto kernel_map[s]__functions · 61f37a82
      Arnaldo Carvalho de Melo 提交于
      As we'll have kernel_map[s]__variables too.
      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: <1259346563-12568-2-git-send-email-acme@infradead.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      61f37a82
    • A
      perf symbols: Avoid annoying message about loading symbols · 3f5ee186
      Arnaldo Carvalho de Melo 提交于
      This should be properly fixed when we remove the XXX comment in
      'perf report', function resolve_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: <1259346563-12568-1-git-send-email-acme@infradead.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      3f5ee186
  3. 27 11月, 2009 7 次提交
  4. 26 11月, 2009 16 次提交
    • I
      tracing: Fix kmem event exports · 4d795fb1
      Ingo Molnar 提交于
      Commit 53d0422c ("tracing: Convert some kmem events to DEFINE_EVENT")
      moved the kmem tracepoint creation from util.c to page_alloc.c,
      but forgot to move the exports.
      
      Move them back.
      
      Cc: Li Zefan <lizf@cn.fujitsu.com>
      Cc: Pekka Enberg <penberg@cs.helsinki.fi>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Mel Gorman <mel@csn.ul.ie>
      LKML-Reference: <4B0E286A.2000405@cn.fujitsu.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      4d795fb1
    • M
      tracepoint: Add signal loss events · ba005e1f
      Masami Hiramatsu 提交于
      Add signal_overflow_fail and signal_lose_info tracepoints
      for signal-lost events.
      
      Changes in v3:
       - Add docbook style comments
      
      Changes in v2:
       - Use siginfo string macro
      Suggested-by: NRoland McGrath <roland@redhat.com>
      Reviewed-by: NJason Baron <jbaron@redhat.com>
      Signed-off-by: NMasami Hiramatsu <mhiramat@redhat.com>
      Acked-by: NRoland McGrath <roland@redhat.com>
      Cc: systemtap <systemtap@sources.redhat.com>
      Cc: DLE <dle-develop@lists.sourceforge.net>
      Cc: Oleg Nesterov <oleg@redhat.com>
      LKML-Reference: <20091124215658.30449.9934.stgit@dhcp-100-2-132.bos.redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      ba005e1f
    • M
      tracepoint: Add signal deliver event · f9d4257e
      Masami Hiramatsu 提交于
      Add a tracepoint where a process gets a signal. This tracepoint
      shows signal-number, sa-handler and sa-flag.
      
      Changes in v3:
       - Add docbook style comments
      
      Changes in v2:
       - Add siginfo argument
       - Fix comment
      Signed-off-by: NMasami Hiramatsu <mhiramat@redhat.com>
      Reviewed-by: NJason Baron <jbaron@redhat.com>
      Acked-by: NRoland McGrath <roland@redhat.com>
      Cc: systemtap <systemtap@sources.redhat.com>
      Cc: DLE <dle-develop@lists.sourceforge.net>
      Cc: Oleg Nesterov <oleg@redhat.com>
      LKML-Reference: <20091124215651.30449.20926.stgit@dhcp-100-2-132.bos.redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      f9d4257e
    • M
      tracepoint: Move signal sending tracepoint to events/signal.h · d1eb650f
      Masami Hiramatsu 提交于
      Move signal sending event to events/signal.h. This patch also
      renames sched_signal_send event to signal_generate.
      
      Changes in v4:
       - Fix a typo of task_struct pointer.
      
      Changes in v3:
       - Add docbook style comments
      
      Changes in v2:
       - Add siginfo argument
       - Add siginfo storing macro
      Signed-off-by: NMasami Hiramatsu <mhiramat@redhat.com>
      Reviewed-by: NJason Baron <jbaron@redhat.com>
      Acked-by: NRoland McGrath <roland@redhat.com>
      Cc: systemtap <systemtap@sources.redhat.com>
      Cc: DLE <dle-develop@lists.sourceforge.net>
      Cc: Oleg Nesterov <oleg@redhat.com>
      LKML-Reference: <20091124215645.30449.60208.stgit@dhcp-100-2-132.bos.redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      d1eb650f
    • F
      hw-breakpoints: Fix unused function in off-case · 80bbf6b6
      Frederic Weisbecker 提交于
      bp_perf_event_destroy() is unused in its off-case version, let's
      remove it to fix the following warning reported by Stephen
      Rothwell in linux-next:
      
        kernel/perf_event.c:4306: warning: 'bp_perf_event_destroy' defined but not used
      Reported-by: NStephen Rothwell <sfr@canb.auug.org.au>
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      LKML-Reference: <1259180453-5813-1-git-send-email-fweisbec@gmail.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      80bbf6b6
    • A
      kernel/hw_breakpoint.c: Fix local/global shadowing · 11e66357
      Andrew Morton 提交于
      If the new percpu tree is combined with the perf events tree
      the following new warning triggers:
      
       kernel/hw_breakpoint.c: In function 'toggle_bp_task_slot':
       kernel/hw_breakpoint.c:151: warning: 'task_bp_pinned' is used uninitialized in this function
      
      Because it's not valid anymore to define a local variable
      and a percpu variable (even if it's file scope local) with
      the same name.
      
      Rename the local variable to resolve this.
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: K.Prasad <prasad@linux.vnet.ibm.com>
      Cc: Tejun Heo <tj@kernel.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      LKML-Reference: <200911260701.nAQ71owx016356@imap1.linux-foundation.org>
      [ v2: added changelog ]
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      11e66357
    • F
      x86/hw-breakpoints: Don't lose GE flag while disabling a breakpoint · 2c31b795
      Frederic Weisbecker 提交于
      When we schedule out a breakpoint from the cpu, we also
      incidentally remove the "Global exact breakpoint" flag from the
      breakpoint control register. It makes us losing the fine grained
      precision about the origin of the instructions that may trigger
      breakpoint exceptions for the other breakpoints running in this
      cpu.
      Reported-by: NPrasad <prasad@linux.vnet.ibm.com>
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <1259211878-6013-1-git-send-regression-fweisbec@gmail.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      2c31b795
    • F
      hw-breakpoints: Simplify error handling in breakpoint creation requests · 605bfaee
      Frederic Weisbecker 提交于
      This simplifies the error handling when we create a breakpoint.
      We don't need to check the NULL return value corner case anymore
      since we have improved perf_event_create_kernel_counter() to
      always return an error code in the failure case.
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Prasad <prasad@linux.vnet.ibm.com>
      LKML-Reference: <1259210142-5714-3-git-send-regression-fweisbec@gmail.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      605bfaee
    • F
      hw-breakpoints: Improve in-kernel event creation error granularity · c6567f64
      Frederic Weisbecker 提交于
      In fail case, perf_event_create_kernel_counter() returns NULL
      instead of an error, which doesn't help us to inform the user
      about the origin of the problem from the outer most callers.
      Often we can just return -EINVAL, which doesn't help anyone when
      it's eventually about a memory allocation failure.
      
      Then, this patch makes perf_event_create_kernel_counter() always
      return a detailed error code.
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Prasad <prasad@linux.vnet.ibm.com>
      LKML-Reference: <1259210142-5714-2-git-send-regression-fweisbec@gmail.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      c6567f64
    • F
      ksym_tracer: Fix breakpoint removal after modification · d99be40a
      Frederic Weisbecker 提交于
      The error path of a breakpoint modification is broken in
      the ksym tracer. A modified breakpoint hlist node is immediately
      released after its removal. Also we leak a breakpoint in this
      case.
      
      Fix the path.
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Prasad <prasad@linux.vnet.ibm.com>
      LKML-Reference: <1259210142-5714-1-git-send-regression-fweisbec@gmail.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      d99be40a
    • L
      tracing: Restore original format of sched events · 470dda74
      Li Zefan 提交于
      The original format for sched_stat_iowait and sched_stat_sleep:
      
        $ cat events/sched/sched_stat_iowait/format
        ...
        print fmt: "comm=%s pid=%d delay=%Lu [ns]", ...
        $ cat events/sched/sched_stat_sleep/format
        ...
        print fmt: "comm=%s pid=%d delay=%Lu [ns]", ...
      
      But commit commit 75ec29ab
      ("tracing: Convert some sched trace events to DEFINE_EVENT and
      _PRINT") broke the format:
      
        $ cat events/sched/sched_stat_iowait/format
        print fmt: "task: %s:%d iowait: %Lu [ns]", ...
        $ cat events/sched/sched_stat_sleep/format
        print fmt: "task: %s:%d sleep: %Lu [ns]", ...
      
      No change in functionality.
      Signed-off-by: NLi Zefan <lizf@cn.fujitsu.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <4B0E2951.9050800@cn.fujitsu.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      470dda74
    • L
      tracing: Convert some ext4 events to DEFINE_TRACE · b5eb34c3
      Li Zefan 提交于
      Use DECLARE_EVENT_CLASS to remove duplicate code:
      
         text    data     bss     dec     hex filename
       294695    6104     340  301139   49853 fs/ext4/ext4.o.old
       289983    6104     324  296411   485db fs/ext4/ext4.o
      
      5 events are convertd:
      
        ext4__write_begin: ext4_write_begin, ext4_da_write_begin
        ext4__write_end: ext4_{ordered, writeback, journalled}_write_end
      
      No change in functionality.
      Signed-off-by: NLi Zefan <lizf@cn.fujitsu.com>
      Cc: Theodore Ts'o <tytso@mit.edu>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <4B0E2938.2040708@cn.fujitsu.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      b5eb34c3
    • L
      tracing: Convert some jbd2 events to DEFINE_EVENT · 071688f3
      Li Zefan 提交于
      Use DECLARE_EVENT_CLASS to remove duplicate code:
      
         text    data     bss     dec     hex filename
        34903    1693     448   37044    90b4 fs/jbd2/journal.o.old
        31931    1693     416   34040    84f8 fs/jbd2/journal.o
      
      Four events are converted:
      
        jbd2_commit: jbd2_start_commit,
                     jbd2_commit_{locking, flushing, logging}
      
      No change in functionality.
      Signed-off-by: NLi Zefan <lizf@cn.fujitsu.com>
      Cc: Theodore Ts'o <tytso@mit.edu>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <4B0E290F.7030909@cn.fujitsu.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      071688f3
    • L
      tracing: Convert some block events to DEFINE_EVENT · 77ca1e02
      Li Zefan 提交于
      use DECLARE_EVENT_CLASS to remove duplicate code:
      
         text    data     bss     dec     hex filename
        53570    3284     184   57038    dece block/blk-core.o.old
        43702    3284     144   47130    b81a block/blk-core.o
      
      12 events are converted:
      
        block_rq: block_rq_insert, block_rq_issue
        block_rq_with_error: block_rq_{abort, requeue, complete}
        block_bio: block_bio_{backmerge, frontmerge, queue}
        block_get_rq: block_getrq, block_sleeprq
        block_unplug: block_unplug_timer, block_unplug_io
      
      No change in functionality.
      Signed-off-by: NLi Zefan <lizf@cn.fujitsu.com>
      Cc: Jens Axboe <jens.axboe@oracle.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <4B0E28E6.7060609@cn.fujitsu.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      77ca1e02
    • L
      tracing: Convert some power events to DEFINE_EVENT · 7703466b
      Li Zefan 提交于
      Use DECLARE_EVENT_CLASS to remove duplicate code:
      
         text    data     bss     dec     hex filename
         4312     524      12    4848    12f0 kernel/trace/power-traces.o.old
         3455     524       8    3987     f93 kernel/trace/power-traces.o
      
      Two events are converted:
      
        power: power_start, power_frequency
      
      No change in functionality.
      Signed-off-by: NLi Zefan <lizf@cn.fujitsu.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Arjan van de Ven <arjan@infradead.org>
      LKML-Reference: <4B0E28C2.1090906@cn.fujitsu.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      7703466b
    • L
      tracing: Convert some workqueue events to DEFINE_EVENT · 382ece71
      Li Zefan 提交于
      Use DECLARE_EVENT_CLASS to remove duplicate code:
      
         text    data     bss     dec     hex filename
        13171     800      72   14043    36db kernel/workqueue.o.old
        12243     800      68   13111    3337 kernel/workqueue.o
      
      Two events are converted:
      
        workqueue: workqueue_insertion, workqueue_execution
      
      No change in functionality.
      Signed-off-by: NLi Zefan <lizf@cn.fujitsu.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <4B0E289F.5010104@cn.fujitsu.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      382ece71