Jiri Olsa
ceec0b6fc7
ftrace, perf: Add open/close tracepoint perf registration actions
...
Adding TRACE_REG_PERF_OPEN and TRACE_REG_PERF_CLOSE to differentiate
register/unregister from open/close actions.
The register/unregister actions are invoked for the first/last
tracepoint user when opening/closing the event.
The open/close actions are invoked for each tracepoint user when
opening/closing the event.
Link: http://lkml.kernel.org/r/1329317514-8131-3-git-send-email-jolsa@redhat.com
Acked-by: Frederic Weisbecker <fweisbec@gmail.com >
Signed-off-by: Jiri Olsa <jolsa@redhat.com >
Signed-off-by: Steven Rostedt <rostedt@goodmis.org >
2012-02-21 11:08:24 -05:00
Jiri Olsa
e248491ac2
ftrace: Add enable/disable ftrace_ops control interface
...
Adding a way to temporarily enable/disable ftrace_ops. The change
follows the same way as 'global' ftrace_ops are done.
Introducing 2 global ftrace_ops - control_ops and ftrace_control_list
which take over all ftrace_ops registered with FTRACE_OPS_FL_CONTROL
flag. In addition new per cpu flag called 'disabled' is also added to
ftrace_ops to provide the control information for each cpu.
When ftrace_ops with FTRACE_OPS_FL_CONTROL is registered, it is
set as disabled for all cpus.
The ftrace_control_list contains all the registered 'control' ftrace_ops.
The control_ops provides function which iterates ftrace_control_list
and does the check for 'disabled' flag on current cpu.
Adding 3 inline functions:
ftrace_function_local_disable/ftrace_function_local_enable
- enable/disable the ftrace_ops on current cpu
ftrace_function_local_disabled
- get disabled ftrace_ops::disabled value for current cpu
Link: http://lkml.kernel.org/r/1329317514-8131-2-git-send-email-jolsa@redhat.com
Acked-by: Frederic Weisbecker <fweisbec@gmail.com >
Signed-off-by: Jiri Olsa <jolsa@redhat.com >
Signed-off-by: Steven Rostedt <rostedt@goodmis.org >
2012-02-21 11:08:23 -05:00
Steven Rostedt
5b34926114
tracing: Don't use p->len field to determine output in __print_*() functions
...
If more than one __print_*() function is used in a tracepoint
(__print_flags(), __print_symbols(), etc), then the temp seq buffer will
not be zero on entry. Using the temp seq buffer's length to know if
data has been printed or not in the current function is incorrect and
may produce incorrect results.
Currently, no in-tree tracepoint causes this bug, but new ones may
be created.
Cc: Andrew Vagin <avagin@openvz.org >
Signed-off-by: Steven Rostedt <rostedt@goodmis.org >
2012-02-21 11:08:13 -05:00
Andrey Vagin
e404b321db
tracing: Don't print an extra separator of flags
...
If __print_flags() is used after another __print_*() function, the
temp seq_file buffer will not be empty on entry, and the delimiter will
be printed even though there's just one field. We get something like:
|S
instead of just:
S
This is because the length of the temp seq buffer is used to determine
if the delimiter is printed or not. But this algorithm fails when
the seq buffer is not empty on entry, and the delimiter will be printed
because it thinks that a previous field was already printed.
Link: http://lkml.kernel.org/r/1329650167-480655-1-git-send-email-avagin@openvz.org
Signed-off-by: Andrew Vagin <avagin@openvz.org >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: Frederic Weisbecker <fweisbec@gmail.com >
Signed-off-by: Steven Rostedt <rostedt@goodmis.org >
2012-02-20 20:33:31 -05:00
Ingo Molnar
09bda4432a
Merge branch 'tip/perf/core' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace into perf/core
2012-02-17 12:55:07 +01:00
Ingo Molnar
d1e169da9e
Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core
...
Includes smaller fixes and improvements plus the exclude_{host,guest} feature
test and fallback to handle older kernels.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2012-02-17 09:02:28 +01:00
Arnaldo Carvalho de Melo
808e122630
perf tools: Invert the sample_id_all logic
...
Instead of requiring that users of perf_record_opts set
.sample_id_all_avail to true, just invert the logic, using
.sample_id_all_missing, that doesn't need to be explicitely initialized
since gcc will zero members ommitted in a struct initialization.
Just like the newly introduced .exclude_{guest,host} feature test.
Cc: David Ahern <dsahern@gmail.com >
Cc: Frederic Weisbecker <fweisbec@gmail.com >
Cc: Mike Galbraith <efault@gmx.de >
Cc: Paul Mackerras <paulus@samba.org >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Stephane Eranian <eranian@google.com >
Link: http://lkml.kernel.org/n/tip-ab772uzk78cwybihf0vt7kxw@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2012-02-14 14:18:57 -02:00
Arnaldo Carvalho de Melo
0c9781280f
perf tools: Handle kernels that don't support attr.exclude_{guest,host}
...
Just fall back to resetting those fields, if set, warning the user that
that feature is not available.
If guest samples appear they will just be discarded because no struct
machine will be found and thus the event will be accounted as not
handled and dropped, see 0c09571 .
Reported-by: Namhyung Kim <namhyung@gmail.com >
Tested-by: Joerg Roedel <joerg.roedel@amd.com >
Cc: David Ahern <dsahern@gmail.com >
Cc: Frederic Weisbecker <fweisbec@gmail.com >
Cc: Joerg Roedel <joerg.roedel@amd.com >
Cc: Mike Galbraith <efault@gmx.de >
Cc: Paul Mackerras <paulus@samba.org >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Stephane Eranian <eranian@google.com >
Link: http://lkml.kernel.org/n/tip-vuwxig36mzprl5n7nzvnxxsh@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2012-02-14 14:05:30 -02:00
Stephane Eranian
7e1ccd3804
perf tools: cleanup initialization of attr->size
...
The perf_event_attr size needs to be initialized in all cases because it
captures the ABI version.
This patch moves the initialization of the field from the
perf_event_open() syscall stub to its proper location in the
event_attr_init().
Cc: Ingo Molnar <mingo@elte.hu >
Cc: Peter Zijlstra <peterz@infradead.org >
Link: http://lkml.kernel.org/r/20120209151238.GA10272@quad
Signed-off-by: Stephane Eranian <eranian@google.com >
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2012-02-13 23:35:04 -02:00
Robert Richter
f1c67db7e3
perf tools: Factor out feature op to process header sections
...
There is individual code for each feature to process header sections.
Adding a function pointer .process to struct feature_ops for keeping the
implementation in separate functions. Code to process header sections is
now a generic function.
Cc: Ingo Molnar <mingo@elte.hu >
Link: http://lkml.kernel.org/r/1328884916-5901-2-git-send-email-robert.richter@amd.com
Signed-off-by: Robert Richter <robert.richter@amd.com >
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2012-02-13 23:33:36 -02:00
Robert Richter
08d95bd256
perf tools: Moving code in header.c
...
Needed for later changes. No modified functionality.
Cc: Ingo Molnar <mingo@elte.hu >
Link: http://lkml.kernel.org/r/1328884916-5901-1-git-send-email-robert.richter@amd.com
Signed-off-by: Robert Richter <robert.richter@amd.com >
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2012-02-13 23:32:32 -02:00
Jiri Olsa
850f8127fa
perf tools: Add bitmap_or function into bitmap object
...
Adding implementation os bitmap_or function to the bitmap object. It is
stolen from the kernel lib/bitmap.o object.
It is used in upcomming patches.
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com >
Cc: Ingo Molnar <mingo@elte.hu >
Cc: Paul Mackerras <paulus@samba.org >
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl >
Link: http://lkml.kernel.org/r/1327674868-10486-5-git-send-email-jolsa@redhat.com
Signed-off-by: Jiri Olsa <jolsa@redhat.com >
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2012-02-13 23:28:10 -02:00
Jiri Olsa
e90fda0635
perf tools: Add sysfs mountpoint interface
...
Adding sysfs object to provide sysfs mount information in the same way
as debugfs object does.
The object provides following function:
sysfs_find_mountpoint
which returns the sysfs mount mount.
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com >
Cc: Ingo Molnar <mingo@elte.hu >
Cc: Paul Mackerras <paulus@samba.org >
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl >
Link: http://lkml.kernel.org/r/1327674868-10486-4-git-send-email-jolsa@redhat.com
Signed-off-by: Jiri Olsa <jolsa@redhat.com >
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2012-02-13 23:27:15 -02:00
Jiri Olsa
2837609fef
perf tools: Remove unused functions from debugfs object
...
Following debugfs object functions are not referenced
within the code:
int debugfs_valid_entry(const char *path);
int debugfs_umount(void);
int debugfs_write(const char *entry, const char *value);
int debugfs_read(const char *entry, char *buffer, size_t size);
void debugfs_force_cleanup(void);
int debugfs_make_path(const char *element, char *buffer, int size);
Removing them.
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com >
Cc: Ingo Molnar <mingo@elte.hu >
Cc: Paul Mackerras <paulus@samba.org >
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl >
Link: http://lkml.kernel.org/r/1327674868-10486-3-git-send-email-jolsa@redhat.com
Signed-off-by: Jiri Olsa <jolsa@redhat.com >
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2012-02-13 23:25:38 -02:00
Namhyung Kim
e334c726ca
perf tools: Get rid of ctype.h in symbol.c
...
The ctype.h in symbol.c was needed because of isupper(). However we now
have it in util.h, it can be changed to use our implementation.
Cc: Ingo Molnar <mingo@elte.hu >
Cc: Namhyung Kim <namhyung@gmail.com >
Cc: Paul Mackerras <paulus@samba.org >
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl >
Link: http://lkml.kernel.org/r/1328836217-9118-3-git-send-email-namhyung.kim@lge.com
Signed-off-by: Namhyung Kim <namhyung.kim@lge.com >
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2012-02-13 23:22:50 -02:00
Namhyung Kim
3bd2b8d109
perf tools: ctype.c only wants util.h
...
The implementation of sane ctype macros only depends on symbols in
util.h not cache.h.
Cc: Ingo Molnar <mingo@elte.hu >
Cc: Namhyung Kim <namhyung@gmail.com >
Cc: Paul Mackerras <paulus@samba.org >
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl >
Link: http://lkml.kernel.org/r/1328836217-9118-2-git-send-email-namhyung.kim@lge.com
Signed-off-by: Namhyung Kim <namhyung.kim@lge.com >
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2012-02-13 23:17:40 -02:00
Namhyung Kim
2cd13b0f7d
perf tools: Implement islower/isupper macro into util.h
...
The util.h header provides various ctype macros but lacks those two.
Add them.
Cc: Ingo Molnar <mingo@elte.hu >
Cc: Namhyung Kim <namhyung@gmail.com >
Cc: Paul Mackerras <paulus@samba.org >
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl >
Link: http://lkml.kernel.org/r/1328836217-9118-1-git-send-email-namhyung.kim@lge.com
Signed-off-by: Namhyung Kim <namhyung.kim@lge.com >
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2012-02-13 23:15:43 -02:00
Joerg Roedel
c4a7dca92b
perf tools: Change perf_guest default back to false
...
Setting perf_guest to true by default makes no sense because the perf
subcommands can not setup guest symbol information and thus not process
and guest samples. The only exception is perf-kvm which changes the
perf_guest value on its own. So change the default for perf_guest back
to false.
Cc: David Ahern <dsahern@gmail.com >
Cc: Ingo Molnar <mingo@elte.hu >
Cc: Jason Wang <jasowang@redhat.com >
Cc: Paul Mackerras <paulus@samba.org >
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl >
Link: http://lkml.kernel.org/r/1328893505-4115-3-git-send-email-joerg.roedel@amd.com
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com >
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2012-02-13 23:14:44 -02:00
Joerg Roedel
0c095715b3
perf top: Don't process samples with no valid machine object
...
The perf sample processing code relies on a valid machine object. Make
sure that this path is only entered when such a object exists.
A counter for samples where no machine object exits is also introduced
to give the user a message about these samples.
Reported-by: David Ahern <dsahern@gmail.com >
Reported-by: Jason Wang <jasowang@redhat.com >
Cc: David Ahern <dsahern@gmail.com >
Cc: Ingo Molnar <mingo@elte.hu >
Cc: Jason Wang <jasowang@redhat.com >
Cc: Paul Mackerras <paulus@samba.org >
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl >
Link: http://lkml.kernel.org/r/1328893505-4115-2-git-send-email-joerg.roedel@amd.com
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com >
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2012-02-13 22:55:58 -02:00
David Ahern
b52956c961
perf tools: Allow multiple threads or processes in record, stat, top
...
Allow a user to collect events for multiple threads or processes
using a comma separated list.
e.g., collect data on a VM and its vhost thread:
perf top -p 21483,21485
perf stat -p 21483,21485 -ddd
perf record -p 21483,21485
or monitoring vcpu threads
perf top -t 21488,21489
perf stat -t 21488,21489 -ddd
perf record -t 21488,21489
Cc: Frederic Weisbecker <fweisbec@gmail.com >
Cc: Ingo Molnar <mingo@elte.hu >
Cc: Paul Mackerras <paulus@samba.org >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Thomas Gleixner <tglx@linutronix.de >
Link: http://lkml.kernel.org/r/1328718772-16688-1-git-send-email-dsahern@gmail.com
Signed-off-by: David Ahern <dsahern@gmail.com >
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2012-02-13 22:54:11 -02:00
David Ahern
eca1c3e3f9
perf tools: Fix out of tree compiles
...
For latest tip/perf/core tree Compiles are failing on:
GEN common-cmds.h
make: *** No rule to make target `../../arch/x86/lib/memset_64.S', needed by `builtin-annotate.o'. Stop.
Resolve by adding memset.* to the tar file.
Cc: Frederic Weisbecker <fweisbec@gmail.com >
Cc: Ingo Molnar <mingo@elte.hu >
Cc: Paul Mackerras <paulus@samba.org >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Thomas Gleixner <tglx@linutronix.de >
Link: http://lkml.kernel.org/r/1329145057-26302-1-git-send-email-dsahern@gmail.com
Signed-off-by: David Ahern <dsahern@gmail.com >
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2012-02-13 22:46:41 -02:00
Namhyung Kim
6a5c13aff4
perf tools: Fix build dependency of perf python extension
...
The perf python extention (perf.so) file lacks its dependencies in the
Makefile so that it cannot be refreshed if one of source files it depends
is changed. Fix it by putting them in a separate file and processing it in
both of Makefile and setup.py.
Reported-by: Arnaldo Carvalho de Melo <acme@redhat.com >
Cc: David Ahern <dsahern@gmail.com >
Cc: Frederic Weisbecker <fweisbec@gmail.com >
Cc: Ingo Molnar <mingo@elte.hu >
Cc: Paul Mackerras <paulus@samba.org >
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl >
Cc: Thomas Gleixner <tglx@linutronix.de >
Link: http://lkml.kernel.org/r/1329043524-12470-1-git-send-email-namhyung@gmail.com
Signed-off-by: Namhyung Kim <namhyung@gmail.com >
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2012-02-13 18:01:25 -02:00
Thomas Meyer
47b0edcb59
tracing/trivial: Use kcalloc instead of kzalloc to allocate array
...
The advantage of kcalloc is, that will prevent integer overflows which could
result from the multiplication of number of elements and size and it is also
a bit nicer to read.
The semantic patch that makes this change is available
in https://lkml.org/lkml/2011/11/25/107
Link: http://lkml.kernel.org/r/1322600880.1534.347.camel@localhost.localdomain
Signed-off-by: Thomas Meyer <thomas@m3y3r.de >
Signed-off-by: Steven Rostedt <rostedt@goodmis.org >
2012-02-13 13:48:11 -05:00
Johannes Berg
9510035849
printk/tracing: Add console output tracing
...
Add a printk.console trace point to record any printk
messages into the trace, regardless of the current
console loglevel. This can help correlate (existing)
printk debugging with other tracing.
Link: http://lkml.kernel.org/r/1322161388.5366.54.camel@jlt3.sipsolutions.net
Acked-by: Frederic Weisbecker <fweisbec@gmail.com >
Cc: Christoph Hellwig <hch@infradead.org >
Cc: Ingo Molnar <mingo@redhat.com >
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl >
Acked-by: Thomas Gleixner <tglx@linutronix.de >
Signed-off-by: Johannes Berg <johannes.berg@intel.com >
Signed-off-by: Steven Rostedt <rostedt@goodmis.org >
2012-02-13 13:46:05 -05:00
Geunsik Lim
cdfb0d30e9
ftrace: Append wakeup_rt description of ftrace doc
...
Append and update the description about wakeup/wakeup_rt usage.
Link: http://lkml.kernel.org/r/1328695537-15081-2-git-send-email-geunsik.lim@gmail.com
Cc: Randy Dunlap <rdunlap@xenotime.net >
Signed-off-by: Geunsik Lim <geunsik.lim@samsung.com >
Signed-off-by: Steven Rostedt <rostedt@goodmis.org >
2012-02-13 09:14:48 -05:00