From: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Christoph Hellwig <hch@infradead.org>,
Andi Kleen <andi@firstfloor.org>,
linux-kernel@vger.kernel.org, rusty@rustcorp.com.au,
wfg@ustc.edu
Subject: Re: 2.6.22 -mm merge plans
Date: Thu, 3 May 2007 11:04:15 -0400 [thread overview]
Message-ID: <20070503150415.GC26864@Krystal> (raw)
In-Reply-To: <20070502162135.f949e371.akpm@linux-foundation.org>
* Andrew Morton (akpm@linux-foundation.org) wrote:
> > Although some, like Christoph and myself, think that it would benefit to
> > the kernel community to have a common infrastructure for more than just
> > markers (meaning common serialization and buffering mechanism), it does
> > not change the fact that the markers, being in mainline, are usable by
> > projects through additional kernel modules.
> >
> > If we are looking at current "potential users" that are already in
> > mainline, we could change blktrace to make it use the markers.
>
> That'd be a useful demonstration.
Here is a proof of concept patch, for demonstration purpose, of moving
blktrace to the markers.
A few remarks : this patch has the positive effect of removing some code
from the block io tracing hot paths, minimizing the i-cache impact in a
system where the io tracing is compiled in but inactive.
It also moves the blk tracing code from a header (and therefore from the
body of the instrumented functions) to a separate C file.
There, as soon as one device has to be traced, every devices have to
fall into the tracing function call. This is slower than the previous
inline function which tested the condition quickly. If it becomes a
show stopper, it could be fixed by having the possibility to test a
supplementary condition, dependant of the marker context, at the marker
site, just after the enable/disable test.
It does not make the code smaller, since I left all the specialized
tracing functions for requests, bio, generic, remap, which would go away
once a generic infrastructure is in place to serialize the information
passed to the marker. This is mostly why I consider it a proof a
concept.
Patch named "markers-port-blktrace-to-markers.patch", can be placed
after the marker patches in the 2.6.21-rc7-mm2 series.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Index: linux-2.6-lttng/block/elevator.c
===================================================================
--- linux-2.6-lttng.orig/block/elevator.c 2007-05-02 20:33:22.000000000 -0400
+++ linux-2.6-lttng/block/elevator.c 2007-05-02 20:33:49.000000000 -0400
@@ -32,7 +32,7 @@
#include <linux/init.h>
#include <linux/compiler.h>
#include <linux/delay.h>
-#include <linux/blktrace_api.h>
+#include <linux/marker.h>
#include <linux/hash.h>
#include <asm/uaccess.h>
@@ -571,7 +571,7 @@
unsigned ordseq;
int unplug_it = 1;
- blk_add_trace_rq(q, rq, BLK_TA_INSERT);
+ MARK(blk_request_insert, "%p %p", q, rq);
rq->q = q;
@@ -757,7 +757,7 @@
* not be passed by new incoming requests
*/
rq->cmd_flags |= REQ_STARTED;
- blk_add_trace_rq(q, rq, BLK_TA_ISSUE);
+ MARK(blk_request_issue, "%p %p", q, rq);
}
if (!q->boundary_rq || q->boundary_rq == rq) {
Index: linux-2.6-lttng/block/ll_rw_blk.c
===================================================================
--- linux-2.6-lttng.orig/block/ll_rw_blk.c 2007-05-02 20:33:32.000000000 -0400
+++ linux-2.6-lttng/block/ll_rw_blk.c 2007-05-02 23:21:02.000000000 -0400
@@ -28,6 +28,7 @@
#include <linux/task_io_accounting_ops.h>
#include <linux/interrupt.h>
#include <linux/cpu.h>
+#include <linux/marker.h>
#include <linux/blktrace_api.h>
#include <linux/fault-inject.h>
@@ -1551,7 +1552,7 @@
if (!test_and_set_bit(QUEUE_FLAG_PLUGGED, &q->queue_flags)) {
mod_timer(&q->unplug_timer, jiffies + q->unplug_delay);
- blk_add_trace_generic(q, NULL, 0, BLK_TA_PLUG);
+ MARK(blk_plug_device, "%p %p %d", q, NULL, 0);
}
}
@@ -1617,7 +1618,7 @@
* devices don't necessarily have an ->unplug_fn defined
*/
if (q->unplug_fn) {
- blk_add_trace_pdu_int(q, BLK_TA_UNPLUG_IO, NULL,
+ MARK(blk_pdu_unplug_io, "%p %p %d", q, NULL,
q->rq.count[READ] + q->rq.count[WRITE]);
q->unplug_fn(q);
@@ -1628,7 +1629,7 @@
{
request_queue_t *q = container_of(work, request_queue_t, unplug_work);
- blk_add_trace_pdu_int(q, BLK_TA_UNPLUG_IO, NULL,
+ MARK(blk_pdu_unplug_io, "%p %p %d", q, NULL,
q->rq.count[READ] + q->rq.count[WRITE]);
q->unplug_fn(q);
@@ -1638,7 +1639,7 @@
{
request_queue_t *q = (request_queue_t *)data;
- blk_add_trace_pdu_int(q, BLK_TA_UNPLUG_TIMER, NULL,
+ MARK(blk_pdu_unplug_timer, "%p %p %d", q, NULL,
q->rq.count[READ] + q->rq.count[WRITE]);
kblockd_schedule_work(&q->unplug_work);
@@ -2148,7 +2149,7 @@
rq_init(q, rq);
- blk_add_trace_generic(q, bio, rw, BLK_TA_GETRQ);
+ MARK(blk_get_request, "%p %p %d", q, bio, rw);
out:
return rq;
}
@@ -2178,7 +2179,7 @@
if (!rq) {
struct io_context *ioc;
- blk_add_trace_generic(q, bio, rw, BLK_TA_SLEEPRQ);
+ MARK(blk_sleep_request, "%p %p %d", q, bio, rw);
__generic_unplug_device(q);
spin_unlock_irq(q->queue_lock);
@@ -2252,7 +2253,7 @@
*/
void blk_requeue_request(request_queue_t *q, struct request *rq)
{
- blk_add_trace_rq(q, rq, BLK_TA_REQUEUE);
+ MARK(blk_requeue, "%p %p", q, rq);
if (blk_rq_tagged(rq))
blk_queue_end_tag(q, rq);
@@ -2937,7 +2938,7 @@
if (!ll_back_merge_fn(q, req, bio))
break;
- blk_add_trace_bio(q, bio, BLK_TA_BACKMERGE);
+ MARK(blk_bio_backmerge, "%p %p", q, bio);
req->biotail->bi_next = bio;
req->biotail = bio;
@@ -2954,7 +2955,7 @@
if (!ll_front_merge_fn(q, req, bio))
break;
- blk_add_trace_bio(q, bio, BLK_TA_FRONTMERGE);
+ MARK(blk_bio_frontmerge, "%p %p", q, bio);
bio->bi_next = req->bio;
req->bio = bio;
@@ -3184,10 +3185,10 @@
blk_partition_remap(bio);
if (old_sector != -1)
- blk_add_trace_remap(q, bio, old_dev, bio->bi_sector,
- old_sector);
+ MARK(blk_remap, "%p %p %u %llu %llu", q, bio, old_dev,
+ (u64)bio->bi_sector, (u64)old_sector);
- blk_add_trace_bio(q, bio, BLK_TA_QUEUE);
+ MARK(blk_bio_queue, "%p %p", q, bio);
old_sector = bio->bi_sector;
old_dev = bio->bi_bdev->bd_dev;
@@ -3329,7 +3330,7 @@
int total_bytes, bio_nbytes, error, next_idx = 0;
struct bio *bio;
- blk_add_trace_rq(req->q, req, BLK_TA_COMPLETE);
+ MARK(blk_request_complete, "%p %p", req->q, req);
/*
* extend uptodate bool to allow < 0 value to be direct io error
Index: linux-2.6-lttng/block/Kconfig
===================================================================
--- linux-2.6-lttng.orig/block/Kconfig 2007-05-02 20:34:30.000000000 -0400
+++ linux-2.6-lttng/block/Kconfig 2007-05-02 20:34:53.000000000 -0400
@@ -32,6 +32,7 @@
depends on SYSFS
select RELAY
select DEBUG_FS
+ select MARKERS
help
Say Y here, if you want to be able to trace the block layer actions
on a given queue. Tracing allows you to see any traffic happening
Index: linux-2.6-lttng/block/Makefile
===================================================================
--- linux-2.6-lttng.orig/block/Makefile 2007-05-02 21:20:30.000000000 -0400
+++ linux-2.6-lttng/block/Makefile 2007-05-02 21:20:46.000000000 -0400
@@ -9,4 +9,4 @@
obj-$(CONFIG_IOSCHED_DEADLINE) += deadline-iosched.o
obj-$(CONFIG_IOSCHED_CFQ) += cfq-iosched.o
-obj-$(CONFIG_BLK_DEV_IO_TRACE) += blktrace.o
+obj-$(CONFIG_BLK_DEV_IO_TRACE) += blktrace.o blk-probe.o
Index: linux-2.6-lttng/block/blk-probe.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ linux-2.6-lttng/block/blk-probe.c 2007-05-02 23:43:44.000000000 -0400
@@ -0,0 +1,276 @@
+
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/crc32.h>
+#include <linux/marker.h>
+#include <linux/blktrace_api.h>
+
+
+/**
+ * blk_add_trace_rq - Add a trace for a request oriented action
+ * Expected variable arguments :
+ * @q: queue the io is for
+ * @rq: the source request
+ *
+ * Description:
+ * Records an action against a request. Will log the bio offset + size.
+ *
+ **/
+static void blk_add_trace_rq(const struct __mark_marker_data *mdata,
+ const char *fmt, ...)
+{
+ va_list args;
+ u32 what;
+ struct blk_trace *bt;
+ int rw;
+ struct blk_probe_data *pinfo = mdata->pdata;
+ struct request_queue *q;
+ struct request *rq;
+
+ va_start(args, fmt);
+ q = va_arg(args, struct request_queue *);
+ rq = va_arg(args, struct request *);
+ va_end(args);
+
+ what = pinfo->flags;
+ bt = q->blk_trace;
+ rw = rq->cmd_flags & 0x03;
+
+ if (likely(!bt))
+ return;
+
+ if (blk_pc_request(rq)) {
+ what |= BLK_TC_ACT(BLK_TC_PC);
+ __blk_add_trace(bt, 0, rq->data_len, rw, what, rq->errors, sizeof(rq->cmd), rq->cmd);
+ } else {
+ what |= BLK_TC_ACT(BLK_TC_FS);
+ __blk_add_trace(bt, rq->hard_sector, rq->hard_nr_sectors << 9, rw, what, rq->errors, 0, NULL);
+ }
+}
+
+/**
+ * blk_add_trace_bio - Add a trace for a bio oriented action
+ * Expected variable arguments :
+ * @q: queue the io is for
+ * @bio: the source bio
+ *
+ * Description:
+ * Records an action against a bio. Will log the bio offset + size.
+ *
+ **/
+static void blk_add_trace_bio(const struct __mark_marker_data *mdata,
+ const char *fmt, ...)
+{
+ va_list args;
+ u32 what;
+ struct blk_trace *bt;
+ struct blk_probe_data *pinfo = mdata->pdata;
+ struct request_queue *q;
+ struct bio *bio;
+
+ va_start(args, fmt);
+ q = va_arg(args, struct request_queue *);
+ bio = va_arg(args, struct bio *);
+ va_end(args);
+
+ what = pinfo->flags;
+ bt = q->blk_trace;
+
+ if (likely(!bt))
+ return;
+
+ __blk_add_trace(bt, bio->bi_sector, bio->bi_size, bio->bi_rw, what, !bio_flagged(bio, BIO_UPTODATE), 0, NULL);
+}
+
+/**
+ * blk_add_trace_generic - Add a trace for a generic action
+ * Expected variable arguments :
+ * @q: queue the io is for
+ * @bio: the source bio
+ * @rw: the data direction
+ *
+ * Description:
+ * Records a simple trace
+ *
+ **/
+static void blk_add_trace_generic(const struct __mark_marker_data *mdata,
+ const char *fmt, ...)
+{
+ va_list args;
+ struct blk_trace *bt;
+ u32 what;
+ struct blk_probe_data *pinfo = mdata->pdata;
+ struct request_queue *q;
+ struct bio *bio;
+ int rw;
+
+ va_start(args, fmt);
+ q = va_arg(args, struct request_queue *);
+ bio = va_arg(args, struct bio *);
+ rw = va_arg(args, int);
+ va_end(args);
+
+ what = pinfo->flags;
+ bt = q->blk_trace;
+
+ if (likely(!bt))
+ return;
+
+ if (bio)
+ blk_add_trace_bio(mdata, "%p %p", q, bio);
+ else
+ __blk_add_trace(bt, 0, 0, rw, what, 0, 0, NULL);
+}
+
+/**
+ * blk_add_trace_pdu_int - Add a trace for a bio with an integer payload
+ * Expected variable arguments :
+ * @q: queue the io is for
+ * @bio: the source bio
+ * @pdu: the integer payload
+ *
+ * Description:
+ * Adds a trace with some integer payload. This might be an unplug
+ * option given as the action, with the depth at unplug time given
+ * as the payload
+ *
+ **/
+static void blk_add_trace_pdu_int(const struct __mark_marker_data *mdata,
+ const char *fmt, ...)
+{
+ va_list args;
+ struct blk_trace *bt;
+ u32 what;
+ struct blk_probe_data *pinfo = mdata->pdata;
+ struct request_queue *q;
+ struct bio *bio;
+ unsigned int pdu;
+ __be64 rpdu;
+
+ va_start(args, fmt);
+ q = va_arg(args, struct request_queue *);
+ bio = va_arg(args, struct bio *);
+ pdu = va_arg(args, unsigned int);
+ va_end(args);
+
+ what = pinfo->flags;
+ bt = q->blk_trace;
+ rpdu = cpu_to_be64(pdu);
+
+ if (likely(!bt))
+ return;
+
+ if (bio)
+ __blk_add_trace(bt, bio->bi_sector, bio->bi_size, bio->bi_rw, what, !bio_flagged(bio, BIO_UPTODATE), sizeof(rpdu), &rpdu);
+ else
+ __blk_add_trace(bt, 0, 0, 0, what, 0, sizeof(rpdu), &rpdu);
+}
+
+/**
+ * blk_add_trace_remap - Add a trace for a remap operation
+ * Expected variable arguments :
+ * @q: queue the io is for
+ * @bio: the source bio
+ * @dev: target device
+ * @from: source sector
+ * @to: target sector
+ *
+ * Description:
+ * Device mapper or raid target sometimes need to split a bio because
+ * it spans a stripe (or similar). Add a trace for that action.
+ *
+ **/
+static void blk_add_trace_remap(const struct __mark_marker_data *mdata,
+ const char *fmt, ...)
+{
+ va_list args;
+ struct blk_trace *bt;
+ struct blk_io_trace_remap r;
+ u32 what;
+ struct blk_probe_data *pinfo = mdata->pdata;
+ struct request_queue *q;
+ struct bio *bio;
+ u64 dev, from, to;
+
+ va_start(args, fmt);
+ q = va_arg(args, struct request_queue *);
+ bio = va_arg(args, struct bio *);
+ dev = va_arg(args, u64);
+ from = va_arg(args, u64);
+ to = va_arg(args, u64);
+ va_end(args);
+
+ what = pinfo->flags;
+ bt = q->blk_trace;
+
+ if (likely(!bt))
+ return;
+
+ r.device = cpu_to_be32(dev);
+ r.sector = cpu_to_be64(to);
+
+ __blk_add_trace(bt, from, bio->bi_size, bio->bi_rw, BLK_TA_REMAP, !bio_flagged(bio, BIO_UPTODATE), sizeof(r), &r);
+}
+
+#define FACILITY_NAME "blk"
+
+static struct blk_probe_data probe_array[] =
+{
+ { "blk_bio_queue", "%p %p", BLK_TA_QUEUE, blk_add_trace_bio },
+ { "blk_bio_backmerge", "%p %p", BLK_TA_BACKMERGE, blk_add_trace_bio },
+ { "blk_bio_frontmerge", "%p %p", BLK_TA_FRONTMERGE, blk_add_trace_bio },
+ { "blk_get_request", "%p %p %d", BLK_TA_GETRQ, blk_add_trace_generic },
+ { "blk_sleep_request", "%p %p %d", BLK_TA_SLEEPRQ,
+ blk_add_trace_generic },
+ { "blk_requeue", "%p %p", BLK_TA_REQUEUE, blk_add_trace_rq },
+ { "blk_request_issue", "%p %p", BLK_TA_ISSUE, blk_add_trace_rq },
+ { "blk_request_complete", "%p %p", BLK_TA_COMPLETE, blk_add_trace_rq },
+ { "blk_plug_device", "%p %p %d", BLK_TA_PLUG, blk_add_trace_generic },
+ { "blk_pdu_unplug_io", "%p %p %d", BLK_TA_UNPLUG_IO,
+ blk_add_trace_pdu_int },
+ { "blk_pdu_unplug_timer", "%p %p %d", BLK_TA_UNPLUG_TIMER,
+ blk_add_trace_pdu_int },
+ { "blk_request_insert", "%p %p", BLK_TA_INSERT,
+ blk_add_trace_rq },
+ { "blk_pdu_split", "%p %p %d", BLK_TA_SPLIT,
+ blk_add_trace_pdu_int },
+ { "blk_bio_bounce", "%p %p", BLK_TA_BOUNCE, blk_add_trace_bio },
+ { "blk_remap", "%p %p %u %llu %llu", BLK_TA_REMAP,
+ blk_add_trace_remap },
+};
+
+
+#define NUM_PROBES ARRAY_SIZE(probe_array)
+
+int blk_probe_connect(void)
+{
+ int result;
+ uint8_t i;
+
+ for (i = 0; i < NUM_PROBES; i++) {
+ result = marker_set_probe(probe_array[i].name,
+ probe_array[i].format,
+ probe_array[i].callback, &probe_array[i]);
+ if (!result)
+ printk(KERN_INFO
+ "blktrace unable to register probe %s\n",
+ probe_array[i].name);
+ }
+ return 0;
+}
+EXPORT_SYMBOL_GPL(blk_probe_connect);
+
+void blk_probe_disconnect(void)
+{
+ uint8_t i;
+
+ for (i = 0; i < NUM_PROBES; i++) {
+ marker_remove_probe(probe_array[i].name);
+ }
+ synchronize_sched(); /* Wait for probes to finish */
+}
+EXPORT_SYMBOL_GPL(blk_probe_disconnect);
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Mathieu Desnoyers");
+MODULE_DESCRIPTION(FACILITY_NAME " probe");
Index: linux-2.6-lttng/block/blktrace.c
===================================================================
--- linux-2.6-lttng.orig/block/blktrace.c 2007-05-02 20:33:15.000000000 -0400
+++ linux-2.6-lttng/block/blktrace.c 2007-05-02 23:48:32.000000000 -0400
@@ -28,6 +28,10 @@
static DEFINE_PER_CPU(unsigned long long, blk_trace_cpu_offset) = { 0, };
static unsigned int blktrace_seq __read_mostly = 1;
+/* Global reference count of probes */
+static struct mutex blk_probe_mutex;
+static int blk_probes_ref = 0;
+
/*
* Send out a notify message.
*/
@@ -229,6 +233,12 @@
blk_remove_tree(bt->dir);
free_percpu(bt->sequence);
kfree(bt);
+ mutex_lock(&blk_probe_mutex);
+ if (blk_probes_ref == 1) {
+ blk_probe_disconnect();
+ blk_probes_ref--;
+ }
+ mutex_unlock(&blk_probe_mutex);
}
static int blk_trace_remove(request_queue_t *q)
@@ -386,6 +396,14 @@
goto err;
}
+ /* Connect probes to markers */
+ mutex_lock(&blk_probe_mutex);
+ if (!blk_probes_ref) {
+ blk_probe_connect();
+ blk_probes_ref++;
+ }
+ mutex_unlock(&blk_probe_mutex);
+
return 0;
err:
if (dir)
@@ -552,6 +570,7 @@
static __init int blk_trace_init(void)
{
mutex_init(&blk_tree_mutex);
+ mutex_init(&blk_probe_mutex);
on_each_cpu(blk_trace_check_cpu_time, NULL, 1, 1);
blk_trace_set_ht_offsets();
Index: linux-2.6-lttng/include/linux/blktrace_api.h
===================================================================
--- linux-2.6-lttng.orig/include/linux/blktrace_api.h 2007-05-02 20:45:58.000000000 -0400
+++ linux-2.6-lttng/include/linux/blktrace_api.h 2007-05-02 22:12:46.000000000 -0400
@@ -3,6 +3,7 @@
#include <linux/blkdev.h>
#include <linux/relay.h>
+#include <linux/marker.h>
/*
* Trace categories
@@ -142,149 +143,24 @@
u32 pid;
};
+/* Probe data used for probe-marker connection */
+struct blk_probe_data {
+ const char *name;
+ const char *format;
+ u32 flags;
+ marker_probe_func *callback;
+};
+
#if defined(CONFIG_BLK_DEV_IO_TRACE)
extern int blk_trace_ioctl(struct block_device *, unsigned, char __user *);
extern void blk_trace_shutdown(request_queue_t *);
extern void __blk_add_trace(struct blk_trace *, sector_t, int, int, u32, int, int, void *);
-
-/**
- * blk_add_trace_rq - Add a trace for a request oriented action
- * @q: queue the io is for
- * @rq: the source request
- * @what: the action
- *
- * Description:
- * Records an action against a request. Will log the bio offset + size.
- *
- **/
-static inline void blk_add_trace_rq(struct request_queue *q, struct request *rq,
- u32 what)
-{
- struct blk_trace *bt = q->blk_trace;
- int rw = rq->cmd_flags & 0x03;
-
- if (likely(!bt))
- return;
-
- if (blk_pc_request(rq)) {
- what |= BLK_TC_ACT(BLK_TC_PC);
- __blk_add_trace(bt, 0, rq->data_len, rw, what, rq->errors, sizeof(rq->cmd), rq->cmd);
- } else {
- what |= BLK_TC_ACT(BLK_TC_FS);
- __blk_add_trace(bt, rq->hard_sector, rq->hard_nr_sectors << 9, rw, what, rq->errors, 0, NULL);
- }
-}
-
-/**
- * blk_add_trace_bio - Add a trace for a bio oriented action
- * @q: queue the io is for
- * @bio: the source bio
- * @what: the action
- *
- * Description:
- * Records an action against a bio. Will log the bio offset + size.
- *
- **/
-static inline void blk_add_trace_bio(struct request_queue *q, struct bio *bio,
- u32 what)
-{
- struct blk_trace *bt = q->blk_trace;
-
- if (likely(!bt))
- return;
-
- __blk_add_trace(bt, bio->bi_sector, bio->bi_size, bio->bi_rw, what, !bio_flagged(bio, BIO_UPTODATE), 0, NULL);
-}
-
-/**
- * blk_add_trace_generic - Add a trace for a generic action
- * @q: queue the io is for
- * @bio: the source bio
- * @rw: the data direction
- * @what: the action
- *
- * Description:
- * Records a simple trace
- *
- **/
-static inline void blk_add_trace_generic(struct request_queue *q,
- struct bio *bio, int rw, u32 what)
-{
- struct blk_trace *bt = q->blk_trace;
-
- if (likely(!bt))
- return;
-
- if (bio)
- blk_add_trace_bio(q, bio, what);
- else
- __blk_add_trace(bt, 0, 0, rw, what, 0, 0, NULL);
-}
-
-/**
- * blk_add_trace_pdu_int - Add a trace for a bio with an integer payload
- * @q: queue the io is for
- * @what: the action
- * @bio: the source bio
- * @pdu: the integer payload
- *
- * Description:
- * Adds a trace with some integer payload. This might be an unplug
- * option given as the action, with the depth at unplug time given
- * as the payload
- *
- **/
-static inline void blk_add_trace_pdu_int(struct request_queue *q, u32 what,
- struct bio *bio, unsigned int pdu)
-{
- struct blk_trace *bt = q->blk_trace;
- __be64 rpdu = cpu_to_be64(pdu);
-
- if (likely(!bt))
- return;
-
- if (bio)
- __blk_add_trace(bt, bio->bi_sector, bio->bi_size, bio->bi_rw, what, !bio_flagged(bio, BIO_UPTODATE), sizeof(rpdu), &rpdu);
- else
- __blk_add_trace(bt, 0, 0, 0, what, 0, sizeof(rpdu), &rpdu);
-}
-
-/**
- * blk_add_trace_remap - Add a trace for a remap operation
- * @q: queue the io is for
- * @bio: the source bio
- * @dev: target device
- * @from: source sector
- * @to: target sector
- *
- * Description:
- * Device mapper or raid target sometimes need to split a bio because
- * it spans a stripe (or similar). Add a trace for that action.
- *
- **/
-static inline void blk_add_trace_remap(struct request_queue *q, struct bio *bio,
- dev_t dev, sector_t from, sector_t to)
-{
- struct blk_trace *bt = q->blk_trace;
- struct blk_io_trace_remap r;
-
- if (likely(!bt))
- return;
-
- r.device = cpu_to_be32(dev);
- r.sector = cpu_to_be64(to);
-
- __blk_add_trace(bt, from, bio->bi_size, bio->bi_rw, BLK_TA_REMAP, !bio_flagged(bio, BIO_UPTODATE), sizeof(r), &r);
-}
+extern int blk_probe_connect(void);
+extern void blk_probe_disconnect(void);
#else /* !CONFIG_BLK_DEV_IO_TRACE */
#define blk_trace_ioctl(bdev, cmd, arg) (-ENOTTY)
#define blk_trace_shutdown(q) do { } while (0)
-#define blk_add_trace_rq(q, rq, what) do { } while (0)
-#define blk_add_trace_bio(q, rq, what) do { } while (0)
-#define blk_add_trace_generic(q, rq, rw, what) do { } while (0)
-#define blk_add_trace_pdu_int(q, what, bio, pdu) do { } while (0)
-#define blk_add_trace_remap(q, bio, dev, f, t) do {} while (0)
#endif /* CONFIG_BLK_DEV_IO_TRACE */
#endif
Index: linux-2.6-lttng/mm/bounce.c
===================================================================
--- linux-2.6-lttng.orig/mm/bounce.c 2007-05-02 21:34:39.000000000 -0400
+++ linux-2.6-lttng/mm/bounce.c 2007-05-02 21:36:17.000000000 -0400
@@ -13,7 +13,7 @@
#include <linux/init.h>
#include <linux/hash.h>
#include <linux/highmem.h>
-#include <linux/blktrace_api.h>
+#include <linux/marker.h>
#include <asm/tlbflush.h>
#define POOL_SIZE 64
@@ -237,7 +237,7 @@
if (!bio)
return;
- blk_add_trace_bio(q, *bio_orig, BLK_TA_BOUNCE);
+ MARK(blk_bio_bounce, "%p %p", q, *bio_orig);
/*
* at least one page was bounced, fill in possible non-highmem
Index: linux-2.6-lttng/mm/highmem.c
===================================================================
--- linux-2.6-lttng.orig/mm/highmem.c 2007-05-02 21:36:27.000000000 -0400
+++ linux-2.6-lttng/mm/highmem.c 2007-05-02 21:36:39.000000000 -0400
@@ -26,7 +26,7 @@
#include <linux/init.h>
#include <linux/hash.h>
#include <linux/highmem.h>
-#include <linux/blktrace_api.h>
+#include <linux/marker.h>
#include <asm/tlbflush.h>
/*
Index: linux-2.6-lttng/fs/bio.c
===================================================================
--- linux-2.6-lttng.orig/fs/bio.c 2007-05-02 21:37:52.000000000 -0400
+++ linux-2.6-lttng/fs/bio.c 2007-05-02 21:40:30.000000000 -0400
@@ -25,7 +25,7 @@
#include <linux/module.h>
#include <linux/mempool.h>
#include <linux/workqueue.h>
-#include <linux/blktrace_api.h>
+#include <linux/marker.h>
#include <scsi/sg.h> /* for struct sg_iovec */
#define BIO_POOL_SIZE 2
@@ -1081,7 +1081,7 @@
if (!bp)
return bp;
- blk_add_trace_pdu_int(bdev_get_queue(bi->bi_bdev), BLK_TA_SPLIT, bi,
+ MARK(blk_pdu_split, "%p %p %d", bdev_get_queue(bi->bi_bdev), bi,
bi->bi_sector + first_sectors);
BUG_ON(bi->bi_vcnt != 1);
Index: linux-2.6-lttng/drivers/block/cciss.c
===================================================================
--- linux-2.6-lttng.orig/drivers/block/cciss.c 2007-05-02 21:44:30.000000000 -0400
+++ linux-2.6-lttng/drivers/block/cciss.c 2007-05-02 21:45:08.000000000 -0400
@@ -37,7 +37,7 @@
#include <linux/hdreg.h>
#include <linux/spinlock.h>
#include <linux/compat.h>
-#include <linux/blktrace_api.h>
+#include <linux/marker.h>
#include <asm/uaccess.h>
#include <asm/io.h>
@@ -2502,7 +2502,7 @@
}
cmd->rq->data_len = 0;
cmd->rq->completion_data = cmd;
- blk_add_trace_rq(cmd->rq->q, cmd->rq, BLK_TA_COMPLETE);
+ MARK(blk_request_complete, "%p %p", cmd->rq->q, cmd->rq);
blk_complete_request(cmd->rq);
}
Index: linux-2.6-lttng/drivers/md/dm.c
===================================================================
--- linux-2.6-lttng.orig/drivers/md/dm.c 2007-05-02 21:44:41.000000000 -0400
+++ linux-2.6-lttng/drivers/md/dm.c 2007-05-02 21:47:19.000000000 -0400
@@ -19,7 +19,7 @@
#include <linux/slab.h>
#include <linux/idr.h>
#include <linux/hdreg.h>
-#include <linux/blktrace_api.h>
+#include <linux/marker.h>
#include <linux/smp_lock.h>
#define DM_MSG_PREFIX "core"
@@ -485,8 +485,8 @@
wake_up(&io->md->wait);
if (io->error != DM_ENDIO_REQUEUE) {
- blk_add_trace_bio(io->md->queue, io->bio,
- BLK_TA_COMPLETE);
+ MARK(blk_request_complete, "%p %p",
+ io->md->queue, io->bio);
bio_endio(io->bio, io->bio->bi_size, io->error);
}
@@ -582,10 +582,10 @@
r = ti->type->map(ti, clone, &tio->info);
if (r == DM_MAPIO_REMAPPED) {
/* the bio has been remapped so dispatch it */
-
- blk_add_trace_remap(bdev_get_queue(clone->bi_bdev), clone,
- tio->io->bio->bi_bdev->bd_dev, sector,
- clone->bi_sector);
+ MARK(blk_remap, "%p %p %u %llu %llu",
+ bdev_get_queue(clone->bi_bdev), clone,
+ (u64)tio->io->bio->bi_bdev->bd_dev, (u64)sector,
+ (u64)clone->bi_sector);
generic_make_request(clone);
} else if (r < 0 || r == DM_MAPIO_REQUEUE) {
--
Mathieu Desnoyers
Computer Engineering Ph.D. Student, Ecole Polytechnique de Montreal
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F BA06 3F25 A8FE 3BAE 9A68
next prev parent reply other threads:[~2007-05-03 15:09 UTC|newest]
Thread overview: 233+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-30 23:20 2.6.22 -mm merge plans Andrew Morton
2007-04-30 23:48 ` to something appropriate (was Re: 2.6.22 -mm merge plans) Jeff Garzik
2007-05-01 0:07 ` Dave Jones
2007-05-01 0:09 ` Andrew Morton
2007-05-01 0:24 ` Jeff Garzik
2007-05-01 0:40 ` [stable] " Chris Wright
2007-05-01 0:45 ` Jeff Garzik
2007-05-01 4:58 ` Greg KH
2007-05-01 16:14 ` Chuck Ebbert
2007-05-01 16:40 ` Alan Cox
2007-05-01 23:34 ` Greg KH
2007-05-02 0:52 ` Chris Wright
2007-05-02 14:10 ` Chuck Ebbert
2007-05-01 9:49 ` Alan Cox
2007-04-30 23:59 ` 2.6.22 -mm merge plans Bill Irwin
2007-05-01 0:09 ` nfsd/md patches " Neil Brown
2007-05-01 9:08 ` Christoph Hellwig
2007-05-01 9:15 ` Andrew Morton
2007-05-01 9:21 ` Christoph Hellwig
2007-05-01 9:52 ` Neil Brown
2007-05-01 10:15 ` Christoph Hellwig
2007-05-01 14:34 ` Trond Myklebust
2007-05-01 0:54 ` MADV_FREE functionality Rik van Riel
2007-05-01 1:18 ` Andrew Morton
2007-05-01 1:23 ` Rik van Riel
2007-05-01 7:13 ` Jakub Jelinek
2007-05-01 1:23 ` Ulrich Drepper
2007-05-01 1:39 ` 2.6.22 -mm merge plans Stefan Richter
2007-05-01 2:30 ` 2.6.22 -mm merge plans (RE: input) Dmitry Torokhov
2007-05-01 8:14 ` Jiri Slaby
2007-05-01 12:05 ` Dmitry Torokhov
2007-05-01 8:11 ` 2.6.22 -mm merge plans -- pfn_valid_within Andy Whitcroft
2007-05-01 8:19 ` Andrew Morton
2007-05-01 8:42 ` "partical" kthread conversion Christoph Hellwig
2007-05-01 8:51 ` Andrew Morton
2007-05-02 14:01 ` Dean Nelson
2007-05-02 14:45 ` Eric W. Biederman
2007-05-02 15:37 ` Dean Nelson
2007-05-02 15:49 ` Eric W. Biederman
2007-05-02 19:33 ` Andrew Morton
2007-05-02 20:38 ` Eric W. Biederman
2007-05-01 8:44 ` 2.6.22 -mm merge plans -- vm bugfixes Nick Piggin
2007-05-01 8:54 ` Andrew Morton
2007-05-01 19:31 ` Hugh Dickins
2007-05-02 3:08 ` Nick Piggin
2007-05-02 9:15 ` Nick Piggin
2007-05-02 14:00 ` Hugh Dickins
2007-05-03 1:32 ` Nick Piggin
2007-05-03 10:37 ` Christoph Hellwig
2007-05-03 12:56 ` Nick Piggin
2007-05-04 9:23 ` Nick Piggin
2007-05-04 9:43 ` Nick Piggin
2007-05-08 3:03 ` Benjamin Herrenschmidt
2007-05-03 12:24 ` Hugh Dickins
2007-05-03 12:43 ` Nick Piggin
2007-05-03 12:58 ` Hugh Dickins
2007-05-03 13:08 ` Nick Piggin
2007-05-03 16:52 ` Andrew Morton
2007-05-04 4:16 ` Nick Piggin
2007-05-09 12:34 ` Nick Piggin
2007-05-09 14:28 ` Hugh Dickins
2007-05-09 14:45 ` Nick Piggin
2007-05-09 15:38 ` Hugh Dickins
2007-05-09 22:24 ` Nick Piggin
2007-05-01 8:46 ` pcmcia ioctl removal Christoph Hellwig
2007-05-01 8:56 ` Russell King
2007-05-01 8:57 ` Willy Tarreau
2007-05-01 9:08 ` Andrew Morton
2007-05-01 14:46 ` Adrian Bunk
2007-05-01 9:16 ` Robert P. J. Day
2007-05-01 9:44 ` Willy Tarreau
2007-05-01 10:16 ` Robert P. J. Day
2007-05-01 10:26 ` Gabriel C
2007-05-01 10:52 ` Willy Tarreau
2007-05-01 10:12 ` Jan Engelhardt
2007-05-01 11:00 ` Willy Tarreau
2007-05-01 12:06 ` Konstantin Münning
2007-05-01 13:56 ` Rogan Dawes
2007-05-01 19:10 ` Russell King
2007-05-01 20:41 ` Jan Engelhardt
2007-05-09 12:54 ` Pavel Machek
2007-05-09 13:00 ` Robert P. J. Day
2007-05-09 13:03 ` Adrian Bunk
2007-05-09 19:11 ` Romano Giannetti
2007-05-10 12:40 ` Adrian Bunk
2007-05-01 8:48 ` pci hotplug patches Christoph Hellwig
2007-05-02 3:57 ` Greg KH
2007-05-13 20:59 ` Christoph Hellwig
2007-05-14 11:48 ` Greg KH
2007-05-01 8:54 ` cache-pipe-buf-page-address-for-non-highmem-arch.patch Christoph Hellwig
[not found] ` <20070501020441.10b6a003.akpm@linux-foundation.org>
2007-05-03 3:48 ` cache-pipe-buf-page-address-for-non-highmem-arch.patch Ken Chen
2007-05-01 8:55 ` consolidate-generic_writepages-and-mpage_writepages.patch Christoph Hellwig
2007-05-01 9:17 ` 2.6.22 -mm merge plans Pekka Enberg
2007-05-01 9:24 ` Christoph Hellwig
2007-05-01 9:37 ` Peter Zijlstra
2007-05-01 12:19 ` Andi Kleen
2007-05-01 17:12 ` Pekka Enberg
2007-05-01 10:16 ` fragmentation avoidance " Mel Gorman
2007-05-01 13:02 ` 2.6.22 -mm merge plans -- lumpy reclaim Andy Whitcroft
2007-05-01 18:03 ` Peter Zijlstra
2007-05-01 19:00 ` Andrew Morton
2007-05-01 14:54 ` fragmentation avoidance Re: 2.6.22 -mm merge plans Christoph Lameter
2007-05-01 19:00 ` Mel Gorman
2007-05-01 18:57 ` Andrew Morton
2007-05-07 13:07 ` Yasunori Goto
2007-05-01 12:17 ` Andi Kleen
2007-05-01 22:08 ` Mathieu Desnoyers
2007-05-02 10:44 ` Andi Kleen
2007-05-02 16:37 ` Frank Ch. Eigler
2007-05-02 16:47 ` Andrew Morton
2007-05-02 17:29 ` Christoph Hellwig
2007-05-02 20:36 ` Mathieu Desnoyers
2007-05-02 20:53 ` Andrew Morton
2007-05-02 23:11 ` Mathieu Desnoyers
2007-05-02 23:21 ` Andrew Morton
2007-05-03 15:04 ` Mathieu Desnoyers [this message]
2007-05-03 15:12 ` Christoph Hellwig
2007-05-03 17:16 ` Mathieu Desnoyers
2007-05-03 17:25 ` Christoph Hellwig
2007-05-10 19:39 ` Mathieu Desnoyers
2007-05-13 21:04 ` Christoph Hellwig
2007-05-03 8:06 ` Christoph Hellwig
2007-05-03 14:43 ` Mathieu Desnoyers
2007-05-03 10:31 ` Andi Kleen
2007-05-03 14:49 ` Mathieu Desnoyers
2007-05-03 8:09 ` Christoph Hellwig
2007-05-03 8:08 ` Christoph Hellwig
2007-05-02 17:49 ` Andi Kleen
2007-05-02 21:46 ` Tilman Schmidt
2007-05-03 10:12 ` Andi Kleen
2007-05-02 17:19 ` Mathieu Desnoyers
2007-05-02 0:31 ` Rusty Russell
2007-05-02 10:30 ` Andi Kleen
2007-05-01 13:06 ` file capabilities and security_task_wait failure " Stephen Smalley
2007-05-01 14:31 ` 2.6.22 -mm merge plans: mm-more-rmap-checking Hugh Dickins
2007-05-02 1:42 ` Nick Piggin
2007-05-02 13:17 ` Hugh Dickins
2007-05-03 0:18 ` Nick Piggin
2007-05-01 16:56 ` 2.6.22 -mm merge plans Zan Lynx
2007-05-01 17:06 ` 2.6.22 -mm merge plans: mm-detach_vmas_to_be_unmapped-fix Hugh Dickins
2007-05-01 18:10 ` 2.6.22 -mm merge plans: slub Hugh Dickins
2007-05-01 19:25 ` Christoph Lameter
2007-05-01 19:55 ` Andrew Morton
2007-05-01 20:19 ` Hugh Dickins
2007-05-01 20:36 ` Andrew Morton
2007-05-01 20:46 ` Christoph Lameter
2007-05-01 21:09 ` Andrew Morton
2007-05-02 12:54 ` Hugh Dickins
2007-05-02 17:03 ` Christoph Lameter
2007-05-02 19:11 ` Andrew Morton
2007-05-02 19:42 ` Christoph Lameter
2007-05-02 19:54 ` Sam Ravnborg
2007-05-02 20:14 ` Christoph Lameter
2007-05-02 18:52 ` Siddha, Suresh B
2007-05-02 18:58 ` Christoph Lameter
2007-05-01 21:08 ` Christoph Lameter
2007-05-02 12:45 ` Hugh Dickins
2007-05-02 17:01 ` Christoph Lameter
2007-05-02 18:08 ` Hugh Dickins
2007-05-02 18:28 ` Christoph Lameter
2007-05-02 18:42 ` Andrew Morton
2007-05-02 18:53 ` Christoph Lameter
2007-05-02 17:25 ` Christoph Lameter
2007-05-02 18:36 ` Hugh Dickins
2007-05-02 18:39 ` Christoph Lameter
2007-05-02 18:57 ` Andrew Morton
2007-05-02 19:01 ` Christoph Lameter
2007-05-02 19:18 ` Pekka Enberg
2007-05-02 19:34 ` Christoph Lameter
2007-05-02 19:43 ` Christoph Lameter
2007-05-03 8:15 ` Andrew Morton
2007-05-03 8:27 ` William Lee Irwin III
2007-05-03 16:30 ` Christoph Lameter
2007-05-03 8:46 ` Hugh Dickins
2007-05-03 8:57 ` Andrew Morton
2007-05-03 9:15 ` Hugh Dickins
2007-05-03 21:04 ` 2.6.22 -mm merge plans: slub on PowerPC Hugh Dickins
2007-05-03 21:15 ` Christoph Lameter
2007-05-03 22:41 ` Hugh Dickins
2007-05-04 0:25 ` Benjamin Herrenschmidt
2007-05-04 0:54 ` Christoph Lameter
2007-05-03 16:45 ` 2.6.22 -mm merge plans: slub Christoph Lameter
2007-05-03 15:54 ` swap-prefetch: 2.6.22 -mm merge plans Ingo Molnar
2007-05-03 16:15 ` Michal Piotrowski
2007-05-03 16:23 ` Michal Piotrowski
2007-05-03 22:14 ` Con Kolivas
2007-05-04 7:34 ` Nick Piggin
2007-05-04 8:52 ` Ingo Molnar
2007-05-04 9:09 ` Nick Piggin
2007-05-04 12:10 ` Con Kolivas
2007-05-05 8:42 ` Con Kolivas
2007-05-06 10:13 ` [ck] " Antonino Ingargiola
2007-05-06 18:22 ` Jory A. Pratt
2007-05-09 23:28 ` Con Kolivas
2007-05-10 0:05 ` Nick Piggin
2007-05-10 1:34 ` Con Kolivas
2007-05-10 1:56 ` Nick Piggin
2007-05-10 3:48 ` Ray Lee
2007-05-10 3:56 ` Nick Piggin
2007-05-10 5:52 ` Ray Lee
2007-05-10 7:04 ` Nick Piggin
2007-05-10 7:20 ` William Lee Irwin III
2007-05-10 12:34 ` Ray Lee
2007-05-12 4:46 ` [PATCH] mm: swap prefetch improvements Con Kolivas
2007-05-12 5:03 ` Paul Jackson
2007-05-12 5:15 ` Con Kolivas
2007-05-12 5:51 ` Paul Jackson
2007-05-12 7:28 ` Con Kolivas
2007-05-12 8:14 ` Paul Jackson
2007-05-12 8:21 ` Con Kolivas
2007-05-12 8:37 ` Paul Jackson
2007-05-12 8:57 ` [PATCH respin] " Con Kolivas
2007-05-21 10:03 ` [PATCH] " Ingo Molnar
2007-05-21 13:44 ` Con Kolivas
2007-05-21 16:00 ` Ingo Molnar
2007-05-22 10:15 ` Antonino Ingargiola
2007-05-22 10:20 ` Con Kolivas
2007-05-22 10:25 ` Ingo Molnar
2007-05-22 10:37 ` Con Kolivas
2007-05-22 10:46 ` Ingo Molnar
2007-05-22 10:54 ` Con Kolivas
2007-05-22 10:57 ` Ingo Molnar
2007-05-22 11:04 ` Con Kolivas
[not found] ` <20070522111104.GA14950@elte.hu>
2007-05-22 11:12 ` Ingo Molnar
2007-05-22 20:18 ` [ck] " Michael Chang
2007-05-22 20:31 ` Ingo Molnar
2007-05-22 20:42 ` Ash Milsted
2007-05-22 22:50 ` Con Kolivas
2007-05-23 7:57 ` Ash Milsted
2007-05-10 3:58 ` swap-prefetch: 2.6.22 -mm merge plans Con Kolivas
2007-05-07 14:28 ` Bill Davidsen
2007-05-07 14:18 ` Bill Davidsen
2007-05-07 17:47 ` Josef Sipek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070503150415.GC26864@Krystal \
--to=mathieu.desnoyers@polymtl.ca \
--cc=akpm@linux-foundation.org \
--cc=andi@firstfloor.org \
--cc=hch@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rusty@rustcorp.com.au \
--cc=wfg@ustc.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox