mirror of
https://github.com/versity/scoutfs.git
synced 2026-02-12 13:31:12 +00:00
scoutfs: replace trace_printk in bio.c
Signed-off-by: Mark Fasheh <mfasheh@versity.com>
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
#include "super.h"
|
||||
#include "format.h"
|
||||
#include "bio.h"
|
||||
#include "scoutfs_trace.h"
|
||||
|
||||
struct bio_end_io_args {
|
||||
struct super_block *sb;
|
||||
@@ -32,8 +33,8 @@ static void dec_end_io(struct bio_end_io_args *args, int err)
|
||||
if (err && !args->err)
|
||||
args->err = err;
|
||||
|
||||
trace_printk("args %p in_flight %d err %d\n",
|
||||
args, atomic_read(&args->in_flight), err);
|
||||
trace_scoutfs_dec_end_io(args->sb, args, atomic_read(&args->in_flight),
|
||||
err);
|
||||
|
||||
if (atomic_dec_and_test(&args->in_flight)) {
|
||||
args->end_io(args->sb, args->data, args->err);
|
||||
@@ -45,7 +46,7 @@ static void bio_end_io(struct bio *bio, int err)
|
||||
{
|
||||
struct bio_end_io_args *args = bio->bi_private;
|
||||
|
||||
trace_printk("bio %p size %u err %d \n", bio, bio->bi_size, err);
|
||||
trace_scoutfs_bio_end_io(args->sb, bio, bio->bi_size, err);
|
||||
|
||||
dec_end_io(args, err);
|
||||
bio_put(bio);
|
||||
@@ -113,15 +114,15 @@ void scoutfs_bio_submit(struct super_block *sb, int rw, struct page **pages,
|
||||
if (bio_add_page(bio, page, bytes, 0) != bytes) {
|
||||
/* submit the full bio and retry this page */
|
||||
atomic_inc(&args->in_flight);
|
||||
trace_printk("bio %p args %p in_flight %d\n",
|
||||
bio, args, atomic_read(&args->in_flight));
|
||||
trace_scoutfs_bio_submit(sb, bio, args,
|
||||
atomic_read(&args->in_flight));
|
||||
submit_bio(rw, bio);
|
||||
bio = NULL;
|
||||
i--;
|
||||
continue;
|
||||
}
|
||||
|
||||
trace_printk("added page %p to bio %p\n", page, bio);
|
||||
trace_scoutfs_bio_submit_added(sb, page, bio);
|
||||
|
||||
blkno += SCOUTFS_BLOCKS_PER_PAGE;
|
||||
nr_blocks -= SCOUTFS_BLOCKS_PER_PAGE;
|
||||
@@ -129,8 +130,8 @@ void scoutfs_bio_submit(struct super_block *sb, int rw, struct page **pages,
|
||||
|
||||
if (bio) {
|
||||
atomic_inc(&args->in_flight);
|
||||
trace_printk("bio %p args %p in_flight %d\n",
|
||||
bio, args, atomic_read(&args->in_flight));
|
||||
trace_scoutfs_bio_submit_partial(sb, bio, args,
|
||||
atomic_read(&args->in_flight));
|
||||
submit_bio(rw, bio);
|
||||
}
|
||||
|
||||
@@ -144,7 +145,7 @@ void scoutfs_bio_init_comp(struct scoutfs_bio_completion *comp)
|
||||
atomic_set(&comp->pending, 1);
|
||||
init_completion(&comp->comp);
|
||||
comp->err = 0;
|
||||
trace_printk("initing comp %p\n", comp);
|
||||
trace_scoutfs_bio_init_comp(comp);
|
||||
}
|
||||
|
||||
static void comp_end_io(struct super_block *sb, void *data, int err)
|
||||
@@ -154,8 +155,7 @@ static void comp_end_io(struct super_block *sb, void *data, int err)
|
||||
if (err && !comp->err)
|
||||
comp->err = err;
|
||||
|
||||
trace_printk("ending comp %p pending before %d\n",
|
||||
comp, atomic_read(&comp->pending));
|
||||
trace_comp_end_io(sb, comp);
|
||||
|
||||
if (atomic_dec_and_test(&comp->pending))
|
||||
complete(&comp->comp);
|
||||
@@ -167,8 +167,7 @@ void scoutfs_bio_submit_comp(struct super_block *sb, int rw,
|
||||
struct scoutfs_bio_completion *comp)
|
||||
{
|
||||
atomic_inc(&comp->pending);
|
||||
trace_printk("submitting comp %p pending before %d\n",
|
||||
comp, atomic_read(&comp->pending));
|
||||
trace_scoutfs_bio_submit_comp(sb, comp);
|
||||
|
||||
scoutfs_bio_submit(sb, rw, pages, blkno, nr_blocks, comp_end_io, comp);
|
||||
}
|
||||
@@ -177,7 +176,7 @@ int scoutfs_bio_wait_comp(struct super_block *sb,
|
||||
struct scoutfs_bio_completion *comp)
|
||||
{
|
||||
comp_end_io(sb, comp, 0);
|
||||
trace_printk("waiting for comp %p\n", comp);
|
||||
trace_scoutfs_bio_wait_comp(sb, comp);
|
||||
wait_for_completion(&comp->comp);
|
||||
return comp->err;
|
||||
}
|
||||
|
||||
@@ -34,12 +34,162 @@
|
||||
#include "super.h"
|
||||
#include "ioctl.h"
|
||||
#include "count.h"
|
||||
#include "bio.h"
|
||||
|
||||
struct lock_info;
|
||||
|
||||
#define FSID_ARG(sb) le64_to_cpu(SCOUTFS_SB(sb)->super.hdr.fsid)
|
||||
#define FSID_FMT "%llx"
|
||||
|
||||
DECLARE_EVENT_CLASS(scoutfs_comp_class,
|
||||
TP_PROTO(struct super_block *sb, struct scoutfs_bio_completion *comp),
|
||||
|
||||
TP_ARGS(sb, comp),
|
||||
|
||||
TP_STRUCT__entry(
|
||||
__field(__u64, fsid)
|
||||
__field(struct scoutfs_bio_completion *, comp)
|
||||
__field(int, pending)
|
||||
),
|
||||
|
||||
TP_fast_assign(
|
||||
__entry->fsid = FSID_ARG(sb);
|
||||
__entry->comp = comp;
|
||||
__entry->pending = atomic_read(&comp->pending);
|
||||
),
|
||||
|
||||
TP_printk(FSID_FMT" comp %p pending before %d", __entry->fsid,
|
||||
__entry->comp, __entry->pending)
|
||||
);
|
||||
DEFINE_EVENT(scoutfs_comp_class, comp_end_io,
|
||||
TP_PROTO(struct super_block *sb, struct scoutfs_bio_completion *comp),
|
||||
TP_ARGS(sb, comp)
|
||||
);
|
||||
DEFINE_EVENT(scoutfs_comp_class, scoutfs_bio_submit_comp,
|
||||
TP_PROTO(struct super_block *sb, struct scoutfs_bio_completion *comp),
|
||||
TP_ARGS(sb, comp)
|
||||
);
|
||||
DEFINE_EVENT(scoutfs_comp_class, scoutfs_bio_wait_comp,
|
||||
TP_PROTO(struct super_block *sb, struct scoutfs_bio_completion *comp),
|
||||
TP_ARGS(sb, comp)
|
||||
);
|
||||
|
||||
TRACE_EVENT(scoutfs_bio_init_comp,
|
||||
TP_PROTO(void *comp),
|
||||
|
||||
TP_ARGS(comp),
|
||||
|
||||
TP_STRUCT__entry(
|
||||
__field(void *, comp)
|
||||
),
|
||||
|
||||
TP_fast_assign(
|
||||
__entry->comp = comp;
|
||||
),
|
||||
|
||||
TP_printk("initing comp %p", __entry->comp)
|
||||
);
|
||||
|
||||
TRACE_EVENT(scoutfs_bio_submit_added,
|
||||
TP_PROTO(struct super_block *sb, void *page, void *bio),
|
||||
|
||||
TP_ARGS(sb, page, bio),
|
||||
|
||||
TP_STRUCT__entry(
|
||||
__field(__u64, fsid)
|
||||
__field(void *, page)
|
||||
__field(void *, bio)
|
||||
),
|
||||
|
||||
TP_fast_assign(
|
||||
__entry->fsid = FSID_ARG(sb);
|
||||
__entry->page = page;
|
||||
__entry->bio = bio;
|
||||
),
|
||||
|
||||
TP_printk(FSID_FMT" added page %p to bio %p", __entry->fsid,
|
||||
__entry->page, __entry->bio)
|
||||
);
|
||||
|
||||
DECLARE_EVENT_CLASS(scoutfs_bio_class,
|
||||
TP_PROTO(struct super_block *sb, void *bio, void *args, int in_flight),
|
||||
|
||||
TP_ARGS(sb, bio, args, in_flight),
|
||||
|
||||
TP_STRUCT__entry(
|
||||
__field(__u64, fsid)
|
||||
__field(void *, bio)
|
||||
__field(void *, args)
|
||||
__field(int, in_flight)
|
||||
),
|
||||
|
||||
TP_fast_assign(
|
||||
__entry->fsid = FSID_ARG(sb);
|
||||
__entry->bio = bio;
|
||||
__entry->args = args;
|
||||
__entry->in_flight = in_flight;
|
||||
),
|
||||
|
||||
TP_printk(FSID_FMT" bio %p args %p in_flight %d", __entry->fsid,
|
||||
__entry->bio, __entry->args, __entry->in_flight)
|
||||
);
|
||||
|
||||
DEFINE_EVENT(scoutfs_bio_class, scoutfs_bio_submit,
|
||||
TP_PROTO(struct super_block *sb, void *bio, void *args, int in_flight),
|
||||
TP_ARGS(sb, bio, args, in_flight)
|
||||
);
|
||||
|
||||
DEFINE_EVENT(scoutfs_bio_class, scoutfs_bio_submit_partial,
|
||||
TP_PROTO(struct super_block *sb, void *bio, void *args, int in_flight),
|
||||
TP_ARGS(sb, bio, args, in_flight)
|
||||
);
|
||||
|
||||
TRACE_EVENT(scoutfs_bio_end_io,
|
||||
TP_PROTO(struct super_block *sb, void *bio, int size, int err),
|
||||
|
||||
TP_ARGS(sb, bio, size, err),
|
||||
|
||||
TP_STRUCT__entry(
|
||||
__field(__u64, fsid)
|
||||
__field(void *, bio)
|
||||
__field(int, size)
|
||||
__field(int, err)
|
||||
),
|
||||
|
||||
TP_fast_assign(
|
||||
__entry->fsid = FSID_ARG(sb);
|
||||
__entry->bio = bio;
|
||||
__entry->size = size;
|
||||
__entry->err = err;
|
||||
),
|
||||
|
||||
TP_printk(FSID_FMT" bio %p size %u err %d", __entry->fsid,
|
||||
__entry->bio, __entry->size, __entry->err)
|
||||
);
|
||||
|
||||
TRACE_EVENT(scoutfs_dec_end_io,
|
||||
TP_PROTO(struct super_block *sb, void *args, int in_flight, int err),
|
||||
|
||||
TP_ARGS(sb, args, in_flight, err),
|
||||
|
||||
TP_STRUCT__entry(
|
||||
__field(__u64, fsid)
|
||||
__field(void *, args)
|
||||
__field(int, in_flight)
|
||||
__field(int, err)
|
||||
),
|
||||
|
||||
TP_fast_assign(
|
||||
__entry->fsid = FSID_ARG(sb);
|
||||
__entry->args = args;
|
||||
__entry->in_flight = in_flight;
|
||||
__entry->err = err;
|
||||
),
|
||||
|
||||
TP_printk(FSID_FMT" args %p in_flight %d err %d", __entry->fsid,
|
||||
__entry->args, __entry->in_flight, __entry->err)
|
||||
);
|
||||
|
||||
TRACE_EVENT(scoutfs_item_delete_ret,
|
||||
TP_PROTO(struct super_block *sb, int ret),
|
||||
|
||||
|
||||
Reference in New Issue
Block a user