PERFORCE change 194962 for review
Ilya Putsikau
ilya at FreeBSD.org
Sun Jun 19 09:39:59 UTC 2011
http://p4web.freebsd.org/@@194962?ac=10
Change 194962 by ilya at ilya_triton2011 on 2011/06/19 09:39:00
Add per-module debugging. Fix debug format strings
Affected files ...
.. //depot/projects/soc2011/ilya_fuse/fuse_module/Makefile#11 edit
.. //depot/projects/soc2011/ilya_fuse/fuse_module/fuse.h#8 edit
.. //depot/projects/soc2011/ilya_fuse/fuse_module/fuse_device.c#6 edit
.. //depot/projects/soc2011/ilya_fuse/fuse_module/fuse_file.c#4 edit
.. //depot/projects/soc2011/ilya_fuse/fuse_module/fuse_internal.c#11 edit
.. //depot/projects/soc2011/ilya_fuse/fuse_module/fuse_internal.h#11 edit
.. //depot/projects/soc2011/ilya_fuse/fuse_module/fuse_io.c#10 edit
.. //depot/projects/soc2011/ilya_fuse/fuse_module/fuse_ipc.c#6 edit
.. //depot/projects/soc2011/ilya_fuse/fuse_module/fuse_ipc.h#8 edit
.. //depot/projects/soc2011/ilya_fuse/fuse_module/fuse_main.c#6 edit
.. //depot/projects/soc2011/ilya_fuse/fuse_module/fuse_node.c#6 edit
.. //depot/projects/soc2011/ilya_fuse/fuse_module/fuse_vfsops.c#15 edit
.. //depot/projects/soc2011/ilya_fuse/fuse_module/fuse_vnops.c#19 edit
Differences ...
==== //depot/projects/soc2011/ilya_fuse/fuse_module/Makefile#11 (text+ko) ====
@@ -21,6 +21,7 @@
vnode_if.h
CFLAGS+= -I../include
+DEBUG_FLAGS+= -g -DFUSE_DEBUG_VNOPS=1
.if defined(KERNCONF)
KERNCONF1!= echo ${KERNCONF} | sed -e 's/ .*//g'
@@ -32,10 +33,6 @@
CFLAGS+= -DKERNCONFDIR="\"${KERNCONFDIR}\"" -I${KERNCONFDIR}
.endif
-.if defined(DEBUG_MSG)
-DEBUG_FLAGS+= -D_DEBUG_MSG
-.endif
-
KMOD=fuse
.include <bsd.kmod.mk>
==== //depot/projects/soc2011/ilya_fuse/fuse_module/fuse.h#8 (text+ko) ====
@@ -122,113 +122,39 @@
/* Debug related stuff */
-#ifndef DEBUGTOLOG
-#define DEBUGTOLOG 0
+#ifndef FUSE_DEBUG_DEVICE
+#define FUSE_DEBUG_DEVICE 0
#endif
-#if DEBUGTOLOG
-#define dprintf(args ...) log(LOG_DEBUG, args)
-#else
-#define dprintf(args ...) printf(args)
-#endif
-#define DEBLABEL "[fuse-debug] "
-#ifndef _DEBUG
-#define _DEBUG 0
+#ifndef FUSE_DEBUG_FILE
+#define FUSE_DEBUG_FILE 0
#endif
-#if _DEBUG
-#ifndef _DEBUG2G
-#define _DEBUG2G 1
-#endif
-#define DEBUG(args, ...) \
- printf(DEBLABEL "%s <%s@%d>: " args, __func__, __FILE__, __LINE__, ## __VA_ARGS__)
-#else
-#define DEBUG(args ...)
-#endif
-#ifndef _DEBUG2G
-#define _DEBUG2G 0
+#ifndef FUSE_DEBUG_INTERNAL
+#define FUSE_DEBUG_INTERNAL 0
#endif
-#if _DEBUG2G
-#ifndef _DEBUG3G
-#define _DEBUG3G 1
-#endif
-#define DEBUG2G(args, ...) \
- printf(DEBLABEL "%s <%s@%d>: " args, __func__, __FILE__, __LINE__, ## __VA_ARGS__)
-#else
-#define DEBUG2G(args ...)
-#endif
-#ifndef _DEBUG3G
-#define _DEBUG3G 0
-#endif
-#if _DEBUG3G
-#define DEBUG3G(args, ...) \
- printf(DEBLABEL "%s <%s@%d>: " args, __func__, __FILE__, __LINE__, ## __VA_ARGS__)
-#else
-#define DEBUG3G(args ...)
+#ifndef FUSE_DEBUG_IO
+#define FUSE_DEBUG_IO 0
#endif
-#ifndef FMASTER
-#define FMASTER 0
+#ifndef FUSE_DEBUG_IPC
+#define FUSE_DEBUG_IPC 0
#endif
-#if FMASTER
-#ifndef _DEBUG_MSG
-#define _DEBUG_MSG 1
-#endif
-#endif
-#ifndef _DEBUG_MSG
-#define _DEBUG_MSG 0
-#endif
-#if _DEBUG_MSG
-#define DEBUG_MSG(args, ...) \
- printf(DEBLABEL "%s <%s@%d>: " args, __func__, __FILE__, __LINE__, ## __VA_ARGS__)
-#else
-#define DEBUG_MSG(args...)
+#ifndef FUSE_DEBUG_VFSOPS
+#define FUSE_DEBUG_VFSOPS 0
#endif
-#ifndef _DEBUG_UNIQUE
-#if _DEBUG || _DEBUG2G || _DEBUG3G || _DEBUG_MSG
-#define _DEBUG_UNIQUE 1
-#else
-#define _DEBUG_UNIQUE 0
+#ifndef FUSE_DEBUG_VNOPS
+#define FUSE_DEBUG_VNOPS 0
#endif
-#endif
-#ifdef FUSE_TRACE
-#define fuse_trace_printf(fmt, ...) printf(fmt, ## __VA_ARGS__)
-#define fuse_trace_printf_func() printf("%s\n", __FUNCTION__)
-#else
-#define fuse_trace_printf(fmt, ...) {}
-#define fuse_trace_printf_func() {}
+#ifndef FUSE_TRACE
+#define FUSE_TRACE 0
#endif
-#ifdef FUSE_TRACE_OP
-#define fuse_trace_printf_vfsop() printf("%s\n", __FUNCTION__)
-#define fuse_trace_printf_vnop() printf("%s\n", __FUNCTION__)
-#else
-#define fuse_trace_printf_vfsop() {}
-#define fuse_trace_printf_vnop() {}
-#endif
-
-#define debug_printf(fmt, ...) DEBUG(fmt, ## __VA_ARGS__)
-#define kdebug_printf(fmt, ...) DEBUG(fmt, ## __VA_ARGS__)
-
-#if _DEBUG || _DEBUG2G || _DEBUG3G || FMASTER
-extern char *fuse_opnames[];
-extern int fuse_opnames_entries;
-
-struct fuse_iov;
-
-void uprettyprint(char *buf, size_t len);
-void prettyprint(char *buf, size_t len);
-void fprettyprint(struct fuse_iov *fiov, size_t dlen);
-#endif
-
-#if _DEBUG || _DEBUG2G || _DEBUG3G
-#include <sys/kdb.h>
-
-#define bp_print(bp) \
-printf("b_bcount %d, b_data %p, b_error %#x, b_iocmd %#x, b_ioflags %#x, b_iooffset %lld, b_resid %d, b_blkno %d, b_offset %lld, b_flags %#x, b_bufsize %d, b_lblkno %d, b_vp %p, b_vp_ino %llu, b_dirtyoff %d, b_dirtyend %d, b_npages %d\n", \
-(int)(bp)->b_bcount, (bp)->b_data, (bp)->b_error, (bp)->b_iocmd, (bp)->b_ioflags, (long long)(bp)->b_iooffset, (int)(bp)->b_resid, (int)(bp)->b_blkno, (long long)(bp)->b_offset, (bp)->b_flags, (int)(bp)->b_bufsize, (int)(bp)->b_lblkno, (bp)->b_vp, VTOILLU((bp)->b_vp), (int)(bp)->b_dirtyoff, (int)(bp)->b_dirtyend, (int)(bp)->b_npages)
-#endif
+#define DEBUGX(cond, fmt, ...) do { \
+ if (((cond))) { \
+ printf("%s: " fmt, __func__, ## __VA_ARGS__); \
+ } } while (0)
==== //depot/projects/soc2011/ilya_fuse/fuse_module/fuse_device.c#6 (text+ko) ====
@@ -28,6 +28,9 @@
#include "fuse.h"
#include "fuse_ipc.h"
+#define FUSE_DEBUG_MODULE DEVICE
+#include "fuse_debug.h"
+
static __inline int fuse_ohead_audit(struct fuse_out_header *ohead,
struct uio *uio);
@@ -104,7 +107,7 @@
#if DO_GIANT_MANUALLY
mtx_unlock(&Giant);
#endif
- DEBUG2G("caught in the middle of unload\n");
+ DEBUG("caught in the middle of unload\n");
return (ENOENT);
}
#if DO_GIANT_MANUALLY && USE_FUSE_LOCK
@@ -115,7 +118,7 @@
if (dev->si_usecount > 1)
goto busy;
- DEBUG2G("device %p\n", dev);
+ DEBUG("device %p\n", dev);
fdata = fdata_alloc(dev, td->td_ucred);
@@ -136,7 +139,7 @@
mtx_unlock(&Giant);
#endif
- DEBUG("Opened device \"fuse\" (that of minor %d) successfully on thread %d.\n", minor(dev), td->td_tid);
+ DEBUG("%s: device opened by thread %d.\n", dev->si_name, td->td_tid);
return(0);
@@ -172,7 +175,7 @@
/* wakup poll()ers */
selwakeuppri(&data->ks_rsel, PZERO + 1);
- DEBUG2G("mntco %d\n", data->mntco);
+ DEBUG("mntco %d\n", data->mntco);
if (data->mntco > 0) {
struct fuse_ticket *tick;
@@ -200,7 +203,7 @@
#endif
fuse_useco--;
- DEBUG("Closing device \"fuse\" (that of minor %d) on thread %d.\n", minor(dev), td->td_tid);
+ DEBUG("%s: device closed by thread %d.\n", dev->si_name, td->td_tid);
return(0);
}
@@ -245,7 +248,7 @@
data = fusedev_get_data(dev);
- DEBUG_MSG("fuse device being read on thread %d\n", uio->uio_td->td_tid);
+ DEBUG("fuse device being read on thread %d\n", uio->uio_td->td_tid);
mtx_lock(&data->ms_mtx);
again:
@@ -351,17 +354,17 @@
static __inline int
fuse_ohead_audit(struct fuse_out_header *ohead, struct uio *uio)
{
- DEBUG_MSG("Out header -- len: %i, error: %i, unique: %llu; iovecs: %d\n",
+ DEBUG("Out header -- len: %i, error: %i, unique: %llu; iovecs: %d\n",
ohead->len, ohead->error, (unsigned long long)ohead->unique,
uio->uio_iovcnt);
if (uio->uio_resid + sizeof(struct fuse_out_header) != ohead->len) {
- DEBUG_MSG("Format error: body size differs from size claimed by header\n");
+ DEBUG("Format error: body size differs from size claimed by header\n");
return (EINVAL);
}
if (uio->uio_resid && ohead->error) {
- DEBUG_MSG("Format error: non zero error but message had a body\n");
+ DEBUG("Format error: non zero error but message had a body\n");
return (EINVAL);
}
@@ -380,22 +383,19 @@
static int
fuse_device_write(struct cdev *dev, struct uio *uio, int ioflag)
{
-#if _DEBUG_MSG
- static int counter=0;
-#endif
struct fuse_out_header ohead;
int err = 0;
struct fuse_data *data;
struct fuse_ticket *tick, *x_tick;
int found = 0;
- DEBUG_MSG("Fuse write -- No: %d, resid: %d, iovcnt: %d, thread: %d\n",
- ++counter, uio->uio_resid, uio->uio_iovcnt, uio->uio_td->td_tid);
+ DEBUG("Fuse write -- resid: %zd, iovcnt: %d, thread: %d\n",
+ uio->uio_resid, uio->uio_iovcnt, uio->uio_td->td_tid);
data = fusedev_get_data(dev);
if (uio->uio_resid < sizeof(struct fuse_out_header)) {
- DEBUG_MSG("got less than a header!\n");
+ DEBUG("got less than a header!\n");
fdata_kick_set(data);
return (EINVAL);
}
@@ -421,7 +421,7 @@
mtx_lock(&data->aw_mtx);
TAILQ_FOREACH_SAFE(tick, &data->aw_head, tk_aw_link,
x_tick) {
- DEBUG_MSG("bumped into callback #%llu\n",
+ DEBUG("bumped into callback #%llu\n",
(unsigned long long)tick->tk_unique);
if (tick->tk_unique == ohead.unique) {
found = 1;
@@ -442,10 +442,10 @@
*/
memcpy(&tick->tk_aw_ohead, &ohead, sizeof(ohead));
err = tick->tk_aw_handler(tick, uio);
- DEBUG_MSG("stuff been passed over to a callback\n");
+ DEBUG("stuff been passed over to a callback\n");
} else {
/* pretender doesn't wanna do anything with answer */
- DEBUG_MSG("stuff devalidated, so we drop it\n");
+ DEBUG("stuff devalidated, so we drop it\n");
fuse_ticket_drop(tick);
return (err);
}
@@ -471,7 +471,7 @@
* would be the place for such a thing),
* which is just nonsense.
*/
- DEBUG_MSG("erhm, no handler for this response\n");
+ DEBUG("erhm, no handler for this response\n");
fdata_kick_set(data);
return (EINVAL);
==== //depot/projects/soc2011/ilya_fuse/fuse_module/fuse_file.c#4 (text+ko) ====
@@ -29,6 +29,9 @@
#include "fuse_ipc.h"
#include "fuse_node.h"
+#define FUSE_DEBUG_MODULE FILE
+#include "fuse_debug.h"
+
static uint64_t fuse_fh_upcall_count = 0;
SYSCTL_QUAD(_vfs_fuse, OID_AUTO, fh_upcall_count, CTLFLAG_RD,
&fuse_fh_upcall_count, 0, "");
==== //depot/projects/soc2011/ilya_fuse/fuse_module/fuse_internal.c#11 (text+ko) ====
@@ -41,6 +41,9 @@
#include "fuse_file.h"
#include "fuse_param.h"
+#define FUSE_DEBUG_MODULE INTERNAL
+#include "fuse_debug.h"
+
#ifdef ZERO_PAD_INCOMPLETE_BUFS
static int isbzero(void *buf, size_t len);
#endif
@@ -474,7 +477,7 @@
size_t bufsize,
struct fuse_dispatcher *fdip)
{
- debug_printf("fdip=%p, context=%p\n", fdip, context);
+ debug_printf("fdip=%p\n", fdip);
fdip->iosize = bufsize + cnp->cn_namelen + 1;
@@ -572,8 +575,8 @@
{
struct fuse_forget_in *ffi;
- debug_printf("mp=%p, nodeid=%llx, nlookup=%lld, fdip=%p\n",
- mp, nodeid, nlookup, fdip);
+ debug_printf("mp=%p, nodeid=%jd, nlookup=%jd, fdip=%p\n",
+ mp, (uintmax_t)nodeid, (uintmax_t)nlookup, fdip);
/*
* KASSERT(nlookup > 0, ("zero-times forget for vp #%llu",
==== //depot/projects/soc2011/ilya_fuse/fuse_module/fuse_internal.h#11 (text+ko) ====
@@ -114,7 +114,8 @@
struct fuse_attr *fat,
struct vattr *vap)
{
- DEBUG("node #%llu, mode 0%o\n", (unsigned long long)fat->ino, fat->mode);
+ DEBUGX(FUSE_DEBUG_INTERNAL,
+ "node #%ju, mode 0%o\n", (uintmax_t)fat->ino, fat->mode);
vattr_null(vap);
@@ -222,20 +223,24 @@
int
fuse_internal_checkentry(struct fuse_entry_out *feo, enum vtype vtyp)
{
- debug_printf("feo=%p, vtype=%d\n", feo, vtyp);
+ DEBUGX(FUSE_DEBUG_INTERNAL,
+ "feo=%p, vtype=%d\n", feo, vtyp);
if (vtyp != IFTOVT(feo->attr.mode)) {
- debug_printf("EINVAL -- %x != %x\n", vtype, IFTOVT(feo->attr.mode));
+ DEBUGX(FUSE_DEBUG_INTERNAL,
+ "EINVAL -- %x != %x\n", vtyp, IFTOVT(feo->attr.mode));
return (EINVAL);
}
if (feo->nodeid == FUSE_NULL_ID) {
- debug_printf("EINVAL -- feo->nodeid is NULL\n");
+ DEBUGX(FUSE_DEBUG_INTERNAL,
+ "EINVAL -- feo->nodeid is NULL\n");
return (EINVAL);
}
if (feo->nodeid == FUSE_ROOT_ID) {
- debug_printf("EINVAL -- feo->nodeid is FUSE_ROOT_ID\n");
+ DEBUGX(FUSE_DEBUG_INTERNAL,
+ "EINVAL -- feo->nodeid is FUSE_ROOT_ID\n");
return (EINVAL);
}
==== //depot/projects/soc2011/ilya_fuse/fuse_module/fuse_io.c#10 (text+ko) ====
@@ -41,6 +41,9 @@
#include "fuse_ipc.h"
#include "fuse_io.h"
+#define FUSE_DEBUG_MODULE IO
+#include "fuse_debug.h"
+
static int fuse_read_directbackend(struct fuse_io_data *fioda);
static int fuse_io_p2p(struct fuse_io_data *fioda, struct fuse_dispatcher *fdip);
static int fuse_read_biobackend(struct fuse_io_data *fioda);
@@ -140,21 +143,21 @@
fioda.buffeater = fuse_std_buffeater;
if (directio) {
- DEBUG2G("direct read of vnode %llu via file handle %llu\n",
- VTOILLU(vp), (unsigned long long)fufh->fh_id);
+ DEBUG2G("direct read of vnode %ju via file handle %ju\n",
+ (uintmax_t)VTOILLU(vp), (uintmax_t)fufh->fh_id);
err = fuse_read_directbackend(&fioda);
} else {
- DEBUG2G("buffered read of vnode %llu\n", VTOILLU(vp));
+ DEBUG2G("buffered read of vnode %ju\n", (uintmax_t)VTOILLU(vp));
err = fuse_read_biobackend(&fioda);
}
break;
case UIO_WRITE:
if (directio) {
- DEBUG2G("direct write of vnode %llu via file handle %llu\n",
- VTOILLU(vp), (unsigned long long)fufh->fh_id);
+ DEBUG2G("direct write of vnode %ju via file handle %ju\n",
+ (uintmax_t)VTOILLU(vp), (uintmax_t)fufh->fh_id);
err = fuse_write_directbackend(&fioda);
} else {
- DEBUG2G("buffered write of vnode %llu\n", VTOILLU(vp));
+ DEBUG2G("buffered write of vnode %ju\n", (uintmax_t)VTOILLU(vp));
err = fuse_write_biobackend(&fioda);
}
break;
@@ -249,12 +252,6 @@
bp->b_iocmd = BIO_READ;
vfs_busy_pages(bp, 0);
err = fuse_io_strategy(vp, bp, fufh, op);
-#if _DEBUG
- prettyprint(bp->b_data, 48);
- printf("\n");
- prettyprint(bp->b_data + PAGE_SIZE, 48);
- printf("\n");
-#endif
if (err) {
brelse(bp);
return (err);
@@ -288,7 +285,7 @@
param);
}
brelse(bp);
- DEBUG2G("end of turn, err %d, uio->uio_resid %d, n %d\n",
+ DEBUG2G("end of turn, err %d, uio->uio_resid %zd, n %d\n",
err, uio->uio_resid, n);
} while (err == 0 && uio->uio_resid > 0 && n > 0);
@@ -342,13 +339,13 @@
fri->size = MIN(uio->uio_resid,
fusefs_get_data(vp->v_mount)->max_read);
- DEBUG2G("fri->fh %llu, fri->offset %d, fri->size %d\n",
- (unsigned long long)fri->fh, (int)fri->offset, fri->size);
+ DEBUG2G("fri->fh %ju, fri->offset %ju, fri->size %ju\n",
+ (uintmax_t)fri->fh, (uintmax_t)fri->offset, (uintmax_t)fri->size);
if ((err = fdisp_wait_answ(&fdi)))
goto out;
- DEBUG2G("%d bytes asked for from offset %d, passing on the %d we got\n",
- uio->uio_resid, (int)uio->uio_offset, (int)fdi.iosize);
+ DEBUG2G("%zd bytes asked for from offset %ju, passing on the %jd we got\n",
+ uio->uio_resid, (uintmax_t)uio->uio_offset, (uintmax_t)fdi.iosize);
if ((err = buffe(uio, fri->size, fdi.answ, fdi.iosize, param)))
break;
@@ -433,9 +430,9 @@
iov++;
uio->uio_iovcnt--;
}
- DEBUG2G("resid %d, offset %llu, iovcnt %d, iov_len %d, "
+ DEBUG2G("resid %zd, offset %ju, iovcnt %d, iov_len %zd, "
"transfersize %d\n",
- uio->uio_resid, (long long unsigned)uio->uio_offset,
+ uio->uio_resid, (uintmax_t)uio->uio_offset,
uio->uio_iovcnt, iov->iov_len, transfersize);
if (transfersize < chunksize)
@@ -558,8 +555,8 @@
on = uio->uio_offset & (biosize-1);
n = MIN((unsigned)(biosize - on), uio->uio_resid);
- DEBUG2G("lbn %d, on %d, n %d, uio offset %d, uio resid %d\n",
- (int)lbn, on, n, (int)uio->uio_offset, uio->uio_resid);
+ DEBUG2G("lbn %ju, on %d, n %d, uio offset %ju, uio resid %zd\n",
+ (uintmax_t)lbn, on, n, (uintmax_t)uio->uio_offset, uio->uio_resid);
again:
/*
@@ -756,14 +753,14 @@
int biosize = vp->v_mount->mnt_stat.f_iosize;
if (! (vp->v_type == VREG || vp->v_type == VDIR)) {
- DEBUG("for vnode #%llu v_type is %d, dropping\n",
- VTOILLU(vp), vp->v_type);
+ DEBUG("for vnode #%ju v_type is %d, dropping\n",
+ (uintmax_t)VTOILLU(vp), vp->v_type);
return (EOPNOTSUPP);
}
if (bp->b_iocmd != BIO_READ && bp->b_iocmd != BIO_WRITE) {
- DEBUG("for vnode #%llu bio tried with biocmd %#x, dropping\n",
- VTOILLU(vp), bp->b_iocmd);
+ DEBUG("for vnode #%ju bio tried with biocmd %#x, dropping\n",
+ (uintmax_t)VTOILLU(vp), bp->b_iocmd);
return (EOPNOTSUPP);
}
@@ -791,7 +788,8 @@
}
fufh->fufh_flags |= FUFH_STRATEGY;
- DEBUG2G("vp #%llu, fufh #%llu\n", VTOILLU(vp), (unsigned long long)fufh->fh_id);
+ DEBUG2G("vp #%ju, fufh #%ju\n",
+ (uintmax_t)VTOILLU(vp), (uintmax_t)fufh->fh_id);
fdisp_init(&fdi, 0);
==== //depot/projects/soc2011/ilya_fuse/fuse_module/fuse_ipc.c#6 (text+ko) ====
@@ -28,6 +28,9 @@
#include "fuse_ipc.h"
#include "fuse_internal.h"
+#define FUSE_DEBUG_MODULE IPC
+#include "fuse_debug.h"
+
static struct fuse_ticket *fticket_alloc(struct fuse_data *data);
static void fticket_refresh(struct fuse_ticket *tick);
static void fticket_destroy(struct fuse_ticket *tick);
@@ -73,7 +76,7 @@
void
fiov_init(struct fuse_iov *fiov, size_t size)
{
- debug_printf("fiov=%p, size=%x\n", fiov, size);
+ debug_printf("fiov=%p, size=%zd\n", fiov, size);
fiov->len = 0;
fiov->base = malloc(FU_AT_LEAST(size), M_FUSEMSG, M_WAITOK | M_ZERO);
@@ -92,7 +95,7 @@
void
fiov_adjust(struct fuse_iov *fiov, size_t size)
{
- debug_printf("fiov=%p, size=%x\n", fiov, size);
+ debug_printf("fiov=%p, size=%zd\n", fiov, size);
if (fiov->allocated_size < size ||
(fuse_iov_permanent_bufsize >= 0 &&
@@ -248,7 +251,7 @@
fiov_adjust(fticket_resp(tick), len);
err = uiomove(fticket_resp(tick)->base, len, uio);
if (err) {
- debug_printf("FT_A_FIOV: error is %d (%p, %d, %p)\n",
+ debug_printf("FT_A_FIOV: error is %d (%p, %zd, %p)\n",
err, fticket_resp(tick)->base, len, uio);
}
break;
@@ -257,7 +260,7 @@
tick->tk_aw_bufsize = len;
err = uiomove(tick->tk_aw_bufdata, len, uio);
if (err) {
- debug_printf("FT_A_BUF: error is %d (%p, %d, %p)\n",
+ debug_printf("FT_A_BUF: error is %d (%p, %zd, %p)\n",
err, tick->tk_aw_bufdata, len, uio);
}
break;
@@ -294,7 +297,7 @@
{
struct fuse_data *data;
- debug_printf("fdev=%p, p=%p\n", fdev, p);
+ debug_printf("fdev=%p\n", fdev);
data = malloc(sizeof(struct fuse_data), M_FUSEMSG, M_WAITOK | M_ZERO);
@@ -304,7 +307,7 @@
mtx_init(&data->ms_mtx, "fuse message list mutex", NULL, MTX_DEF);
STAILQ_INIT(&data->ms_head);
mtx_init(&data->ticket_mtx, "fuse ticketer mutex", NULL, MTX_DEF);
- debug_printf("ALLOC_INIT data=%p ticket_mtx=%p\n", data, data->ticket_mtx);
+ debug_printf("ALLOC_INIT data=%p ticket_mtx=%p\n", data, &data->ticket_mtx);
STAILQ_INIT(&data->freetickets_head);
TAILQ_INIT(&data->alltickets_head);
mtx_init(&data->aw_mtx, "fuse answer list mutex", NULL, MTX_DEF);
@@ -558,7 +561,7 @@
int err = 0;
enum fuse_opcode opcode;
- debug_printf("tick=%p, blen = %x\n", tick, blen);
+ debug_printf("tick=%p, blen = %zu\n", tick, blen);
opcode = fticket_opcode(tick);
@@ -740,8 +743,8 @@
ihead->nodeid = nid;
ihead->opcode = op;
- debug_printf("ihead=%p, tick=%p, nid=%llx, op=%d, blen=%x, context=%p\n",
- ihead, tick, nid, op, blen, context);
+ debug_printf("ihead=%p, tick=%p, nid=%ju, op=%d, blen=%zu\n",
+ ihead, tick, (uintmax_t)nid, op, blen);
ihead->pid = pid;
ihead->uid = cred->cr_uid;
@@ -797,8 +800,8 @@
{
struct fuse_data *data = fusefs_get_data(mp);
- debug_printf("fdip=%p, op=%d, mp=%p, nid=%llx, context=%p\n",
- op, mp, nid, context);
+ debug_printf("fdip=%p, op=%d, mp=%p, nid=%ju\n",
+ fdip, op, mp, (uintmax_t)nid);
if (fdip->tick) {
fticket_refresh(fdip->tick);
@@ -836,7 +839,7 @@
struct thread *td,
struct ucred *cred)
{
- debug_printf("fdip=%p, op=%d, vp=%p, context=%p\n", fdip, op, vp, context);
+ debug_printf("fdip=%p, op=%d, vp=%p\n", fdip, op, vp);
RECTIFY_TDCR(td, cred);
return (fdisp_make_pid(fdip, op, vnode_mount(vp), VTOI(vp),
td->td_proc->p_pid, cred));
==== //depot/projects/soc2011/ilya_fuse/fuse_module/fuse_ipc.h#8 (text+ko) ====
@@ -69,35 +69,35 @@
static __inline struct fuse_iov *
fticket_resp(struct fuse_ticket *tick)
{
- kdebug_printf("-> tick=%p\n", tick);
+ DEBUGX(FUSE_DEBUG_IPC, "-> tick=%p\n", tick);
return (&tick->tk_aw_fiov);
}
static __inline int
fticket_answered(struct fuse_ticket *tick)
{
- kdebug_printf("-> tick=%p\n", tick);
+ DEBUGX(FUSE_DEBUG_IPC, "-> tick=%p\n", tick);
return (tick->tk_flag & FT_ANSW);
}
static __inline void
fticket_set_answered(struct fuse_ticket *tick)
{
- kdebug_printf("-> tick=%p\n", tick);
+ DEBUGX(FUSE_DEBUG_IPC, "-> tick=%p\n", tick);
tick->tk_flag |= FT_ANSW;
}
static __inline enum fuse_opcode
fticket_opcode(struct fuse_ticket *tick)
{
- kdebug_printf("-> tick=%p\n", tick);
+ DEBUGX(FUSE_DEBUG_IPC, "-> tick=%p\n", tick);
return (((struct fuse_in_header *)(tick->tk_ms_fiov.base))->opcode);
}
static __inline void
fticket_invalidate(struct fuse_ticket *tick)
{
- kdebug_printf("-> tick=%p\n", tick);
+ DEBUGX(FUSE_DEBUG_IPC, "-> tick=%p\n", tick);
tick->tk_flag |= FT_INVAL;
}
@@ -171,14 +171,14 @@
fusefs_get_data(struct mount *mp)
{
struct fuse_data *data = mp->mnt_data;
- kdebug_printf("-> mp=%p\n", mp);
+ DEBUGX(FUSE_DEBUG_IPC, "-> mp=%p\n", mp);
return (data->mpri == FM_PRIMARY ? data : NULL);
}
static __inline void
fuse_ms_push(struct fuse_ticket *tick)
{
- kdebug_printf("-> tick=%p\n", tick);
+ DEBUGX(FUSE_DEBUG_IPC, "-> tick=%p\n", tick);
STAILQ_INSERT_TAIL(&tick->tk_data->ms_head, tick, tk_ms_link);
}
@@ -187,7 +187,7 @@
{
struct fuse_ticket *tick;
- kdebug_printf("-> data=%p\n", data);
+ DEBUGX(FUSE_DEBUG_IPC, "-> data=%p\n", data);
if ((tick = STAILQ_FIRST(&data->ms_head))) {
STAILQ_REMOVE_HEAD(&data->ms_head, tk_ms_link);
@@ -199,14 +199,14 @@
static __inline void
fuse_aw_push(struct fuse_ticket *tick)
{
- kdebug_printf("-> tick=%p\n", tick);
+ DEBUGX(FUSE_DEBUG_IPC, "-> tick=%p\n", tick);
TAILQ_INSERT_TAIL(&tick->tk_data->aw_head, tick, tk_aw_link);
}
static __inline void
fuse_aw_remove(struct fuse_ticket *tick)
{
- kdebug_printf("-> tick=%p\n", tick);
+ DEBUGX(FUSE_DEBUG_IPC, "-> tick=%p\n", tick);
TAILQ_REMOVE(&tick->tk_data->aw_head, tick, tk_aw_link);
}
@@ -215,7 +215,7 @@
{
struct fuse_ticket *tick;
- kdebug_printf("-> data=%p\n", data);
+ DEBUGX(FUSE_DEBUG_IPC, "-> data=%p\n", data);
if ((tick = TAILQ_FIRST(&data->aw_head))) {
fuse_aw_remove(tick);
@@ -273,7 +273,7 @@
static __inline void
fdisp_init(struct fuse_dispatcher *fdisp, size_t iosize)
{
- kdebug_printf("-> fdisp=%p, iosize=%x\n", fdisp, iosize);
+ DEBUGX(FUSE_DEBUG_IPC, "-> fdisp=%p, iosize=%zx\n", fdisp, iosize);
fdisp->iosize = iosize;
fdisp->tick = NULL;
}
@@ -296,7 +296,7 @@
fdisp_simple_putget_vp(struct fuse_dispatcher *fdip, enum fuse_opcode op,
struct vnode *vp, struct thread *td, struct ucred *cred)
{
- kdebug_printf("-> fdip=%p, opcode=%d, vp=%p\n", fdip, op, vp);
+ DEBUGX(FUSE_DEBUG_IPC, "-> fdip=%p, opcode=%d, vp=%p\n", fdip, op, vp);
fdisp_init(fdip, 0);
fdisp_make_vp(fdip, op, vp, td, cred);
return (fdisp_wait_answ(fdip));
==== //depot/projects/soc2011/ilya_fuse/fuse_module/fuse_main.c#6 (text+ko) ====
@@ -115,7 +115,8 @@
KASSERT(fuse_useco >= 0,
("fuse_useco is negative: %d", fuse_useco));
if (fuse_useco > 0) {
- DEBUG2G("fuse_useco %d\n", fuse_useco);
+ DEBUGX(FUSE_DEBUG_INTERNAL,
+ "fuse_useco %d\n", fuse_useco);
return (EBUSY);
}
==== //depot/projects/soc2011/ilya_fuse/fuse_module/fuse_node.c#6 (text+ko) ====
@@ -34,6 +34,9 @@
#include <sys/priv.h>
#include <security/mac/mac_framework.h>
+#define FUSE_DEBUG_MODULE VNOPS
+#include "fuse_debug.h"
+
MALLOC_DEFINE(M_FUSEVN, "fuse_vnode", "fuse vnode private data");
static void
==== //depot/projects/soc2011/ilya_fuse/fuse_module/fuse_vfsops.c#15 (text+ko) ====
@@ -29,6 +29,8 @@
#include <sys/priv.h>
#include <security/mac/mac_framework.h>
+#define FUSE_DEBUG_MODULE VFSOPS
+#include "fuse_debug.h"
/* This will do for privilege types for now */
#ifndef PRIV_VFS_FUSE_ALLOWOTHER
==== //depot/projects/soc2011/ilya_fuse/fuse_module/fuse_vnops.c#19 (text+ko) ====
@@ -46,6 +46,9 @@
#include <sys/priv.h>
+#define FUSE_DEBUG_MODULE VNOPS
+#include "fuse_debug.h"
+
/* vnode ops */
static vop_access_t fuse_vnop_access;
static vop_close_t fuse_vnop_close;
@@ -242,7 +245,7 @@
goto good_old;
}
- debug_printf("parent nid = %llu, mode = %x\n", parentnid, mode);
+ debug_printf("parent nid = %ju, mode = %x\n", (uintmax_t)parentnid, mode);
fdisp_init(fdip, sizeof(*foi) + cnp->cn_namelen + 1);
if (fusefs_get_data(vnode_mount(dvp))->dataflag & FSESS_NOCREATE) {
More information about the p4-projects
mailing list