aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/block/drbd/Kconfig11
-rw-r--r--drivers/block/drbd/Makefile3
-rw-r--r--drivers/block/drbd/drbd_actlog.c62
-rw-r--r--drivers/block/drbd/drbd_int.h7
-rw-r--r--drivers/block/drbd/drbd_main.c36
-rw-r--r--drivers/block/drbd/drbd_nl.c9
-rw-r--r--drivers/block/drbd/drbd_receiver.c30
-rw-r--r--drivers/block/drbd/drbd_req.c11
-rw-r--r--drivers/block/drbd/drbd_tracing.c752
-rw-r--r--drivers/block/drbd/drbd_tracing.h87
-rw-r--r--drivers/block/drbd/drbd_worker.c16
11 files changed, 3 insertions, 1021 deletions
diff --git a/drivers/block/drbd/Kconfig b/drivers/block/drbd/Kconfig
index 4e6f90f487c..f4acd04ebee 100644
--- a/drivers/block/drbd/Kconfig
+++ b/drivers/block/drbd/Kconfig
@@ -38,17 +38,6 @@ config BLK_DEV_DRBD
If unsure, say N.
-config DRBD_TRACE
- tristate "DRBD tracing"
- depends on BLK_DEV_DRBD
- select TRACEPOINTS
- default n
- help
-
- Say Y here if you want to be able to trace various events in DRBD.
-
- If unsure, say N.
-
config DRBD_FAULT_INJECTION
bool "DRBD fault injection"
depends on BLK_DEV_DRBD
diff --git a/drivers/block/drbd/Makefile b/drivers/block/drbd/Makefile
index 7d86ef8a8b4..0d3f337ff5f 100644
--- a/drivers/block/drbd/Makefile
+++ b/drivers/block/drbd/Makefile
@@ -2,7 +2,4 @@ drbd-y := drbd_bitmap.o drbd_proc.o
drbd-y += drbd_worker.o drbd_receiver.o drbd_req.o drbd_actlog.o
drbd-y += drbd_main.o drbd_strings.o drbd_nl.o
-drbd_trace-y := drbd_tracing.o
-
obj-$(CONFIG_BLK_DEV_DRBD) += drbd.o
-obj-$(CONFIG_DRBD_TRACE) += drbd_trace.o
diff --git a/drivers/block/drbd/drbd_actlog.c b/drivers/block/drbd/drbd_actlog.c
index 74b4835d310..17956ff6a08 100644
--- a/drivers/block/drbd/drbd_actlog.c
+++ b/drivers/block/drbd/drbd_actlog.c
@@ -26,7 +26,6 @@
#include <linux/slab.h>
#include <linux/drbd.h>
#include "drbd_int.h"
-#include "drbd_tracing.h"
#include "drbd_wrappers.h"
/* We maintain a trivial check sum in our on disk activity log.
@@ -66,17 +65,6 @@ struct drbd_atodb_wait {
int w_al_write_transaction(struct drbd_conf *, struct drbd_work *, int);
-/* The actual tracepoint needs to have constant number of known arguments...
- */
-void trace_drbd_resync(struct drbd_conf *mdev, int level, const char *fmt, ...)
-{
- va_list ap;
-
- va_start(ap, fmt);
- trace__drbd_resync(mdev, level, fmt, ap);
- va_end(ap);
-}
-
static int _drbd_md_sync_page_io(struct drbd_conf *mdev,
struct drbd_backing_dev *bdev,
struct page *page, sector_t sector,
@@ -105,8 +93,6 @@ static int _drbd_md_sync_page_io(struct drbd_conf *mdev,
bio->bi_end_io = drbd_md_io_complete;
bio->bi_rw = rw;
- trace_drbd_bio(mdev, "Md", bio, 0, NULL);
-
if (FAULT_ACTIVE(mdev, (rw & WRITE) ? DRBD_FAULT_MD_WR : DRBD_FAULT_MD_RD))
bio_endio(bio, -EIO);
else
@@ -236,8 +222,6 @@ void drbd_al_begin_io(struct drbd_conf *mdev, sector_t sector)
D_ASSERT(atomic_read(&mdev->local_cnt) > 0);
- trace_drbd_actlog(mdev, sector, "al_begin_io");
-
wait_event(mdev->al_wait, (al_ext = _al_get(mdev, enr)));
if (al_ext->lc_number != enr) {
@@ -270,8 +254,6 @@ void drbd_al_complete_io(struct drbd_conf *mdev, sector_t sector)
struct lc_element *extent;
unsigned long flags;
- trace_drbd_actlog(mdev, sector, "al_complete_io");
-
spin_lock_irqsave(&mdev->al_lock, flags);
extent = lc_find(mdev->act_log, enr);
@@ -967,10 +949,6 @@ void __drbd_set_in_sync(struct drbd_conf *mdev, sector_t sector, int size,
ebnr = BM_SECT_TO_BIT(esector - (BM_SECT_PER_BIT-1));
sbnr = BM_SECT_TO_BIT(sector + BM_SECT_PER_BIT-1);
- trace_drbd_resync(mdev, TRACE_LVL_METRICS,
- "drbd_set_in_sync: sector=%llus size=%u sbnr=%lu ebnr=%lu\n",
- (unsigned long long)sector, size, sbnr, ebnr);
-
if (sbnr > ebnr)
return;
@@ -1045,10 +1023,6 @@ void __drbd_set_out_of_sync(struct drbd_conf *mdev, sector_t sector, int size,
sbnr = BM_SECT_TO_BIT(sector);
ebnr = BM_SECT_TO_BIT(esector);
- trace_drbd_resync(mdev, TRACE_LVL_METRICS,
- "drbd_set_out_of_sync: sector=%llus size=%u sbnr=%lu ebnr=%lu\n",
- (unsigned long long)sector, size, sbnr, ebnr);
-
/* ok, (capacity & 7) != 0 sometimes, but who cares...
* we count rs_{total,left} in bits, not sectors. */
spin_lock_irqsave(&mdev->al_lock, flags);
@@ -1143,10 +1117,6 @@ int drbd_rs_begin_io(struct drbd_conf *mdev, sector_t sector)
struct bm_extent *bm_ext;
int i, sig;
- trace_drbd_resync(mdev, TRACE_LVL_ALL,
- "drbd_rs_begin_io: sector=%llus (rs_end=%d)\n",
- (unsigned long long)sector, enr);
-
sig = wait_event_interruptible(mdev->al_wait,
(bm_ext = _bme_get(mdev, enr)));
if (sig)
@@ -1192,9 +1162,6 @@ int drbd_try_rs_begin_io(struct drbd_conf *mdev, sector_t sector)
struct bm_extent *bm_ext;
int i;
- trace_drbd_resync(mdev, TRACE_LVL_ALL, "drbd_try_rs_begin_io: sector=%llus\n",
- (unsigned long long)sector);
-
spin_lock_irq(&mdev->al_lock);
if (mdev->resync_wenr != LC_FREE && mdev->resync_wenr != enr) {
/* in case you have very heavy scattered io, it may
@@ -1210,11 +1177,6 @@ int drbd_try_rs_begin_io(struct drbd_conf *mdev, sector_t sector)
* the lc_put here...
* we also have to wake_up
*/
-
- trace_drbd_resync(mdev, TRACE_LVL_ALL,
- "dropping %u, apparently got 'synced' by application io\n",
- mdev->resync_wenr);
-
e = lc_find(mdev->resync, mdev->resync_wenr);
bm_ext = e ? lc_entry(e, struct bm_extent, lce) : NULL;
if (bm_ext) {
@@ -1242,21 +1204,14 @@ int drbd_try_rs_begin_io(struct drbd_conf *mdev, sector_t sector)
* but then could not set BME_LOCKED,
* so we tried again.
* drop the extra reference. */
- trace_drbd_resync(mdev, TRACE_LVL_ALL,
- "dropping extra reference on %u\n", enr);
-
bm_ext->lce.refcnt--;
D_ASSERT(bm_ext->lce.refcnt > 0);
}
goto check_al;
} else {
/* do we rather want to try later? */
- if (mdev->resync_locked > mdev->resync->nr_elements-3) {
- trace_drbd_resync(mdev, TRACE_LVL_ALL,
- "resync_locked = %u!\n", mdev->resync_locked);
-
+ if (mdev->resync_locked > mdev->resync->nr_elements-3)
goto try_again;
- }
/* Do or do not. There is no try. -- Yoda */
e = lc_get(mdev->resync, enr);
bm_ext = e ? lc_entry(e, struct bm_extent, lce) : NULL;
@@ -1281,8 +1236,6 @@ int drbd_try_rs_begin_io(struct drbd_conf *mdev, sector_t sector)
goto check_al;
}
check_al:
- trace_drbd_resync(mdev, TRACE_LVL_ALL, "checking al for %u\n", enr);
-
for (i = 0; i < AL_EXT_PER_BM_SECT; i++) {
if (unlikely(al_enr+i == mdev->act_log->new_number))
goto try_again;
@@ -1296,7 +1249,6 @@ proceed:
return 0;
try_again:
- trace_drbd_resync(mdev, TRACE_LVL_ALL, "need to try again for %u\n", enr);
if (bm_ext)
mdev->resync_wenr = enr;
spin_unlock_irq(&mdev->al_lock);
@@ -1310,10 +1262,6 @@ void drbd_rs_complete_io(struct drbd_conf *mdev, sector_t sector)
struct bm_extent *bm_ext;
unsigned long flags;
- trace_drbd_resync(mdev, TRACE_LVL_ALL,
- "drbd_rs_complete_io: sector=%llus (rs_enr=%d)\n",
- (long long)sector, enr);
-
spin_lock_irqsave(&mdev->al_lock, flags);
e = lc_find(mdev->resync, enr);
bm_ext = e ? lc_entry(e, struct bm_extent, lce) : NULL;
@@ -1348,8 +1296,6 @@ void drbd_rs_complete_io(struct drbd_conf *mdev, sector_t sector)
*/
void drbd_rs_cancel_all(struct drbd_conf *mdev)
{
- trace_drbd_resync(mdev, TRACE_LVL_METRICS, "drbd_rs_cancel_all\n");
-
spin_lock_irq(&mdev->al_lock);
if (get_ldev_if_state(mdev, D_FAILED)) { /* Makes sure ->resync is there. */
@@ -1375,8 +1321,6 @@ int drbd_rs_del_all(struct drbd_conf *mdev)
struct bm_extent *bm_ext;
int i;
- trace_drbd_resync(mdev, TRACE_LVL_METRICS, "drbd_rs_del_all\n");
-
spin_lock_irq(&mdev->al_lock);
if (get_ldev_if_state(mdev, D_FAILED)) {
@@ -1429,10 +1373,6 @@ void drbd_rs_failed_io(struct drbd_conf *mdev, sector_t sector, int size)
sector_t esector, nr_sectors;
int wake_up = 0;
- trace_drbd_resync(mdev, TRACE_LVL_SUMMARY,
- "drbd_rs_failed_io: sector=%llus, size=%u\n",
- (unsigned long long)sector, size);
-
if (size <= 0 || (size & 0x1ff) != 0 || size > DRBD_MAX_SEGMENT_SIZE) {
dev_err(DEV, "drbd_rs_failed_io: sector=%llus size=%d nonsense!\n",
(unsigned long long)sector, size);
diff --git a/drivers/block/drbd/drbd_int.h b/drivers/block/drbd/drbd_int.h
index 8da602e010b..4e6255991e5 100644
--- a/drivers/block/drbd/drbd_int.h
+++ b/drivers/block/drbd/drbd_int.h
@@ -135,8 +135,6 @@ enum {
DRBD_FAULT_MAX,
};
-extern void trace_drbd_resync(struct drbd_conf *mdev, int level, const char *fmt, ...);
-
#ifdef CONFIG_DRBD_FAULT_INJECTION
extern unsigned int
_drbd_insert_fault(struct drbd_conf *mdev, unsigned int type);
@@ -712,11 +710,6 @@ enum epoch_event {
EV_GOT_BARRIER_NR,
EV_BARRIER_DONE,
EV_BECAME_LAST,
- EV_TRACE_FLUSH, /* TRACE_ are not real events, only used for tracing */
- EV_TRACE_ADD_BARRIER, /* Doing the first write as a barrier write */
- EV_TRACE_SETTING_BI, /* Barrier is expressed with the first write of the next epoch */
- EV_TRACE_ALLOC,
- EV_TRACE_FREE,
EV_CLEANUP = 32, /* used as flag */
};
diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c
index 80273f21a4a..11d8ff6016a 100644
--- a/drivers/block/drbd/drbd_main.c
+++ b/drivers/block/drbd/drbd_main.c
@@ -53,7 +53,6 @@
#include <linux/drbd_limits.h>
#include "drbd_int.h"
-#include "drbd_tracing.h"
#include "drbd_req.h" /* only for _req_mod in tl_release and tl_clear */
#include "drbd_vli.h"
@@ -80,18 +79,6 @@ static int w_md_sync(struct drbd_conf *mdev, struct drbd_work *w, int unused);
static void md_sync_timer_fn(unsigned long data);
static int w_bitmap_io(struct drbd_conf *mdev, struct drbd_work *w, int unused);
-DEFINE_TRACE(drbd_unplug);
-DEFINE_TRACE(drbd_uuid);
-DEFINE_TRACE(drbd_ee);
-DEFINE_TRACE(drbd_packet);
-DEFINE_TRACE(drbd_md_io);
-DEFINE_TRACE(drbd_epoch);
-DEFINE_TRACE(drbd_netlink);
-DEFINE_TRACE(drbd_actlog);
-DEFINE_TRACE(drbd_bio);
-DEFINE_TRACE(_drbd_resync);
-DEFINE_TRACE(drbd_req);
-
MODULE_AUTHOR("Philipp Reisner <phil@linbit.com>, "
"Lars Ellenberg <lars@linbit.com>");
MODULE_DESCRIPTION("drbd - Distributed Replicated Block Device v" REL_VERSION);
@@ -1576,7 +1563,6 @@ int _drbd_send_cmd(struct drbd_conf *mdev, struct socket *sock,
h->command = cpu_to_be16(cmd);
h->length = cpu_to_be16(size-sizeof(struct p_header));
- trace_drbd_packet(mdev, sock, 0, (void *)h, __FILE__, __LINE__);
sent = drbd_send(mdev, sock, h, size, msg_flags);
ok = (sent == size);
@@ -1628,8 +1614,6 @@ int drbd_send_cmd2(struct drbd_conf *mdev, enum drbd_packets cmd, char *data,
if (!drbd_get_data_sock(mdev))
return 0;
- trace_drbd_packet(mdev, mdev->data.socket, 0, (void *)&h, __FILE__, __LINE__);
-
ok = (sizeof(h) ==
drbd_send(mdev, mdev->data.socket, &h, sizeof(h), 0));
ok = ok && (size ==
@@ -2359,7 +2343,6 @@ int drbd_send_dblock(struct drbd_conf *mdev, struct drbd_request *req)
dp_flags |= DP_MAY_SET_IN_SYNC;
p.dp_flags = cpu_to_be32(dp_flags);
- trace_drbd_packet(mdev, mdev->data.socket, 0, (void *)&p, __FILE__, __LINE__);
set_bit(UNPLUG_REMOTE, &mdev->flags);
ok = (sizeof(p) ==
drbd_send(mdev, mdev->data.socket, &p, sizeof(p), MSG_MORE));
@@ -2410,7 +2393,6 @@ int drbd_send_block(struct drbd_conf *mdev, enum drbd_packets cmd,
if (!drbd_get_data_sock(mdev))
return 0;
- trace_drbd_packet(mdev, mdev->data.socket, 0, (void *)&p, __FILE__, __LINE__);
ok = sizeof(p) == drbd_send(mdev, mdev->data.socket, &p,
sizeof(p), MSG_MORE);
if (ok && dgs) {
@@ -2546,8 +2528,6 @@ static void drbd_unplug_fn(struct request_queue *q)
{
struct drbd_conf *mdev = q->queuedata;
- trace_drbd_unplug(mdev, "got unplugged");
-
/* unplug FIRST */
spin_lock_irq(q->queue_lock);
blk_remove_plug(q);
@@ -3252,8 +3232,6 @@ void drbd_md_sync(struct drbd_conf *mdev)
if (!get_ldev_if_state(mdev, D_FAILED))
return;
- trace_drbd_md_io(mdev, WRITE, mdev->ldev);
-
mutex_lock(&mdev->md_io_mutex);
buffer = (struct meta_data_on_disk *)page_address(mdev->md_io_page);
memset(buffer, 0, 512);
@@ -3308,8 +3286,6 @@ int drbd_md_read(struct drbd_conf *mdev, struct drbd_backing_dev *bdev)
if (!get_ldev_if_state(mdev, D_ATTACHING))
return ERR_IO_MD_DISK;
- trace_drbd_md_io(mdev, READ, bdev);
-
mutex_lock(&mdev->md_io_mutex);
buffer = (struct meta_data_on_disk *)page_address(mdev->md_io_page);
@@ -3388,11 +3364,8 @@ static void drbd_uuid_move_history(struct drbd_conf *mdev) __must_hold(local)
{
int i;
- for (i = UI_HISTORY_START; i < UI_HISTORY_END; i++) {
+ for (i = UI_HISTORY_START; i < UI_HISTORY_END; i++)
mdev->ldev->md.uuid[i+1] = mdev->ldev->md.uuid[i];
-
- trace_drbd_uuid(mdev, i+1);
- }
}
void _drbd_uuid_set(struct drbd_conf *mdev, int idx, u64 val) __must_hold(local)
@@ -3407,7 +3380,6 @@ void _drbd_uuid_set(struct drbd_conf *mdev, int idx, u64 val) __must_hold(local)
}
mdev->ldev->md.uuid[idx] = val;
- trace_drbd_uuid(mdev, idx);
drbd_md_mark_dirty(mdev);
}
@@ -3417,7 +3389,6 @@ void drbd_uuid_set(struct drbd_conf *mdev, int idx, u64 val) __must_hold(local)
if (mdev->ldev->md.uuid[idx]) {
drbd_uuid_move_history(mdev);
mdev->ldev->md.uuid[UI_HISTORY_START] = mdev->ldev->md.uuid[idx];
- trace_drbd_uuid(mdev, UI_HISTORY_START);
}
_drbd_uuid_set(mdev, idx, val);
}
@@ -3436,7 +3407,6 @@ void drbd_uuid_new_current(struct drbd_conf *mdev) __must_hold(local)
dev_info(DEV, "Creating new current UUID\n");
D_ASSERT(mdev->ldev->md.uuid[UI_BITMAP] == 0);
mdev->ldev->md.uuid[UI_BITMAP] = mdev->ldev->md.uuid[UI_CURRENT];
- trace_drbd_uuid(mdev, UI_BITMAP);
get_random_bytes(&val, sizeof(u64));
_drbd_uuid_set(mdev, UI_CURRENT, val);
@@ -3451,8 +3421,6 @@ void drbd_uuid_set_bm(struct drbd_conf *mdev, u64 val) __must_hold(local)
drbd_uuid_move_history(mdev);
mdev->ldev->md.uuid[UI_HISTORY_START] = mdev->ldev->md.uuid[UI_BITMAP];
mdev->ldev->md.uuid[UI_BITMAP] = 0;
- trace_drbd_uuid(mdev, UI_HISTORY_START);
- trace_drbd_uuid(mdev, UI_BITMAP);
} else {
if (mdev->ldev->md.uuid[UI_BITMAP])
dev_warn(DEV, "bm UUID already set");
@@ -3460,7 +3428,6 @@ void drbd_uuid_set_bm(struct drbd_conf *mdev, u64 val) __must_hold(local)
mdev->ldev->md.uuid[UI_BITMAP] = val;
mdev->ldev->md.uuid[UI_BITMAP] &= ~((u64)1);
- trace_drbd_uuid(mdev, UI_BITMAP);
}
drbd_md_mark_dirty(mdev);
}
@@ -3727,7 +3694,6 @@ const char *drbd_buildtag(void)
module_init(drbd_init)
module_exit(drbd_cleanup)
-/* For drbd_tracing: */
EXPORT_SYMBOL(drbd_conn_str);
EXPORT_SYMBOL(drbd_role_str);
EXPORT_SYMBOL(drbd_disk_str);
diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c
index cfde31002df..73c55ccb629 100644
--- a/drivers/block/drbd/drbd_nl.c
+++ b/drivers/block/drbd/drbd_nl.c
@@ -33,7 +33,6 @@
#include <linux/blkpg.h>
#include <linux/cpumask.h>
#include "drbd_int.h"
-#include "drbd_tracing.h"
#include "drbd_wrappers.h"
#include <asm/unaligned.h>
#include <linux/drbd_tag_magic.h>
@@ -2024,8 +2023,6 @@ static void drbd_connector_callback(struct cn_msg *req)
goto fail;
}
- trace_drbd_netlink(req, 1);
-
if (nlp->packet_type >= P_nl_after_last_packet) {
retcode = ERR_PACKET_NR;
goto fail;
@@ -2063,7 +2060,6 @@ static void drbd_connector_callback(struct cn_msg *req)
cn_reply->len = sizeof(struct drbd_nl_cfg_reply) + rr;
cn_reply->flags = 0;
- trace_drbd_netlink(cn_reply, 0);
rr = cn_netlink_send(cn_reply, CN_IDX_DRBD, GFP_KERNEL);
if (rr && rr != -ESRCH)
printk(KERN_INFO "drbd: cn_netlink_send()=%d\n", rr);
@@ -2157,7 +2153,6 @@ void drbd_bcast_state(struct drbd_conf *mdev, union drbd_state state)
reply->minor = mdev_to_minor(mdev);
reply->ret_code = NO_ERROR;
- trace_drbd_netlink(cn_reply, 0);
cn_netlink_send(cn_reply, CN_IDX_DRBD, GFP_NOIO);
}
@@ -2190,7 +2185,6 @@ void drbd_bcast_ev_helper(struct drbd_conf *mdev, char *helper_name)
reply->minor = mdev_to_minor(mdev);
reply->ret_code = NO_ERROR;
- trace_drbd_netlink(cn_reply, 0);
cn_netlink_send(cn_reply, CN_IDX_DRBD, GFP_NOIO);
}
@@ -2262,7 +2256,6 @@ void drbd_bcast_ee(struct drbd_conf *mdev,
reply->minor = mdev_to_minor(mdev);
reply->ret_code = NO_ERROR;
- trace_drbd_netlink(cn_reply, 0);
cn_netlink_send(cn_reply, CN_IDX_DRBD, GFP_NOIO);
kfree(cn_reply);
}
@@ -2302,7 +2295,6 @@ void drbd_bcast_sync_progress(struct drbd_conf *mdev)
reply->minor = mdev_to_minor(mdev);
reply->ret_code = NO_ERROR;
- trace_drbd_netlink(cn_reply, 0);
cn_netlink_send(cn_reply, CN_IDX_DRBD, GFP_NOIO);
}
@@ -2356,7 +2348,6 @@ void drbd_nl_send_reply(struct cn_msg *req, int ret_code)
reply->minor = ((struct drbd_nl_cfg_req *)req->data)->drbd_minor;
reply->ret_code = ret_code;
- trace_drbd_netlink(cn_reply, 0);
rr = cn_netlink_send(cn_reply, CN_IDX_DRBD, GFP_NOIO);
if (rr && rr != -ESRCH)
printk(KERN_INFO "drbd: cn_netlink_send()=%d\n", rr);
diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c
index 2f81821c2e0..360baf60f57 100644
--- a/drivers/block/drbd/drbd_receiver.c
+++ b/drivers/block/drbd/drbd_receiver.c
@@ -47,7 +47,6 @@
#include <linux/string.h>
#include <linux/scatterlist.h>
#include "drbd_int.h"
-#include "drbd_tracing.h"
#include "drbd_req.h"
#include "drbd_vli.h"
@@ -350,8 +349,6 @@ struct drbd_epoch_entry *drbd_alloc_ee(struct drbd_conf *mdev,
e->epoch = NULL;
e->flags = 0;
- trace_drbd_ee(mdev, e, "allocated");
-
return e;
fail2:
@@ -366,7 +363,6 @@ struct drbd_epoch_entry *drbd_alloc_ee(struct drbd_conf *mdev,
void drbd_free_ee(struct drbd_conf *mdev, struct drbd_epoch_entry *e)
{
struct bio *bio = e->private_bio;
- trace_drbd_ee(mdev, e, "freed");
drbd_pp_free_bio_pages(mdev, bio);
bio_put(bio);
D_ASSERT(hlist_unhashed(&e->colision));
@@ -420,7 +416,6 @@ static int drbd_process_done_ee(struct drbd_conf *mdev)
* all ignore the last argument.
*/
list_for_each_entry_safe(e, t, &work_list, w.list) {
- trace_drbd_ee(mdev, e, "process_done_ee");
/* list_del not necessary, next/prev members not touched */
ok = e->w.cb(mdev, &e->w, !ok) && ok;
drbd_free_ee(mdev, e);
@@ -1021,8 +1016,6 @@ static enum finish_epoch drbd_may_finish_epoch(struct drbd_conf *mdev,
break;
}
- trace_drbd_epoch(mdev, epoch, ev);
-
if (epoch_size != 0 &&
atomic_read(&epoch->active) == 0 &&
test_bit(DE_HAVE_BARRIER_NUMBER, &epoch->flags) &&
@@ -1054,7 +1047,6 @@ static enum finish_epoch drbd_may_finish_epoch(struct drbd_conf *mdev,
list_del(&epoch->list);
ev = EV_BECAME_LAST | (ev & EV_CLEANUP);
mdev->epochs--;
- trace_drbd_epoch(mdev, epoch, EV_TRACE_FREE);
kfree(epoch);
if (rv == FE_STILL_LIVE)
@@ -1080,7 +1072,6 @@ static enum finish_epoch drbd_may_finish_epoch(struct drbd_conf *mdev,
struct flush_work *fw;
fw = kmalloc(sizeof(*fw), GFP_ATOMIC);
if (fw) {
- trace_drbd_epoch(mdev, epoch, EV_TRACE_FLUSH);
fw->w.cb = w_flush;
fw->epoch = epoch;
drbd_queue_work(&mdev->data.work, &fw->w);
@@ -1251,7 +1242,6 @@ static int receive_Barrier(struct drbd_conf *mdev, struct p_header *h)
list_add(&epoch->list, &mdev->current_epoch->list);
mdev->current_epoch = epoch;
mdev->epochs++;
- trace_drbd_epoch(mdev, epoch, EV_TRACE_ALLOC);
} else {
/* The current_epoch got recycled while we allocated this one... */
kfree(epoch);
@@ -1458,8 +1448,6 @@ static int recv_resync_read(struct drbd_conf *mdev, sector_t sector, int data_si
list_add(&e->w.list, &mdev->sync_ee);
spin_unlock_irq(&mdev->req_lock);
- trace_drbd_ee(mdev, e, "submitting for (rs)write");
- trace_drbd_bio(mdev, "Sec", e->private_bio, 0, NULL);
drbd_generic_make_request(mdev, DRBD_FAULT_RS_WR, e->private_bio);
/* accounting done in endio */
@@ -1721,16 +1709,13 @@ static int receive_Data(struct drbd_conf *mdev, struct p_header *h)
epoch = list_entry(e->epoch->list.prev, struct drbd_epoch, list);
if (epoch == e->epoch) {
set_bit(DE_CONTAINS_A_BARRIER, &e->epoch->flags);
- trace_drbd_epoch(mdev, e->epoch, EV_TRACE_ADD_BARRIER);
rw |= (1<<BIO_RW_BARRIER);
e->flags |= EE_IS_BARRIER;
} else {
if (atomic_read(&epoch->epoch_size) > 1 ||
!test_bit(DE_CONTAINS_A_BARRIER, &epoch->flags)) {
set_bit(DE_BARRIER_IN_NEXT_EPOCH_ISSUED, &epoch->flags);
- trace_drbd_epoch(mdev, epoch, EV_TRACE_SETTING_BI);
set_bit(DE_CONTAINS_A_BARRIER, &e->epoch->flags);
- trace_drbd_epoch(mdev, e->epoch, EV_TRACE_ADD_BARRIER);
rw |= (1<<BIO_RW_BARRIER);
e->flags |= EE_IS_BARRIER;
}
@@ -1905,8 +1890,6 @@ static int receive_Data(struct drbd_conf *mdev, struct p_header *h)
}
e->private_bio->bi_rw = rw;
- trace_drbd_ee(mdev, e, "submitting for (data)write");
- trace_drbd_bio(mdev, "Sec", e->private_bio, 0, NULL);
drbd_generic_make_request(mdev, DRBD_FAULT_DT_WR, e->private_bio);
/* accounting done in endio */
@@ -2065,8 +2048,6 @@ static int receive_DataRequest(struct drbd_conf *mdev, struct p_header *h)
inc_unacked(mdev);
- trace_drbd_ee(mdev, e, "submitting for read");
- trace_drbd_bio(mdev, "Sec", e->private_bio, 0, NULL);
drbd_generic_make_request(mdev, fault_type, e->private_bio);
maybe_kick_lo(mdev);
@@ -3543,9 +3524,6 @@ static void drbdd(struct drbd_conf *mdev)
drbd_force_state(mdev, NS(conn, C_PROTOCOL_ERROR));
break;
}
-
- trace_drbd_packet(mdev, mdev->data.socket, 2, &mdev->data.rbuf,
- __FILE__, __LINE__);
}
}
@@ -3825,9 +3803,6 @@ static int drbd_do_handshake(struct drbd_conf *mdev)
return 0;
}
- trace_drbd_packet(mdev, mdev->data.socket, 2, &mdev->data.rbuf,
- __FILE__, __LINE__);
-
p->protocol_min = be32_to_cpu(p->protocol_min);
p->protocol_max = be32_to_cpu(p->protocol_max);
if (p->protocol_max == 0)
@@ -4420,14 +4395,11 @@ int drbd_asender(struct drbd_thread *thi)
goto disconnect;
}
expect = cmd->pkt_size;
- ERR_IF(len != expect-sizeof(struct p_header)) {
- trace_drbd_packet(mdev, mdev->meta.socket, 1, (void *)h, __FILE__, __LINE__);
+ ERR_IF(len != expect-sizeof(struct p_header))
goto reconnect;
- }
}
if (received == expect) {
D_ASSERT(cmd != NULL);
- trace_drbd_packet(mdev, mdev->meta.socket, 1, (void *)h, __FILE__, __LINE__);
if (!cmd->process(mdev, h))
goto reconnect;
diff --git a/drivers/block/drbd/drbd_req.c b/drivers/block/drbd/drbd_req.c
index 1aaa397669a..3678d3d66c6 100644
--- a/drivers/block/drbd/drbd_req.c
+++ b/drivers/block/drbd/drbd_req.c
@@ -28,7 +28,6 @@
#include <linux/slab.h>
#include <linux/drbd.h>
#include "drbd_int.h"
-#include "drbd_tracing.h"
#include "drbd_req.h"
@@ -218,7 +217,6 @@ static void _about_to_complete_local_write(struct drbd_conf *mdev,
void complete_master_bio(struct drbd_conf *mdev,
struct bio_and_error *m)
{
- trace_drbd_bio(mdev, "Rq", m->bio, 1, NULL);
bio_endio(m->bio, m->error);
dec_ap_bio(mdev);
}
@@ -236,8 +234,6 @@ void _req_may_be_done(struct drbd_request *req, struct bio_and_error *m)
/* only WRITES may end up here without a master bio (on barrier ack) */
int rw = req->master_bio ? bio_data_dir(req->master_bio) : WRITE;
- trace_drbd_req(req, nothing, "_req_may_be_done");
-
/* we must not complete the master bio, while it is
* still being processed by _drbd_send_zc_bio (drbd_send_dblock)
* not yet acknowledged by the peer
@@ -415,8 +411,6 @@ void __req_mod(struct drbd_request *req, enum drbd_req_event what,
struct drbd_conf *mdev = req->mdev;
m->bio = NULL;
- trace_drbd_req(req, what, NULL);
-
switch (what) {
default:
dev_err(DEV, "LOGIC BUG in %s:%u\n", __FILE__ , __LINE__);
@@ -666,7 +660,6 @@ void __req_mod(struct drbd_request *req, enum drbd_req_event what,
* this is bad, because if the connection is lost now,
* we won't be able to clean them up... */
dev_err(DEV, "FIXME (barrier_acked but pending)\n");
- trace_drbd_req(req, nothing, "FIXME (barrier_acked but pending)");
list_move(&req->tl_requests, &mdev->out_of_sequence_requests);
}
D_ASSERT(req->rq_state & RQ_NET_SENT);
@@ -736,8 +729,6 @@ static int drbd_make_request_common(struct drbd_conf *mdev, struct bio *bio)
return 0;
}
- trace_drbd_bio(mdev, "Rq", bio, 0, req);
-
local = get_ldev(mdev);
if (!local) {
bio_put(req->private_bio); /* or we get a bio leak */
@@ -928,8 +919,6 @@ allocate_barrier:
if (local) {
req->private_bio->bi_bdev = mdev->ldev->backing_bdev;
- trace_drbd_bio(mdev, "Pri", req->private_bio, 0, NULL);
-
if (FAULT_ACTIVE(mdev, rw == WRITE ? DRBD_FAULT_DT_WR
: rw == READ ? DRBD_FAULT_DT_RD
: DRBD_FAULT_DT_RA))
diff --git a/drivers/block/drbd/drbd_tracing.c b/drivers/block/drbd/drbd_tracing.c
deleted file mode 100644
index d18d4f7b4be..00000000000
--- a/drivers/block/drbd/drbd_tracing.c
+++ /dev/null
@@ -1,752 +0,0 @@
-/*
- drbd_tracing.c
-
- This file is part of DRBD by Philipp Reisner and Lars Ellenberg.
-
- Copyright (C) 2003-2008, LINBIT Information Technologies GmbH.
- Copyright (C) 2003-2008, Philipp Reisner <philipp.reisner@linbit.com>.
- Copyright (C) 2003-2008, Lars Ellenberg <lars.ellenberg@linbit.com>.
-
- drbd is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- drbd is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with drbd; see the file COPYING. If not, write to
- the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
-
- */
-
-#include <linux/module.h>
-#include <linux/drbd.h>
-#include <linux/ctype.h>
-#include "drbd_int.h"
-#include "drbd_tracing.h"
-#include <linux/drbd_tag_magic.h>
-
-MODULE_LICENSE("GPL");
-MODULE_AUTHOR("Philipp Reisner, Lars Ellenberg");
-MODULE_DESCRIPTION("DRBD tracepoint probes");
-MODULE_PARM_DESC(trace_mask, "Bitmap of events to trace see drbd_tracing.c");
-MODULE_PARM_DESC(trace_level, "Current tracing level (changeable in /sys)");
-MODULE_PARM_DESC(trace_devs, "Bitmap of devices to trace (changeable in /sys)");
-
-unsigned int trace_mask = 0; /* Bitmap of events to trace */
-int trace_level; /* Current trace level */
-int trace_devs; /* Bitmap of devices to trace */
-
-module_param(trace_mask, uint, 0444);
-module_param(trace_level, int, 0644);
-module_param(trace_devs, int, 0644);
-
-enum {
- TRACE_PACKET = 0x0001,
- TRACE_RQ = 0x0002,
- TRACE_UUID = 0x0004,
- TRACE_RESYNC = 0x0008,
- TRACE_EE = 0x0010,
- TRACE_UNPLUG = 0x0020,
- TRACE_NL = 0x0040,
- TRACE_AL_EXT = 0x0080,
- TRACE_INT_RQ = 0x0100,
- TRACE_MD_IO = 0x0200,
- TRACE_EPOCH = 0x0400,
-};
-
-/* Buffer printing support
- * dbg_print_flags: used for Flags arg to drbd_print_buffer
- * - DBGPRINT_BUFFADDR; if set, each line starts with the
- * virtual address of the line being output. If clear,
- * each line starts with the offset from the beginning
- * of the buffer. */
-enum dbg_print_flags {
- DBGPRINT_BUFFADDR = 0x0001,
-};
-
-/* Macro stuff */
-static char *nl_packet_name(int packet_type)
-{
-/* Generate packet type strings */
-#define NL_PACKET(name, number, fields) \
- [P_ ## name] = # name,
-#define NL_INTEGER Argh!
-#define NL_BIT Argh!
-#define NL_INT64 Argh!
-#define NL_STRING Argh!
-
- static char *nl_tag_name[P_nl_after_last_packet] = {
-#include "linux/drbd_nl.h"
- };
-
- return (packet_type < sizeof(nl_tag_name)/sizeof(nl_tag_name[0])) ?
- nl_tag_name[packet_type] : "*Unknown*";
-}
-/* /Macro stuff */
-
-static inline int is_mdev_trace(struct drbd_conf *mdev, unsigned int level)
-{
- return trace_level >= level && ((1 << mdev_to_minor(mdev)) & trace_devs);
-}
-
-static void probe_drbd_unplug(struct drbd_conf *mdev, char *msg)
-{
- if (!is_mdev_trace(mdev, TRACE_LVL_ALWAYS))
- return;
-
- dev_info(DEV, "%s, ap_bio_count=%d\n", msg, atomic_read(&mdev->ap_bio_cnt));
-}
-
-static void probe_drbd_uuid(struct drbd_conf *mdev, enum drbd_uuid_index index)
-{
- static char *uuid_str[UI_EXTENDED_SIZE] = {
- [UI_CURRENT] = "CURRENT",
- [UI_BITMAP] = "BITMAP",
- [UI_HISTORY_START] = "HISTORY_START",
- [UI_HISTORY_END] = "HISTORY_END",
- [UI_SIZE] = "SIZE",
- [UI_FLAGS] = "FLAGS",
- };
-
- if (!is_mdev_trace(mdev, TRACE_LVL_ALWAYS))
- return;
-
- if (index >= UI_EXTENDED_SIZE) {
- dev_warn(DEV, " uuid_index >= EXTENDED_SIZE\n");
- return;
- }
-
- dev_info(DEV, " uuid[%s] now %016llX\n",
- uuid_str[index],
- (unsigned long long)mdev->ldev->md.uuid[index]);
-}
-
-static void probe_drbd_md_io(struct drbd_conf *mdev, int rw,
- struct drbd_backing_dev *bdev)
-{
- if (!is_mdev_trace(mdev, TRACE_LVL_ALWAYS))
- return;
-
- dev_info(DEV, " %s metadata superblock now\n",
- rw == READ ? "Reading" : "Writing");
-}
-
-static void probe_drbd_ee(struct drbd_conf *mdev, struct drbd_epoch_entry *e, char* msg)
-{
- if (!is_mdev_trace(mdev, TRACE_LVL_ALWAYS))
- return;
-
- dev_info(DEV, "EE %s sec=%llus size=%u e=%p\n",
- msg, (unsigned long long)e->sector, e->size, e);
-}
-
-static void probe_drbd_epoch(struct drbd_conf *mdev, struct drbd_epoch *epoch,
- enum epoch_event ev)
-{
- static char *epoch_event_str[] = {
- [EV_PUT] = "put",
- [EV_GOT_BARRIER_NR] = "got_barrier_nr",
- [EV_BARRIER_DONE] = "barrier_done",
- [EV_BECAME_LAST] = "became_last",
- [EV_TRACE_FLUSH] = "issuing_flush",
- [EV_TRACE_ADD_BARRIER] = "added_barrier",
- [EV_TRACE_SETTING_BI] = "just set barrier_in_next_epoch",
- };
-
- if (!is_mdev_trace(mdev, TRACE_LVL_ALWAYS))
- return;
-
- ev &= ~EV_CLEANUP;
-
- switch (ev) {
- case EV_TRACE_ALLOC:
- dev_info(DEV, "Allocate epoch %p/xxxx { } nr_epochs=%d\n", epoch, mdev->epochs);
- break;
- case EV_TRACE_FREE:
- dev_info(DEV, "Freeing epoch %p/%d { size=%d } nr_epochs=%d\n",
- epoch, epoch->barrier_nr, atomic_read(&epoch->epoch_size),
- mdev->epochs);
- break;
- default:
- dev_info(DEV, "Update epoch %p/%d { size=%d active=%d %c%c n%c%c } ev=%s\n",
- epoch, epoch->barrier_nr, atomic_read(&epoch->epoch_size),
- atomic_read(&epoch->active),
- test_bit(DE_HAVE_BARRIER_NUMBER, &epoch->flags) ? 'n' : '-',
- test_bit(DE_CONTAINS_A_BARRIER, &epoch->flags) ? 'b' : '-',
- test_bit(DE_BARRIER_IN_NEXT_EPOCH_ISSUED, &epoch->flags) ? 'i' : '-',
- test_bit(DE_BARRIER_IN_NEXT_EPOCH_DONE, &epoch->flags) ? 'd' : '-',
- epoch_event_str[ev]);
- }
-}
-
-static void probe_drbd_netlink(void *data, int is_req)
-{
- struct cn_msg *msg = data;
-
- if (is_req) {
- struct drbd_nl_cfg_req *nlp = (struct drbd_nl_cfg_req *)msg->data;
-
- printk(KERN_INFO "drbd%d: "
- "Netlink: << %s (%d) - seq: %x, ack: %x, len: %x\n",
- nlp->drbd_minor,
- nl_packet_name(nlp->packet_type),
- nlp->packet_type,
- msg->seq, msg->ack, msg->len);
- } else {
- struct drbd_nl_cfg_reply *nlp = (struct drbd_nl_cfg_reply *)msg->data;
-
- printk(KERN_INFO "drbd%d: "
- "Netlink: >> %s (%d) - seq: %x, ack: %x, len: %x\n",
- nlp->minor,
- nlp->packet_type == P_nl_after_last_packet ?
- "Empty-Reply" : nl_packet_name(nlp->packet_type),
- nlp->packet_type,
- msg->seq, msg->ack, msg->len);
- }
-}
-
-static void probe_drbd_actlog(struct drbd_conf *mdev, sector_t sector, char* msg)
-{
- unsigned int enr = (sector >> (AL_EXTENT_SHIFT-9));
-
- if (!is_mdev_trace(mdev, TRACE_LVL_ALWAYS))
- return;
-
- dev_info(DEV, "%s (sec=%llus, al_enr=%u, rs_enr=%d)\n",
- msg, (unsigned long long) sector, enr,
- (int)BM_SECT_TO_EXT(sector));
-}
-
-/**
- * drbd_print_buffer() - Hexdump arbitrary binary data into a buffer
- * @prefix: String is output at the beginning of each line output.
- * @flags: Currently only defined flag: DBGPRINT_BUFFADDR; if set, each
- * line starts with the virtual address of the line being
- * output. If clear, each line starts with the offset from the
- * beginning of the buffer.
- * @size: Indicates the size of each entry in the buffer. Supported
- * values are sizeof(char), sizeof(short) and sizeof(int)
- * @buffer: Start address of buffer
- * @buffer_va: Virtual address of start of buffer (normally the same
- * as Buffer, but having it separate allows it to hold
- * file address for example)
- * @length: length of buffer
- */
-static void drbd_print_buffer(const char *prefix, unsigned int flags, int size,
- const void *buffer, const void *buffer_va,
- unsigned int length)
-
-#define LINE_SIZE 16
-#define LINE_ENTRIES (int)(LINE_SIZE/size)
-{
- const unsigned char *pstart;
- const unsigned char *pstart_va;
- const unsigned char *pend;
- char bytes_str[LINE_SIZE*3+8], ascii_str[LINE_SIZE+8];
- char *pbytes = bytes_str, *pascii = ascii_str;
- int offset = 0;
- long sizemask;
- int field_width;
- int index;
- const unsigned char *pend_str;
- const unsigned char *p;
- int count;
-
- /* verify size parameter */
- if (size != sizeof(char) &&
- size != sizeof(short) &&
- size != sizeof(int)) {
- printk(KERN_DEBUG "drbd_print_buffer: "
- "ERROR invalid size %d\n", size);
- return;
- }
-
- sizemask = size-1;<