aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/util/probe-event.c
AgeCommit message (Collapse)AuthorFilesLines
2010-12-16perf symbols: Stop using vmlinux files with no symbolsFranck Bui-Huu1-1/+1
Fail if the kernel image contains no symbol, allowing using other images in the vmlinux search path that may have a usable symtab. Acked-by: Masami Hiramatsu <[email protected]> Cc: [email protected] Cc: Francis Moreau <[email protected]> Cc: Franck Bui-Huu <[email protected]> Cc: Masami Hiramatsu <[email protected]> LPU-Reference: <[email protected]> Signed-off-by: Franck Bui-Huu <[email protected]> Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
2010-12-16perf probe: Fix use of kernel image path given by 'k' optionFranck Bui-Huu1-3/+12
Users were not being able to have the explicitely specified vmlinux pathname used, instead a search on the vmlinux path was always being made. Reported-by: Francis Moreau <[email protected]> Acked-by: Masami Hiramatsu <[email protected]> Cc: [email protected] Cc: Francis Moreau <[email protected]> Cc: Franck Bui-Huu <[email protected]> Cc: Masami Hiramatsu <[email protected]> LPU-Reference: <[email protected]> Signed-off-by: Franck Bui-Huu <[email protected]> Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
2010-10-21perf probe: Add basic module supportMasami Hiramatsu1-44/+79
Add basic module probe support on perf probe. This introduces "--module <MODNAME>" option to perf probe for putting probes and showing lines and variables in the given module. Currently, this supports only probing on running modules. Supporting off-line module probing is the next step. e.g.) [show lines] # ./perf probe --module drm -L drm_vblank_info <drm_vblank_info:0> 0 int drm_vblank_info(struct seq_file *m, void *data) 1 { struct drm_info_node *node = (struct drm_info_node *) m->private 3 struct drm_device *dev = node->minor->dev; ... [show vars] # ./perf probe --module drm -V drm_vblank_info:3 Available variables at drm_vblank_info:3 @<drm_vblank_info+20> (unknown_type) data struct drm_info_node* node struct seq_file* m [put a probe] # ./perf probe --module drm drm_vblank_info:3 node m Add new event: probe:drm_vblank_info (on drm_vblank_info:3 with node m) You can now use it on all perf tools, such as: perf record -e probe:drm_vblank_info -aR sleep 1 [list probes] # ./perf probe -l probe:drm_vblank_info (on drm_vblank_info:3@drivers/gpu/drm/drm_info.c with ... Cc: Peter Zijlstra <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Frederic Weisbecker <[email protected]> LKML-Reference: <[email protected]> Signed-off-by: Masami Hiramatsu <[email protected]> Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
2010-10-21perf probe: Show accessible global variablesMasami Hiramatsu1-4/+4
Add --externs for allowing --vars to show accessible global (externally defined) variables from a given probe point too. This will give you a hint which globals can be accessible from the probe point. Cc: Peter Zijlstra <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Frederic Weisbecker <[email protected]> LKML-Reference: <[email protected]> Signed-off-by: Masami Hiramatsu <[email protected]> Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
2010-10-21perf probe: Function style fixMasami Hiramatsu1-1/+1
Just change the order of function arguments for ease of read; moving optional bool flag to the last. Cc: Peter Zijlstra <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Frederic Weisbecker <[email protected]> LKML-Reference: <[email protected]> Signed-off-by: Masami Hiramatsu <[email protected]> Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
2010-10-21perf probe: Show accessible local variablesMasami Hiramatsu1-0/+72
Add -V (--vars) option for listing accessible local variables at given probe point. This will help finding which local variables are available for event arguments. e.g.) # perf probe -V call_timer_fn:23 Available variables at call_timer_fn:23 @<run_timer_softirq+345> function_type* fn int preempt_count long unsigned int data struct list_head work_list struct list_head* head struct timer_list* timer struct tvec_base* base Cc: Peter Zijlstra <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Frederic Weisbecker <[email protected]> LKML-Reference: <[email protected]> Signed-off-by: Masami Hiramatsu <[email protected]> Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
2010-09-08perf probe: Fix return probe supportMasami Hiramatsu1-0/+1
Fix a bug to support %return probe syntax again. Previous commit 4235b04 has a bug which disables the %return syntax on perf probe. Cc: Peter Zijlstra <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Arnaldo Carvalho de Melo <[email protected]> Cc: Frederic Weisbecker <[email protected]> LKML-Reference: <[email protected]> Signed-off-by: Masami Hiramatsu <[email protected]> Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
2010-08-06perf probe: Fix memory leaks in add_perf_probe_eventsMasami Hiramatsu1-3/+8
Fix several memory leaks of pkgs and tevs in add_perf_probe_events(). Reported-by: Arnaldo Carvalho de Melo <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: [email protected] LKML-Reference: <[email protected]> Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
2010-07-30perf probe: Rename common fields/functions from kprobe to probe.Srikar Dronamraju1-66/+69
As a precursor for perf to support uprobes, rename fields/functions that had kprobe in their name but can be shared across perf-kprobes and perf-uprobes to probe. Cc: Ananth N Mavinakayanahalli <[email protected]> Cc: Andrew Morton <[email protected]> Cc: Christoph Hellwig <[email protected]> Cc: "Frank Ch. Eigler" <[email protected]> Cc: Frederic Weisbecker <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Jim Keniston <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Mark Wielaard <[email protected]> Cc: Mathieu Desnoyers <[email protected]> Cc: Naren A Devaiah <[email protected]> Cc: Oleg Nesterov <[email protected]> Cc: "Paul E. McKenney" <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Randy Dunlap <[email protected]> Cc: Steven Rostedt <[email protected]> LKML-Reference: <[email protected]> Signed-off-by: Srikar Dronamraju <[email protected]> Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
2010-07-16perf probe: Support comp_dir to find an absolute source pathMasami Hiramatsu1-12/+22
Gcc generates DW_AT_comp_dir and stores relative source path if building kernel without O= option. In that case, perf probe --line sometimes doesn't work without --source option, because it tries to access relative source path. This adds DW_AT_comp_dir support to perf probe for finding an absolute source path when no --source option. LKML-Reference: <[email protected]> Cc: Ingo Molnar <[email protected]> Signed-off-by: Masami Hiramatsu <[email protected]> Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
2010-07-16perf probe: Fix error message if get_real_path() failedMasami Hiramatsu1-0/+59
Perf probe -L shows incorrect error message (Dwarf error) if it fails to find source file. This can confuse users. # ./perf probe -s /nowhere -L vfs_read Debuginfo analysis failed. (-2) Error: Failed to show lines. (-2) With this patch, it shows correct message. # ./perf probe -s /nowhere -L vfs_read Failed to find source file. (-2) Error: Failed to show lines. (-2) LKML-Reference: <[email protected]> Cc: Chase Douglas <[email protected]> Cc: Arnaldo Carvalho de Melo <[email protected]> Cc: Ingo Molnar <[email protected]> Acked-by: Chase Douglas <[email protected]> Signed-off-by: Masami Hiramatsu <[email protected]> Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
2010-07-05perf probe: Support static and global variablesMasami Hiramatsu1-3/+12
Add static and global variables support to perf probe. This allows user to trace non-local variables (and structure members) at probe points. Cc: Ingo Molnar <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Mike Galbraith <[email protected]> Cc: Frederic Weisbecker <[email protected]> LKML-Reference: <[email protected]> Signed-off-by: Masami Hiramatsu <[email protected]> Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
2010-07-05perf probe: Support tracing an entry of arrayMasami Hiramatsu1-17/+39
Add array-entry tracing support to perf probe. This enables to trace an entry of array which is indexed by constant value, e.g. array[0]. For example: $ perf probe -a 'bio_split bi->bi_io_vec[0]' Cc: Paul Mackerras <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Mike Galbraith <[email protected]> Cc: Frederic Weisbecker <[email protected]> LKML-Reference: <[email protected]> Signed-off-by: Masami Hiramatsu <[email protected]> Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
2010-04-27perf machine: Adopt some map_groups functionsArnaldo Carvalho de Melo1-9/+11
Those functions operated on members now grouped in 'struct machine', so move those methods to this new class. The changes made to 'perf probe' shows that using this abstraction inserting probes on guests almost got supported for free. Cc: Avi Kivity <[email protected]> Cc: Frédéric Weisbecker <[email protected]> Cc: Masami Hiramatsu <[email protected]> Cc: Mike Galbraith <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Zhang, Yanmin <[email protected]> LKML-Reference: <new-submission> Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
2010-04-26perf probe: Add --max-probes optionMasami Hiramatsu1-7/+10
Add --max-probes option to change the maximum limit of findable probe points per event, since inlined function can be expanded into thousands of probe points. Default value is 128. Signed-off-by: Masami Hiramatsu <[email protected]> Suggested-by: Arnaldo Carvalho de Melo <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Mike Galbraith <[email protected]> Cc: Frederic Weisbecker <[email protected]> Cc: Ingo Molnar <[email protected]> LKML-Reference: <[email protected]> Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
2010-04-26perf probe: Fix to use symtab only if no debuginfoMasami Hiramatsu1-8/+9
Fix perf probe to use symtab only if there is no debuginfo, because debuginfo has more information than symtab. If we can't find a function in debuginfo, we never find it in symtab. Signed-off-by: Masami Hiramatsu <[email protected]> Reported-by: Arnaldo Carvalho de Melo <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Mike Galbraith <[email protected]> Cc: Frederic Weisbecker <[email protected]> Cc: Ingo Molnar <[email protected]> LKML-Reference: <[email protected]> Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
2010-04-21perf: Fix perf probe build errorFrederic Weisbecker1-1/+1
When we run into dry run mode, we want to make write_kprobe_trace_event to succeed on writing the event. Let's initialize it to 0. Fixes the following build error: util/probe-event.c:1266: attention : «ret» may be used uninitialized in this function util/probe-event.c:1266: note: «ret» was declared here Signed-off-by: Frederic Weisbecker <[email protected]> Acked-by: Masami Hiramatsu <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Arnaldo Carvalho de Melo <[email protected]> LKML-Reference: <[email protected]> Signed-off-by: Ingo Molnar <[email protected]>
2010-04-19perf: 'perf kvm' tool for monitoring guest performance from hostZhang, Yanmin1-1/+6
Here is the patch of userspace perf tool. Signed-off-by: Zhang Yanmin <[email protected]> Signed-off-by: Avi Kivity <[email protected]>
2010-04-14perf probe: Fix line range to show end lineMasami Hiramatsu1-3/+9
Line range should reject the range if the number of lines is 0 (e.g. "sched.c:1024+0"), and it should show the lines include the end of line number (e.g. "sched.c:1024-2048" should show 2048th line). LKML-Reference: <[email protected]> Signed-off-by: Masami Hiramatsu <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Mike Galbraith <[email protected]> Cc: Frederic Weisbecker <[email protected]> Cc: Ingo Molnar <[email protected]> Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
2010-04-14perf probe: Fix a bug that --line range can be overflowMasami Hiramatsu1-11/+12
Since line_finder.lno_s/e are signed int but line_range.start/end are unsigned int, it is possible to be overflow when converting line_range->start/end to line_finder->lno_s/e. This changes line_range.start/end and line_list.line to signed int and adds overflow checks when setting line_finder.lno_s/e. LKML-Reference: <[email protected]> Signed-off-by: Masami Hiramatsu <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Mike Galbraith <[email protected]> Cc: Frederic Weisbecker <[email protected]> Cc: Ingo Molnar <[email protected]> Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
2010-04-14perf probe: Fix mis-estimation for shortening filenameMasami Hiramatsu1-2/+2
Fix mis-estimation size for making a short filename. Since the buffer size is 32 bytes and there are '@' prefix and '\0' termination, maximum shorten filename length should be 30. This means, before searching '/', it should be 31 bytes. LKML-Reference: <[email protected]> Signed-off-by: Masami Hiramatsu <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Mike Galbraith <[email protected]> Cc: Frederic Weisbecker <[email protected]> Cc: Ingo Molnar <[email protected]> Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
2010-04-14perf probe: Fix to use correct debugfs path finderMasami Hiramatsu1-2/+10
Instead of using debugfs_path, use debugfs_find_mountpoint() to find actual debugfs path. LKML-Reference: <[email protected]> Signed-off-by: Masami Hiramatsu <[email protected]> Reported-by: Ingo Molnar <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Mike Galbraith <[email protected]> Cc: Frederic Weisbecker <[email protected]> Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
2010-04-14perf probe: Remove xstrdup()/xstrndup() from util/probe-{event, finder}.cMasami Hiramatsu1-46/+113
Remove all xstr*dup() calls from util/probe-{event,finder}.c since it may cause 'sudden death' in utility functions and it makes reusing it from other code difficult. Cc: Ingo Molnar <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Mike Galbraith <[email protected]> Cc: Frederic Weisbecker <[email protected]> LKML-Reference: <[email protected]> Signed-off-by: Masami Hiramatsu <[email protected]> Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
2010-04-14perf probe: Remove xzalloc() from util/probe-{event, finder}.cMasami Hiramatsu1-18/+51
Remove all xzalloc() calls from util/probe-{event,finder}.c since it may cause 'sudden death' in utility functions and it makes reusing it from other code difficult. Cc: Ingo Molnar <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Mike Galbraith <[email protected]> Cc: Frederic Weisbecker <[email protected]> LKML-Reference: <[email protected]> Signed-off-by: Masami Hiramatsu <[email protected]> Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
2010-04-14perf probe: Remove die() from probe-event codeMasami Hiramatsu1-195/+420
Remove die() and DIE_IF() code from util/probe-event.c since these 'sudden death' in utility functions make reusing it from other code (especially tui/gui) difficult. Cc: Ingo Molnar <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Mike Galbraith <[email protected]> Cc: Frederic Weisbecker <[email protected]> LKML-Reference: <[email protected]> Signed-off-by: Masami Hiramatsu <[email protected]> Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
2010-04-14perf probe: Remove die() from probe-finder codeMasami Hiramatsu1-2/+2
Remove die() and DIE_IF() code from util/probe-finder.c since these 'sudden death' in utility functions make reusing it from other code (especially tui/gui) difficult. Cc: Ingo Molnar <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Mike Galbraith <[email protected]> Cc: Frederic Weisbecker <[email protected]> LKML-Reference: <[email protected]> Signed-off-by: Masami Hiramatsu <[email protected]> Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
2010-04-14perf probe: Support basic type castingMasami Hiramatsu1-1/+22
Add basic type casting for arguments to perf probe. This allows users to specify the actual type of arguments. Of course, if user sets invalid types, kprobe-tracer rejects that. Cc: Ingo Molnar <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Mike Galbraith <[email protected]> Cc: Frederic Weisbecker <[email protected]> LKML-Reference: <[email protected]> Signed-off-by: Masami Hiramatsu <[email protected]> Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
2010-04-14perf probe: Query basic types from debuginfoMasami Hiramatsu1-0/+9
Query the basic type information (byte-size and signed-flag) from debuginfo and pass that to kprobe-tracer. This is especially useful for tracing the members of data structure, because each member has different byte-size on the memory. Cc: Ingo Molnar <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Mike Galbraith <[email protected]> Cc: Frederic Weisbecker <[email protected]> LKML-Reference: <[email protected]> Signed-off-by: Masami Hiramatsu <[email protected]> Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
2010-04-14perf probe: Use the last field name as the argument nameMasami Hiramatsu1-0/+4
Set the last field name to the argument name when the argument is refering a data-structure member. e.g. ./perf probe --add 'vfs_read file->f_mode' Add new event: probe:vfs_read (on vfs_read with f_mode=file->f_mode) This probe records file->f_mode, but the argument name becomes "f_mode". This enables perf-trace command to parse trace event format correctly. Cc: Ingo Molnar <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Mike Galbraith <[email protected]> Cc: Frederic Weisbecker <[email protected]> LKML-Reference: <[email protected]> Signed-off-by: Masami Hiramatsu <[email protected]> Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
2010-04-14perf probe: Support argument nameMasami Hiramatsu1-10/+24
Set given names to event arguments. The syntax is same as kprobe-tracer, you can add 'NAME=' right before each argument. e.g. ./perf probe vfs_read foo=file then, 'foo' is set to the argument name as below. ./perf probe -l probe:vfs_read (on [email protected]/fs/read_write.c with foo) Cc: Ingo Molnar <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Mike Galbraith <[email protected]> Cc: Frederic Weisbecker <[email protected]> LKML-Reference: <[email protected]> Signed-off-by: Masami Hiramatsu <[email protected]> Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
2010-03-22perf probe: Cleanup debuginfo related codeMasami Hiramatsu1-159/+184
Cleanup debuginfo related code to eliminate fragile code which pointed by Ingo (Thanks!). 1) Invert logic of NO_DWARF_SUPPORT to DWARF_SUPPORT. 2) For removing assymetric/local variable ifdefs, introduce more helper functions. 3) Change options order to reduce the number of ifdefs. Reported-by: Ingo Molnar <[email protected]> Signed-off-by: Masami Hiramatsu <[email protected]> Signed-off-by: Arnaldo Carvalho de Melo <[email protected]> Cc: Frederic Weisbecker <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Mike Galbraith <[email protected]> Cc: Peter Zijlstra <[email protected]> LKML-Reference: <[email protected]> Signed-off-by: Ingo Molnar <[email protected]>
2010-03-18perf events: Fix false positive build warning with older GCC'sIngo Molnar1-1/+1
gcc 4.2.1 produces: util/probe-event.c: In function 'add_perf_probe_events': util/probe-event.c:883: warning: 'tev' may be used uninitialized in this function make: *** [util/probe-event.o] Error 1 Newer GCCs get this right. To work it around, initialize the variable to NULL so that older GCCs see it as initialized too. Cc: Masami Hiramatsu <[email protected]> Cc: Frederic Weisbecker <[email protected]> Cc: Arnaldo Carvalho de Melo <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Mike Galbraith <[email protected]> Cc: Peter Zijlstra <[email protected]> LKML-Reference: <[email protected]> Signed-off-by: Ingo Molnar <[email protected]>
2010-03-17perf probe: Fix !dwarf buildIngo Molnar1-0/+6
Fix the !drawf build. This uses the existing NO_DWARF_SUPPORT mechanism we use for that, but it's really fragile and needs a cleanup. (in a separate patch) 1) Such uses: #ifndef NO_DWARF_SUPPORT are double inverted logic a'la 'not not'. Instead the flag should be called DWARF_SUPPORT. 2) Furthermore, assymetric #ifdef polluted code flow like: if (need_dwarf) #ifdef NO_DWARF_SUPPORT die("Debuginfo-analysis is not supported"); #else /* !NO_DWARF_SUPPORT */ pr_debug("Some probes require debuginfo.\n"); fd = open_vmlinux(); is very fragile and not acceptable. Instead of that helper functions should be created and the dwarf/no-dwarf logic should be separated more cleanly. 3) Local variable #ifdefs like this: #ifndef NO_DWARF_SUPPORT int fd; #endif Are fragile as well and should be eliminated. Helper functions achieve that too. Cc: Masami Hiramatsu <[email protected]> Cc: Frederic Weisbecker <[email protected]> Cc: Arnaldo Carvalho de Melo <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Mike Galbraith <[email protected]> Cc: Peter Zijlstra <[email protected]> LKML-Reference: <[email protected]> Signed-off-by: Ingo Molnar <[email protected]>
2010-03-17perf probe: Add data structure member access supportMasami Hiramatsu1-4/+86
Support accessing members in the data structures. With this, perf-probe accepts data-structure members(IOW, it now accepts dot '.' and arrow '->' operators) as probe arguemnts. e.g. ./perf probe --add 'schedule:44 rq->curr' ./perf probe --add 'vfs_read file->f_op->read file->f_path.dentry' Note that '>' can be interpreted as redirection in command-line. Signed-off-by: Masami Hiramatsu <[email protected]> Cc: systemtap <[email protected]> Cc: DLE <[email protected]> Cc: Frederic Weisbecker <[email protected]> Cc: Arnaldo Carvalho de Melo <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Mike Galbraith <[email protected]> Cc: Peter Zijlstra <[email protected]> LKML-Reference: <[email protected]> Signed-off-by: Ingo Molnar <[email protected]>
2010-03-17perf probe: List probes with line number and file nameMasami Hiramatsu1-13/+42
Improve --list to show current exist probes with line number and file name. This enables user easily to check which line is already probed. for example: ./perf probe --list probe:vfs_read (on vfs_read:[email protected]/fs/read_write.c) Signed-off-by: Masami Hiramatsu <[email protected]> Cc: systemtap <[email protected]> Cc: DLE <[email protected]> Cc: Frederic Weisbecker <[email protected]> Cc: Arnaldo Carvalho de Melo <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Mike Galbraith <[email protected]> Cc: Peter Zijlstra <[email protected]> LKML-Reference: <[email protected]> Signed-off-by: Ingo Molnar <[email protected]>
2010-03-17perf probe: Introduce kprobe_trace_event and perf_probe_eventMasami Hiramatsu1-226/+400
Introduce kprobe_trace_event and perf_probe_event and replace old probe_point structure with it. probe_point structure is not enough flexible nor extensible. New data structures will help implementing further features. Signed-off-by: Masami Hiramatsu <[email protected]> Cc: systemtap <[email protected]> Cc: DLE <[email protected]> Cc: Frederic Weisbecker <[email protected]> Cc: Arnaldo Carvalho de Melo <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Mike Galbraith <[email protected]> Cc: Peter Zijlstra <[email protected]> LKML-Reference: <[email protected]> Signed-off-by: Ingo Molnar <[email protected]>
2010-03-17perf probe: Add --dry-run optionMasami Hiramatsu1-8/+16
Add --dry-run option for debugging and testing. Signed-off-by: Masami Hiramatsu <[email protected]> Cc: systemtap <[email protected]> Cc: DLE <[email protected]> Cc: Frederic Weisbecker <[email protected]> Cc: Arnaldo Carvalho de Melo <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Mike Galbraith <[email protected]> Cc: Peter Zijlstra <[email protected]> LKML-Reference: <[email protected]> Signed-off-by: Ingo Molnar <[email protected]>
2010-03-17perf probe: Move add-probe routine to util/Masami Hiramatsu1-2/+135
Move add-probe routine to util/probe_event.c. This simplifies main routine for reducing maintenance cost. Signed-off-by: Masami Hiramatsu <[email protected]> Cc: systemtap <[email protected]> Cc: DLE <[email protected]> Cc: Frederic Weisbecker <[email protected]> Cc: Arnaldo Carvalho de Melo <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Mike Galbraith <[email protected]> Cc: Peter Zijlstra <[email protected]> LKML-Reference: <[email protected]> Signed-off-by: Ingo Molnar <[email protected]>
2010-03-17perf probe: Use wrapper functionsMasami Hiramatsu1-29/+17
Use wrapped functions as much as possible, to check out of memory conditions in perf probe. Signed-off-by: Masami Hiramatsu <[email protected]> Cc: systemtap <[email protected]> Cc: DLE <[email protected]> Cc: Frederic Weisbecker <[email protected]> Cc: Arnaldo Carvalho de Melo <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Mike Galbraith <[email protected]> Cc: Peter Zijlstra <[email protected]> LKML-Reference: <[email protected]> Signed-off-by: Ingo Molnar <[email protected]>
2010-03-13perf probe: Fix need_dwarf flag if lazy matching is usedMasami Hiramatsu1-1/+1
Set need_dwarf if lazy matching pattern is specified, because lazy matching requires real source path for which we must use debuginfo. Signed-off-by: Masami Hiramatsu <[email protected]> Cc: systemtap <[email protected]> Cc: DLE <[email protected]> LKML-Reference: <[email protected]> Signed-off-by: Ingo Molnar <[email protected]>
2010-03-09Merge commit 'v2.6.34-rc1' into perf/urgentIngo Molnar1-18/+37
Conflicts: tools/perf/util/probe-event.c Merge reason: Pick up -rc1 and resolve the conflict as well. Signed-off-by: Ingo Molnar <[email protected]>
2010-03-05Merge branch 'perf-probes-for-linus-2' of ↵Linus Torvalds1-18/+37
git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip * 'perf-probes-for-linus-2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: x86: Issue at least one memory barrier in stop_machine_text_poke() perf probe: Correct probe syntax on command line help perf probe: Add lazy line matching support perf probe: Show more lines after last line perf probe: Check function address range strictly in line finder perf probe: Use libdw callback routines perf probe: Use elfutils-libdw for analyzing debuginfo perf probe: Rename probe finder functions perf probe: Fix bugs in line range finder perf probe: Update perf probe document perf probe: Do not show --line option without dwarf support kprobes: Add documents of jump optimization kprobes/x86: Support kprobes jump optimization on x86 x86: Add text_poke_smp for SMP cross modifying code kprobes/x86: Cleanup save/restore registers kprobes/x86: Boost probes when reentering kprobes: Jump optimization sysctl interface kprobes: Introduce kprobes jump optimization kprobes: Introduce generic insn_slot framework kprobes/x86: Cleanup RELATIVEJUMP_INSTRUCTION to RELATIVEJUMP_OPCODE
2010-02-28Merge branch 'perf-core-for-linus' of ↵Linus Torvalds1-1/+104
git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip * 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (172 commits) perf_event, amd: Fix spinlock initialization perf_event: Fix preempt warning in perf_clock() perf tools: Flush maps on COMM events perf_events, x86: Split PMU definitions into separate files perf annotate: Handle samples not at objdump output addr boundaries perf_events, x86: Remove superflous MSR writes perf_events: Simplify code by removing cpu argument to hw_perf_group_sched_in() perf_events, x86: AMD event scheduling perf_events: Add new start/stop PMU callbacks perf_events: Report the MMAP pgoff value in bytes perf annotate: Defer allocating sym_priv->hist array perf symbols: Improve debugging information about symtab origins perf top: Use a macro instead of a constant variable perf symbols: Check the right return variable perf/scripts: Tag syscall_name helper as not yet available perf/scripts: Add perf-trace-python Documentation perf/scripts: Remove unnecessary PyTuple resizes perf/scripts: Add syscall tracing scripts perf/scripts: Add Python scripting engine perf/scripts: Remove check-perf-trace from listed scripts ... Fix trivial conflict in tools/perf/util/probe-event.c
2010-02-27Merge commit 'v2.6.33' into perf/coreFrederic Weisbecker1-0/+3
Merge reason: __percpu annotations need the corresponding sparse address space definition upstream. Conflicts: tools/perf/util/probe-event.c (trivial)
2010-02-25perf probe: Add lazy line matching supportMasami Hiramatsu1-18/+30
Add lazy line matching support for specifying new probes. This also changes the syntax of perf probe a bit. Now perf probe accepts one of below probe event definitions. 1) Define event based on function name [EVENT=]FUNC[@SRC][:RLN|+OFF|%return|;PTN] [ARG ...] 2) Define event based on source file with line number [EVENT=]SRC:ALN [ARG ...] 3) Define event based on source file with lazy pattern [EVENT=]SRC;PTN [ARG ...] - New lazy matching pattern(PTN) follows ';' (semicolon). And it must be put the end of the definition. - So, @SRC is no longer the part which must be put at the end of the definition. Note that ';' (semicolon) can be interpreted as the end of a command by the shell. This means that you need to quote it. (anyway you will need to quote the lazy pattern itself too, because it may contains other sensitive characters, like '[',']' etc.). Lazy matching ------------- The lazy line matching is similar to glob matching except ignoring spaces in both of pattern and target. e.g. 'a=*' can matches 'a=b', 'a = b', 'a == b' and so on. This provides some sort of flexibility and robustness to probe point definitions against minor code changes. (for example, actual 10th line of schedule() can be changed easily by modifying schedule(), but the same line matching 'rq=cpu_rq*' may still exist.) Changes in v3: - Cast Dwarf_Addr to uintmax_t for printf-formats. Changes in v2: - Cast Dwarf_Addr to unsigned long long for printf-formats. Signed-off-by: Masami Hiramatsu <[email protected]> Cc: systemtap <[email protected]> Cc: DLE <[email protected]> Cc: Frederic Weisbecker <[email protected]> Cc: Arnaldo Carvalho de Melo <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Mike Galbraith <[email protected]> Cc: K.Prasad <[email protected]> Cc: Frederic Weisbecker <[email protected]> Cc: Ananth N Mavinakayanahalli <[email protected]> LKML-Reference: <[email protected]> Signed-off-by: Ingo Molnar <[email protected]>
2010-02-25perf probe: Show more lines after last lineMasami Hiramatsu1-0/+7
Show 2 more lines after the last probe-able line. This will clearly show the last closed-brace of inline functions. Signed-off-by: Masami Hiramatsu <[email protected]> Cc: systemtap <[email protected]> Cc: DLE <[email protected]> Cc: Frederic Weisbecker <[email protected]> Cc: Arnaldo Carvalho de Melo <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Mike Galbraith <[email protected]> Cc: K.Prasad <[email protected]> Cc: Frederic Weisbecker <[email protected]> Cc: Ananth N Mavinakayanahalli <[email protected]> LKML-Reference: <[email protected]> Signed-off-by: Ingo Molnar <[email protected]>
2010-02-22perf probe: Init struct probe_point and set counter correctlyMasami Hiramatsu1-0/+3
Clear struct probe_point before using it in show_perf_probe_events(), and set pp->found counter correctly in synthesize_perf_probe_point(). Without this initialization, clear_probe_point() will free random addresses. Signed-off-by: Masami Hiramatsu <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Mike Galbraith <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Arnaldo Carvalho de Melo <[email protected]> Cc: Frederic Weisbecker <[email protected]> Cc: systemtap <[email protected]> Cc: DLE <[email protected]> LKML-Reference: <[email protected]> Signed-off-by: Ingo Molnar <[email protected]>
2010-01-13perf probe: Support --line option to show probable source-code linesMasami Hiramatsu1-0/+100
Add --line option to support showing probable source-code lines. perf probe --line SRC:LN[-LN|+NUM] or perf probe --line FUNC[:LN[-LN|+NUM]] This option shows source-code with line number if the line can be probed. Lines without line number (and blue color) means that the line can not be probed, because debuginfo doesn't have the information of those lines. The argument specifies the range of lines, "source.c:100-120" shows lines between 100th to l20th in source.c file. And "func:10+20" shows 20 lines from 10th line of func function. e.g. # ./perf probe --line kernel/sched.c:1080 <kernel/sched.c:1080> * * called with rq->lock held and irqs disabled */ static void hrtick_start(struct rq *rq, u64 delay) { struct hrtimer *timer = &rq->hrtick_timer; 1086 ktime_t time = ktime_add_ns(timer->base->get_time(), delay); hrtimer_set_expires(timer, time); 1090 if (rq == this_rq()) { 1091 hrtimer_restart(timer); 1092 } else if (!rq->hrtick_csd_pending) { 1093 __smp_call_function_single(cpu_of(rq), &rq->hrtick_csd, 1094 rq->hrtick_csd_pending = 1; If you specifying function name, this shows function-relative line number. # ./perf probe --line schedule <schedule:0> asmlinkage void __sched schedule(void) 1 { struct task_struct *prev, *next; unsigned long *switch_count; struct rq *rq; int cpu; need_resched: preempt_disable(); 9 cpu = smp_processor_id(); 10 rq = cpu_rq(cpu); 11 rcu_sched_qs(cpu); 12 prev = rq->curr; 13 switch_count = &prev->nivcsw; Signed-off-by: Masami Hiramatsu <[email protected]> Cc: Frederic Weisbecker <[email protected]> Cc: Arnaldo Carvalho de Melo <[email protected]> Cc: systemtap <[email protected]> Cc: DLE <[email protected]> Cc: Frederic Weisbecker <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Arnaldo Carvalho de Melo <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Mike Galbraith <[email protected]> LKML-Reference: <[email protected]> Signed-off-by: Ingo Molnar <[email protected]>
2010-01-13perf probe: Show probe list in pagerMasami Hiramatsu1-0/+3
Show probe list in pager, because the list can be longer than a page. Signed-off-by: Masami Hiramatsu <[email protected]> Cc: Frederic Weisbecker <[email protected]> Cc: Arnaldo Carvalho de Melo <[email protected]> Cc: systemtap <[email protected]> Cc: DLE <[email protected]> Cc: Frederic Weisbecker <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Arnaldo Carvalho de Melo <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Mike Galbraith <[email protected]> LKML-Reference: <[email protected]> Signed-off-by: Ingo Molnar <[email protected]>
2009-12-30perf probe: Change CONFIG_KPROBE_TRACER to CONFIG_KPROBE_EVENTLiming Wang1-1/+1
make the config name consistent Signed-off-by: Liming Wang <[email protected]> Acked-by: Masami Hiramatsu <[email protected]> Cc: Frederic Weisbecker <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Peter Zijlstra <[email protected]> LKML-Reference: <[email protected]> Signed-off-by: Ingo Molnar <[email protected]>