15 Jul, 2009
1 commit
-
…nel/git/tip/linux-2.6-tip
* 'tracing-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
tracing/function-profiler: do not free per cpu variable stat
tracing/events: Move TRACE_SYSTEM outside of include guard
13 Jul, 2009
1 commit
-
If TRACE_INCLDUE_FILE is defined,
will be included and compiled, otherwise it will beSo TRACE_SYSTEM should be defined outside of #if proctection,
just like TRACE_INCLUDE_FILE.Imaging this scenario:
#include
-> TRACE_SYSTEM == foo
...
#include
-> TRACE_SYSTEM == bar
...
#define CREATE_TRACE_POINTS
#include
-> TRACE_SYSTEM == bar !!!and then bar.h will be included and compiled.
Signed-off-by: Li Zefan
Cc: Steven Rostedt
Cc: Frederic Weisbecker
LKML-Reference:
Signed-off-by: Ingo Molnar
21 Jun, 2009
1 commit
-
Signed-off-by: "Theodore Ts'o"
17 Jun, 2009
2 commits
-
Signed-off-by: "Theodore Ts'o"
-
Signed-off-by: "Theodore Ts'o"
15 Jun, 2009
2 commits
-
This patch fixes the mmap/truncate race that was fixed for delayed
allocation by merging ext4_{journalled,normal,da}_writepage() into
ext4_writepage().Signed-off-by: Aneesh Kumar K.V
Acked-by: Jan Kara
Signed-off-by: "Theodore Ts'o" -
Conflicts:
Documentation/feature-removal-schedule.txt
drivers/scsi/fcoe/fcoe.c
net/core/drop_monitor.c
net/core/net-traces.c
12 Jun, 2009
1 commit
-
* 'for-2.6.31' of git://git.kernel.dk/linux-2.6-block: (153 commits)
block: add request clone interface (v2)
floppy: fix hibernation
ramdisk: remove long-deprecated "ramdisk=" boot-time parameter
fs/bio.c: add missing __user annotation
block: prevent possible io_context->refcount overflow
Add serial number support for virtio_blk, V4a
block: Add missing bounce_pfn stacking and fix comments
Revert "block: Fix bounce limit setting in DM"
cciss: decode unit attention in SCSI error handling code
cciss: Remove no longer needed sendcmd reject processing code
cciss: change SCSI error handling routines to work with interrupts enabled.
cciss: separate error processing and command retrying code in sendcmd_withirq_core()
cciss: factor out fix target status processing code from sendcmd functions
cciss: simplify interface of sendcmd() and sendcmd_withirq()
cciss: factor out core of sendcmd_withirq() for use by SCSI error handling code
cciss: Use schedule_timeout_uninterruptible in SCSI error handling code
block: needs to set the residual length of a bidi request
Revert "block: implement blkdev_readpages"
block: Fix bounce limit setting in DM
Removed reference to non-existing file Documentation/PCI/PCI-DMA-mapping.txt
...Manually fix conflicts with tracing updates in:
block/blk-sysfs.c
drivers/ide/ide-atapi.c
drivers/ide/ide-cd.c
drivers/ide/ide-floppy.c
drivers/ide/ide-tape.c
include/trace/events/block.h
kernel/trace/blktrace.c
11 Jun, 2009
1 commit
-
By moving the macro that creates the print format code above the
defining of the event macro helpers (__get_str, __print_symbolic,
and __get_dynamic_array), we get a little cleaner print format.Instead of:
(char *)((void *)REC + REC->__data_loc_name)
we get:
__get_str(name)
Instead of:
({ static const struct trace_print_flags symbols[] = { { HI_SOFTIRQ, "HI" }, {
we get:
__print_symbolic(REC->vec, { HI_SOFTIRQ, "HI" }, {
Signed-off-by: Steven Rostedt
10 Jun, 2009
2 commits
-
The sector field is either u64 or unsigned long depending on
the arch. This patch casts the sector to unsigned long long to
prevent the printf warnings.[ Impact: remove compile warnings ]
Signed-off-by: Steven Rostedt
-
TRACE_EVENT is a more generic way to define tracepoints. Doing so adds
these new capabilities to this tracepoint:- zero-copy and per-cpu splice() tracing
- binary tracing without printf overhead
- structured logging records exposed under /debug/tracing/events
- trace events embedded in function tracer output and other plugins
- user-defined, per tracepoint filter expressions
...Cons:
- no dev_t info for the output of plug, unplug_timer and unplug_io events.
no dev_t info for getrq and sleeprq events if bio == NULL.
no dev_t info for rq_abort,...,rq_requeue events if rq->rq_disk == NULL.This is mainly because we can't get the deivce from a request queue.
But this may change in the future.- A packet command is converted to a string in TP_assign, not TP_print.
While blktrace do the convertion just before output.Since pc requests should be rather rare, this is not a big issue.
- In blktrace, an event can have 2 different print formats, but a TRACE_EVENT
has a unique format, which means we have some unused data in a trace entry.The overhead is minimized by using __dynamic_array() instead of __array().
I've benchmarked the ioctl blktrace vs the splice based TRACE_EVENT tracing:
dd dd + ioctl blktrace dd + TRACE_EVENT (splice)
1 7.36s, 42.7 MB/s 7.50s, 42.0 MB/s 7.41s, 42.5 MB/s
2 7.43s, 42.3 MB/s 7.48s, 42.1 MB/s 7.43s, 42.4 MB/s
3 7.38s, 42.6 MB/s 7.45s, 42.2 MB/s 7.41s, 42.5 MB/sSo the overhead of tracing is very small, and no regression when using
those trace events vs blktrace.And the binary output of TRACE_EVENT is much smaller than blktrace:
# ls -l -h
-rw-r--r-- 1 root root 8.8M 06-09 13:24 sda.blktrace.0
-rw-r--r-- 1 root root 195K 06-09 13:24 sda.blktrace.1
-rw-r--r-- 1 root root 2.7M 06-09 13:25 trace_splice.outFollowing are some comparisons between TRACE_EVENT and blktrace:
plug:
kjournald-480 [000] 303.084981: block_plug: [kjournald]
kjournald-480 [000] 303.084981: 8,0 P N [kjournald]unplug_io:
kblockd/0-118 [000] 300.052973: block_unplug_io: [kblockd/0] 1
kblockd/0-118 [000] 300.052974: 8,0 U N [kblockd/0] 1remap:
kjournald-480 [000] 303.085042: block_remap: 8,0 W 102736992 + 8 v3:- use the newly introduced __dynamic_array().
Changelog from v1 -> v2:
- use __string() instead of __array() to minimize the memory required
to store hex dump of rq->cmd().- support large pc requests.
- add missing blk_fill_rwbs_rq() in block_rq_requeue TRACE_EVENT.
- some cleanups.
Signed-off-by: Li Zefan
LKML-Reference:
Signed-off-by: Steven Rostedt
05 Jun, 2009
1 commit
-
…/git/rostedt/linux-2.6-trace into tracing/ftrace
04 Jun, 2009
1 commit
-
Merge reason: this mini-topic had outstanding problems that delayed
its merge, so it does not fast-forward.Signed-off-by: Ingo Molnar
03 Jun, 2009
1 commit
-
Here is an updated patch to include the extra call to
trace_seq_init() as requested. This is vs. the latest
-tip tree and fixes the use of multiple __print_flags
and __print_symbolic in a single tracer. Also tested
to ensure its working now:mount.gfs2-2534 [000] 235.850587: gfs2_glock_queue: 8.7 glock 1:2 dequeue PR
mount.gfs2-2534 [000] 235.850591: gfs2_demote_rq: 8.7 glock 1:0 demote EX to NL flags:DI
mount.gfs2-2534 [000] 235.850591: gfs2_glock_queue: 8.7 glock 1:0 dequeue EX
glock_workqueue-2529 [000] 235.850666: gfs2_glock_state_change: 8.7 glock 1:0 state EX => NL tgt:NL dmt:NL flags:lDpI
glock_workqueue-2529 [000] 235.850672: gfs2_glock_put: 8.7 glock 1:0 state NL => IV flags:ISigned-off-by: Steven Whitehouse
LKML-Reference:
Signed-off-by: Steven Rostedt
02 Jun, 2009
5 commits
-
After converting the softirq tracer to use te flags options, this
caused a regression with the name. Since the flag was used directly
it was printed out (i.e. HRTIMER_SOFTIRQ).This patch only shows the softirq name without the SOFTIRQ part.
[ Impact: fix regression of output from softirq events ]
Signed-off-by: Steven Rostedt
-
__string() is limited:
- it's a char array, but we may want to define array with other types
- a source string should be available, but we may just know the string sizeWe introduce __dynamic_array() to break those limitations, and __string()
becomes a wrapper of it. As a side effect, now __get_str() can be used
in TP_fast_assign but not only TP_print.Take XFS for example, we have the string length in the dirent, but the
string itself is not NULL-terminated, so __dynamic_array() can be used:TRACE_EVENT(xfs_dir2,
TP_PROTO(struct xfs_da_args *args),
TP_ARGS(args),TP_STRUCT__entry(
__field(int, namelen)
__dynamic_array(char, name, args->namelen + 1)
...
),TP_fast_assign(
char *name = __get_str(name);if (args->namelen)
memcpy(name, args->name, args->namelen);
name[args->namelen] = '\0';__entry->namelen = args->namelen;
),TP_printk("name %.*s namelen %d",
__entry->namelen ? __get_str(name) : NULL
__entry->namelen)
);[ Impact: allow defining dynamic size arrays ]
Signed-off-by: Li Zefan
LKML-Reference:
Signed-off-by: Steven Rostedt -
Currently TP_fast_assign has a limitation that we can't define local
variables in it.Here's one use case when we introduce __dynamic_array():
TP_fast_assign(
type *p = __get_dynamic_array(item);foo(p);
bar(p);
),[ Impact: allow defining local variables in TP_fast_assign ]
Signed-off-by: Li Zefan
LKML-Reference:
Signed-off-by: Steven Rostedt -
"tsize" should be "\tsize". Also remove the space before "__str_loc".
Before:
# cat tracing/events/irq/irq_handler_entry/format
...
field:int irq; offset:12; size:4;
field: __str_loc name; offset:16;tsize:2;
...After:
# cat tracing/events/irq/irq_handler_entry/format
...
field:int irq; offset:12; size:4;
field:__str_loc name; offset:16; size:2;
...[ Impact: standardize __string field description in events format file ]
Signed-off-by: Li Zefan
Signed-off-by: Frederic Weisbecker
Signed-off-by: Steven Rostedt -
v3: zhaolei@cn.fujitsu.com: Change TRACE_EVENT definition to new format
introduced by Steven Rostedt: consolidate trace and trace_event headers
v2: kosaki@jp.fujitsu.com: print the function names instead of addr, and zap
the work addr
v1: zhaolei@cn.fujitsu.com: Make workqueue tracepoints use TRACE_EVENT macroTRACE_EVENT is a more generic way to define tracepoints.
Doing so adds these new capabilities to the tracepoints:- zero-copy and per-cpu splice() tracing
- binary tracing without printf overhead
- structured logging records exposed under /debug/tracing/events
- trace events embedded in function tracer output and other plugins
- user-defined, per tracepoint filter expressionsThen, this patch converts DEFINE_TRACE to TRACE_EVENT in workqueue related
tracepoints.[ Impact: expand workqueue tracer to events tracing ]
Signed-off-by: Zhao Lei
Cc: Steven Rostedt
Cc: Tom Zanussi
Cc: Oleg Nesterov
Cc: Andrew Morton
Signed-off-by: KOSAKI Motohiro
Signed-off-by: Frederic Weisbecker
28 May, 2009
1 commit
-
"call" is an argument of macro, but it is also used as a local
variable name of function in macro.
We should keep this local variable name distinct from any
CPP macro parameter name if both are in the same macro scope,
although it hasn't caused any problem yet.[ Impact: robustify macro ]
Signed-off-by: Zhao Lei
Acked-by: Steven Rostedt
Signed-off-by: Frederic Weisbecker
27 May, 2009
5 commits
-
The recording of the names at trace time is inefficient. This patch
implements the softirq event recording to only record the vector
and then use the __print_symbolic interface to print out the names.[ Impact: faster recording of softirq events ]
Signed-off-by: Steven Rostedt
Signed-off-by: Frederic Weisbecker -
This patch adds __print_symbolic which is similar to __print_flags but
works for an enumeration type instead. That is, there is only a one to one
mapping between the values and the symbols. When a match is made, then
it is printed, otherwise the hex value is outputed.[ Impact: add interface for showing symbol names in events ]
Signed-off-by: Steven Rostedt
Signed-off-by: Frederic Weisbecker -
This patch changes the output for gfp_flags from being a simple hex value
to the actual names.gfp_flags=GFP_ATOMIC instead of gfp_flags=00000020
And even
gfp_flags=GFP_KERNEL instead of gfp_flags=000000d0
(Thanks to Frederic Weisbecker for pointing out that the first version
had a bad order of GFP masks)[ Impact: more human readable output from tracer ]
Acked-by: Eduard - Gabriel Munteanu
Signed-off-by: Steven Rostedt
Signed-off-by: Frederic Weisbecker -
It is useful to see the state of a task that is being switched out.
This patch adds the output of the state of the previous task in
the context switch event.[ Impact: see state of switched out task in context switch ]
Signed-off-by: Steven Rostedt
Signed-off-by: Frederic Weisbecker -
Developers have been asking for the ability in the ftrace event tracer
to display names of bits in a flags variable.Instead of printing out c2, it would be easier to read FOO|BAR|GOO,
assuming that FOO is bit 1, BAR is bit 6 and GOO is bit 7.Some examples where this would be useful are the state flags in a context
switch, kmalloc flags, and even permision flags in accessing files.[
v2 changes include:Frederic Weisbecker's idea of using a mask instead of bits,
thus we can output GFP_KERNEL instead of GPF_WAIT|GFP_IO|GFP_FS.Li Zefan's idea of allowing the caller of __print_flags to add their
own delimiter (or no delimiter) where we can get for file permissions
rwx instead of r|w|x.
][
v3 changes:Christoph Hellwig's idea of using an array instead of va_args.
][ Impact: better displaying of flags in trace output ]
Signed-off-by: Steven Rostedt
Signed-off-by: Frederic Weisbecker
26 May, 2009
1 commit
-
When defining a dynamic size string, we add __str_loc_##item to the
trace entry, and it stores the location of the actual string in
entry->_str_data[]'unsigned short' should be sufficient to store this information, thus
we save 2 bytes per dyn-size string in the ring buffer.[ Impact: reduce memory occupied by dyn-size strings in ring buffer ]
Signed-off-by: Li Zefan
Cc: Steven Rostedt
LKML-Reference:
Signed-off-by: Frederic Weisbecker
22 May, 2009
1 commit
-
Patch to add the ability to detect drops in hardware interfaces via dropwatch.
Adds a tracepoint to net_rx_action to signal everytime a napi instance is
polled. The dropmon code then periodically checks to see if the rx_frames
counter has changed, and if so, adds a drop notification to the netlink
protocol, using the reserved all-0's vector to indicate the drop location was in
hardware, rather than somewhere in the code.Signed-off-by: Neil Horman
include/linux/net_dropmon.h | 8 ++
include/trace/napi.h | 11 +++
net/core/dev.c | 5 +
net/core/drop_monitor.c | 124 ++++++++++++++++++++++++++++++++++++++++++--
net/core/net-traces.c | 4 +
net/core/netpoll.c | 2
6 files changed, 149 insertions(+), 5 deletions(-)
Signed-off-by: David S. Miller
11 May, 2009
1 commit
-
The last argument of block_remap prober is the original sector
before remap, so it should be 'from', not 'to'.[ Impact: clean up ]
Signed-off-by: Li Zefan
Cc: "Alan D. Brunelle"
Cc: Jens Axboe
Cc: Arnaldo Carvalho de Melo
Cc: KOSAKI Motohiro
LKML-Reference:
Signed-off-by: Ingo Molnar
06 May, 2009
3 commits
-
Remove redundant from-sector parameter: it's /always/ the bio's sector
passed in.[ Impact: cleanup ]
Signed-off-by: Alan D. Brunelle
Reviewed-by: Li Zefan
Reviewed-by: KOSAKI Motohiro
Cc: Jens Axboe
Cc: Arnaldo Carvalho de Melo
LKML-Reference:
Signed-off-by: Ingo Molnar -
This attempts to clarify names utilized during block I/O remap
operations (partition, volume manager). It correctly matches up the
/from/ information for both device & sector. This takes in the concept
from Kosaki Motohiro and extends it to include better naming for the
"device_from" field.[ Impact: cleanup ]
Signed-off-by: Alan D. Brunelle
Reviewed-by: Li Zefan
Reviewed-by: KOSAKI Motohiro
Cc: Jens Axboe
Cc: Arnaldo Carvalho de Melo
LKML-Reference:
Signed-off-by: Ingo Molnar -
The orig_cpu parameter in trace_sched_migrate_task() is not necessary,
it can be got by using task_cpu(p) in the probe.[ Impact: micro-optimization ]
Signed-off-by: Mathieu Desnoyers
[ modified from Mathieu's patch. The original patch is at:
http://marc.info/?l=linux-kernel&m=123791201716239&w=2 ]
Signed-off-by: Xiao Guangrong
Cc: fweisbec@gmail.com
Cc: rostedt@goodmis.org
Cc: Li Zefan
Cc: zhaolei@cn.fujitsu.com
Cc: laijs@cn.fujitsu.com
LKML-Reference:
Signed-off-by: Ingo Molnar
01 May, 2009
1 commit
-
Document irqs for the newly created docbook.
[ Impact: add documentation ]
Signed-off-by: Jason Baron
Acked-by: Randy Dunlap
Cc: akpm@linux-foundation.org
Cc: rostedt@goodmis.org
Cc: fweisbec@gmail.com
Cc: mathieu.desnoyers@polymtl.ca
Cc: wcohen@redhat.com
LKML-Reference:
Signed-off-by: Ingo Molnar
29 Apr, 2009
1 commit
-
The new filter comparison ops need to be able to distinguish between
signed and unsigned field types, so add an is_signed flag/param to the
event field struct/trace_define_fields(). Also define a simple macro,
is_signed_type() to determine the signedness at compile time, used in the
trace macros. If the is_signed_type() macro won't work with a specific
type, a new slightly modified version of TRACE_FIELD() called
TRACE_FIELD_SIGN(), allows the signedness to be set explicitly.[ Impact: extend trace-filter code for new feature ]
Signed-off-by: Tom Zanussi
Acked-by: Steven Rostedt
Cc: fweisbec@gmail.com
Cc: Li Zefan
LKML-Reference:
Signed-off-by: Ingo Molnar
24 Apr, 2009
4 commits
-
The TRACE_FORMAT macro has been deprecated by the TRACE_EVENT macro.
There are no more users. All new users must use the TRACE_EVENT macro.[ Impact: remove old functionality ]
Cc: Peter Zijlstra
Signed-off-by: Steven Rostedt -
The TRACE_FORMAT will soon be deprecated. This patch converts it to
the TRACE_EVENT macro.Note, this change should also speed up the tracing.
[ Impact: remove a user of deprecated TRACE_FORMAT ]
Cc: Jason Baron
Signed-off-by: Steven Rostedt -
The TRACE_FORMAT will soon be deprecated. This patch converts it to
the TRACE_EVENT macro.Note, this change should also speed up the tracing.
[ Impact: remove a user of deprecated TRACE_FORMAT ]
Cc: Peter Zijlstra
Signed-off-by: Steven Rostedt -
In case a module uses the TRACE_EVENT macro for creating automated
events in ftrace, it may choose to use a different file name
than the defined system name, or choose to use a different path than
the default "include/trace/events" include path.If this is done, then before including trace/define_trace.h the
header would define either "TRACE_INCLUDE_FILE" for the file
name or "TRACE_INCLUDE_PATH" for the include path.If it does not define these, then the define_trace.h defines them
instead. If define trace defines them, then define_trace.h should
also undefine them before exiting. To do this a macro is used
to note this:#ifndef TRACE_INCLUDE_FILE
# define TRACE_INCLUDE_FILE TRACE_SYSTEM
# define UNDEF_TRACE_INCLUDE_FILE
#endif[...]
#ifdef UNDEF_TRACE_INCLUDE_FILE
# undef TRACE_INCLUDE_FILE
# undef UNDEF_TRACE_INCLUDE_FILE
#endifThe UNDEF_TRACE_INCLUDE_FILE acts as a CPP variable to know to undef
the TRACE_INCLUDE_FILE before leaving define_trace.h.Unfortunately, due to cut and paste errors, the macros between
FILE and PATH got mixed up.[ Impact: undef TRACE_INCLUDE_FILE and/or TRACE_INCLUDE_PATH when needed ]
Signed-off-by: Steven Rostedt
22 Apr, 2009
3 commits
-
The __get_str() macro is used in a code part then its content should be
protected with parenthesis.[ Impact: make macro definition more robust ]
Reported-by: Steven Rostedt
Signed-off-by: Frederic Weisbecker -
Now that we can support the dynamic sized string, make the lock tracing
able to use it, making it safe against modules removal and consuming
the right amount of memory needed for each lock nameChanges in v2:
adapt to the __ending_string() updates and the opening_string() removal.[ Impact: protect lock tracer against module removal ]
Signed-off-by: Frederic Weisbecker
Cc: Peter Zijlstra
Cc: Steven Rostedt -
This patch provides the support for dynamic size strings on
event tracing.The key concept is to use a structure with an ending char array field of
undefined size and use such ability to allocate the minimal size on the
ring buffer to make one or more string entries fit inside, as opposite
to a fixed length strings with upper bound.The strings themselves are represented using fields which have an offset
value from the beginning of the entry.This patch provides three new macros:
__string(item, src)
This one declares a string to the structure inside TP_STRUCT__entry.
You need to provide the name of the string field and the source that will
be copied inside.
This will also add the dynamic size of the string needed for the ring
buffer entry allocation.
A stack allocated structure is used to temporarily store the offset
of each strings, avoiding double calls to strlen() on each event
insertion.__get_str(field)
This one will give you a pointer to the string you have created. This
is an abstract helper to resolve the absolute address given the field
name which is a relative address from the beginning of the trace_structure.__assign_str(dst, src)
Use this macro to automatically perform the string copy from src to
dst. src must be a variable to assign and dst is the name of a __string
field.Example on how to use it:
TRACE_EVENT(my_event,
TP_PROTO(char *src1, char *src2),TP_ARGS(src1, src2),
TP_STRUCT__entry(
__string(str1, src1)
__string(str2, src2)
),
TP_fast_assign(
__assign_str(str1, src1);
__assign_str(str2, src2);
),
TP_printk("%s %s", __get_str(src1), __get_str(src2))
)Of course you can mix-up any __field or __array inside this
TRACE_EVENT. The position of the __string or __assign_str
doesn't matter.Changes in v2:
Address the suggestion of Steven Rostedt: drop the opening_string() macro
and redefine __ending_string() to get the size of the string to be copied
instead of overwritting the whole ring buffer allocation.Changes in v3:
Address other suggestions of Steven Rostedt and Peter Zijlstra with
some changes: drop the __ending_string and the need to have only one
string field.
Use offsets instead of absolute addresses.[ Impact: allow more compact memory usage for string tracing ]
Signed-off-by: Frederic Weisbecker
Cc: Steven Rostedt
Cc: Li Zefan
Cc: Peter Zijlstra