scoutfs: replace trace_printk in alloc.c

Signed-off-by: Mark Fasheh <mfasheh@versity.com>
This commit is contained in:
Mark Fasheh
2017-09-28 13:59:49 -07:00
committed by Mark Fasheh
parent 215ba7d4ad
commit 3a5093c6ae
2 changed files with 54 additions and 4 deletions
+3 -3
View File
@@ -21,6 +21,7 @@
#include "cmp.h"
#include "alloc.h"
#include "counters.h"
#include "scoutfs_trace.h"
/*
* scoutfs allocates segments using regions of an allocation bitmap
@@ -190,7 +191,7 @@ out:
}
up_write(&sal->rwsem);
trace_printk("segno %llu ret %d\n", *segno, ret);
trace_scoutfs_alloc_segno(sb, *segno, ret);
return ret;
}
@@ -231,8 +232,7 @@ int scoutfs_alloc_free(struct super_block *sb, u64 segno)
out:
up_write(&sal->rwsem);
trace_printk("freeing segno %llu ind %llu nr %d ret %d\n",
segno, ind, nr, ret);
trace_scoutfs_alloc_free(sb, segno, ind, nr, ret);
return ret;
}
+51 -1
View File
@@ -31,8 +31,58 @@
#include "kvec.h"
#include "lock.h"
#include "seg.h"
#include "super.h"
struct scoutfs_sb_info;
#define FSID_ARG(sb) le64_to_cpu(SCOUTFS_SB(sb)->super.hdr.fsid)
#define FSID_FMT "%llx"
TRACE_EVENT(scoutfs_alloc_free,
TP_PROTO(struct super_block *sb, __u64 segno, __u64 index, int nr,
int ret),
TP_ARGS(sb, segno, index, nr, ret),
TP_STRUCT__entry(
__field(__u64, fsid)
__field(__u64, segno)
__field(__u64, index)
__field(int, nr)
__field(int, ret)
),
TP_fast_assign(
__entry->fsid = FSID_ARG(sb);
__entry->segno = segno;
__entry->index = index;
__entry->nr = nr;
__entry->ret = ret;
),
TP_printk(FSID_FMT" freeing segno %llu ind %llu nr %d ret %d",
__entry->fsid, __entry->segno, __entry->index, __entry->nr,
__entry->ret)
);
TRACE_EVENT(scoutfs_alloc_segno,
TP_PROTO(struct super_block *sb, __u64 segno, int ret),
TP_ARGS(sb, segno, ret),
TP_STRUCT__entry(
__field(__u64, fsid)
__field(__u64, segno)
__field(int, ret)
),
TP_fast_assign(
__entry->fsid = FSID_ARG(sb);
__entry->segno = segno;
__entry->ret = ret;
),
TP_printk(FSID_FMT" segno %llu ret %d", __entry->fsid, __entry->segno,
__entry->ret)
);
TRACE_EVENT(scoutfs_write_begin,
TP_PROTO(u64 ino, loff_t pos, unsigned len),