Whamcloud - gitweb
- Added DEBUG_SUBSYSTEMs
authorpschwan <pschwan>
Sun, 24 Feb 2002 06:36:26 +0000 (06:36 +0000)
committerpschwan <pschwan>
Sun, 24 Feb 2002 06:36:26 +0000 (06:36 +0000)
- started using CERROR, which goes both to the console and the ringbuffer,
  instead of printk

29 files changed:
lustre/include/linux/obd_support.h
lustre/lib/mds_pack.c
lustre/lib/mds_updates.c
lustre/lib/obd_pack.c
lustre/lib/page.c
lustre/llite/dir.c
lustre/llite/file.c
lustre/llite/namei.c
lustre/llite/rw.c
lustre/llite/super.c
lustre/llite/symlink.c
lustre/mdc/mdc_reint.c
lustre/mdc/mdc_request.c
lustre/mds/handler.c
lustre/mds/mds_reint.c
lustre/obdclass/class_obd.c
lustre/obdclass/genops.c
lustre/obdclass/proc_lustre.c
lustre/obdclass/sysctl.c
lustre/obdfilter/filter.c
lustre/obdfs/dir.c
lustre/obdfs/file.c
lustre/obdfs/namei.c
lustre/obdfs/rw.c
lustre/obdfs/super.c
lustre/obdfs/symlink.c
lustre/osc/osc_request.c
lustre/ost/ost_handler.c
lustre/ptlrpc/rpc.c

index 8ffedcf..4707963 100644 (file)
@@ -135,7 +135,7 @@ do {                                                            \
         CDEBUG(D_MALLOC, "kmalloced: %ld at %x (tot %ld).\n",   \
                (long)(size), (int)(ptr), obd_memory);           \
         if (ptr == NULL) {                                      \
-                printk("kernel malloc failed at %s:%d\n",       \
+                CERROR("kernel malloc failed at %s:%d\n",       \
                        __FILE__, __LINE__);                     \
         } else {                                                \
                 memset((ptr), 0, (size));                       \
index 0b4e38b..eebafc3 100644 (file)
 #include <asm/poll.h>
 #include <asm/uaccess.h>
 
+#define DEBUG_SUBSYSTEM S_MDS
+
 #include <linux/obd_support.h>
 #include <linux/lustre_lib.h>
 #include <linux/lustre_idl.h>
 #include <linux/lustre_mds.h>
 
-
 int mds_pack_req(char *name, int namelen, char *tgt, int tgtlen, 
                 struct ptlreq_hdr **hdr, struct mds_req **req, 
                 int *len, char **buf)
index f5e5b7f..3ad5158 100644 (file)
 #include <linux/slab.h>
 #include <asm/segment.h>
 
+#define DEBUG_SUBSYSTEM S_MDS
+
 #include <linux/obd_support.h>
 #include <linux/lustre_lib.h>
 #include <linux/lustre_idl.h>
 #include <linux/lustre_light.h>
 
 /* packing of MDS records */
-
 void mds_create_pack(struct mds_rec_create *rec, struct inode *inode, const char *name, int namelen, __u32 mode, __u64 id, __u32 uid, __u32 gid, __u64 time, const char *tgt, int tgtlen)
 {
        char *tmp = (char *)rec + sizeof(*rec); 
index e787e26..f811437 100644 (file)
 #include <asm/poll.h>
 #include <asm/uaccess.h>
 
+#define DEBUG_SUBSYSTEM S_OST
+
 #include <linux/obd_support.h>
 #include <linux/obd_class.h>
 #include <linux/obd_ost.h>
 #include <linux/lustre_lib.h>
 #include <linux/lustre_idl.h>
 
-
 int ost_pack_req(char *buf1, int buflen1, char *buf2, int buflen2, 
                 struct ptlreq_hdr **hdr, struct ost_req **req, 
                 int *len, char **buf)
index 28f9d8b..ed38895 100644 (file)
@@ -1,3 +1,25 @@
+/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
+ * vim:expandtab:shiftwidth=8:tabstop=8:
+ *
+ * Copyright (C) 2001, 2002 Cluster File Systems, Inc.
+ *
+ *   This file is part of Lustre, http://www.sf.net/projects/lustre/
+ *
+ *   Lustre is free software; you can redistribute it and/or
+ *   modify it under the terms of version 2 of the GNU General Public
+ *   License as published by the Free Software Foundation.
+ *
+ *   Lustre 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 Lustre; if not, write to the Free Software
+ *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ */
+
 #include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/mm.h>
 #include <linux/pagemap.h>
 #include <linux/smp_lock.h>
 
+#define DEBUG_SUBSYSTEM S_OST
+
 #include <linux/obd_support.h>
 #include <linux/lustre_lib.h>
 #include <linux/lustre_idl.h>
 #include <linux/lustre_mds.h>
 #include <linux/lustre_light.h>
 
-
-
 /*
  * Remove page from dirty list
  */
index f83e6c1..83305e8 100644 (file)
 #include <linux/ext2_fs.h>
 #include <linux/pagemap.h>
 #include <linux/mm.h>
-#include <linux/obd_support.h>
 #include <linux/locks.h>
 #include <asm/uaccess.h>
+
+#define DEBUG_SUBSYSTEM S_LLIGHT
+
+#include <linux/obd_support.h>
 #include <linux/lustre_lib.h>
 #include <linux/lustre_idl.h>
 #include <linux/lustre_mds.h>
index 9a4ce69..d35a8f7 100644 (file)
@@ -34,6 +34,8 @@
 #include <linux/pagemap.h>
 #include <linux/smp_lock.h>
 
+#define DEBUG_SUBSYSTEM S_LLIGHT
+
 #include <linux/obd_support.h>
 #include <linux/lustre_light.h>
 
index 9577ce1..39f5809 100644 (file)
@@ -29,6 +29,9 @@
 #include <linux/fs.h>
 #include <linux/locks.h>
 #include <linux/quotaops.h>
+
+#define DEBUG_SUBSYSTEM S_LLIGHT
+
 #include <linux/obd_support.h>
 #include <linux/lustre_light.h>
 extern struct address_space_operations ll_aops;
@@ -163,7 +166,7 @@ static struct inode *ll_create_node(struct inode *dir, const char *name,
        rep->nlink = 1;
        rep->atime = rep->ctime = rep->mtime = time;
        rep->mode = mode;
-        CDEBUG(D_LLIGHT, "-- new_inode: objid %lld, ino %d, mode %o\n",
+        CDEBUG(D_INODE, "-- new_inode: objid %lld, ino %d, mode %o\n",
               rep->objid, rep->ino, rep->mode); 
 
         inode = iget4(dir->i_sb, rep->ino, NULL, rep);
@@ -285,7 +288,7 @@ static int ll_create (struct inode * dir, struct dentry * dentry, int mode)
        }
 
        mode = mode | S_IFREG;
-        CDEBUG(D_LLIGHT, "name %s mode %o\n", dentry->d_name.name, mode);
+        CDEBUG(D_DENTRY, "name %s mode %o\n", dentry->d_name.name, mode);
        inode = ll_create_node(dir, dentry->d_name.name, dentry->d_name.len, 
                               NULL, 0,
                               mode, oa.o_id);
index cc48ec0..e1341a3 100644 (file)
@@ -24,6 +24,8 @@
 #include <linux/pagemap.h>
 #include <linux/smp_lock.h>
 
+#define DEBUG_SUBSYSTEM S_LLIGHT
+
 #include <linux/obd_support.h>
 #include <linux/lustre_lib.h>
 #include <linux/lustre_idl.h>
index b3d6e61..0ad90bb 100644 (file)
@@ -30,6 +30,8 @@
 #include <asm/uaccess.h>
 #include <asm/segment.h>
 
+#define DEBUG_SUBSYSTEM S_LLIGHT
+
 #include <linux/obd_support.h>
 #include <linux/obd_class.h>
 #include <linux/lustre_light.h>
@@ -201,7 +203,6 @@ static void ll_put_super(struct super_block *sb)
 extern inline struct obdo * ll_oa_from_inode(struct inode *inode, int valid);
 static void ll_delete_inode(struct inode *inode)
 {
-
        if (S_ISREG(inode->i_mode)) { 
                int err; 
                struct obdo *oa; 
@@ -211,7 +212,7 @@ static void ll_delete_inode(struct inode *inode)
                }
 
                err = obd_destroy(IID(inode), oa); 
-                CDEBUG(D_LLIGHT, "obd destroy of %Ld error %d\n",
+                CDEBUG(D_INODE, "obd destroy of %Ld error %d\n",
                        oa->o_id, err);
                obdo_free(oa);
        }
index 00f391e..83c41f4 100644 (file)
 #include <linux/mm.h>
 #include <linux/stat.h>
 #include <linux/locks.h>
-#include <linux/obd_support.h> /* for ENTRY and EXIT only */
-#include <linux/lustre_light.h>
 
+#define DEBUG_SUBSYSTEM S_LLIGHT
 
+#include <linux/obd_support.h> /* for ENTRY and EXIT only */
+#include <linux/lustre_light.h>
 
 static int ll_fast_readlink(struct dentry *dentry, char *buffer, int buflen)
 {
index 541eaf2..7ac96e2 100644 (file)
@@ -42,6 +42,8 @@
 #include <asm/segment.h>
 #include <linux/miscdevice.h>
 
+#define DEBUG_SUBSYSTEM S_MDC
+
 #include <linux/obd_support.h>
 #include <linux/lustre_lib.h>
 #include <linux/lustre_idl.h>
index 3235088..600e453 100644 (file)
@@ -42,6 +42,8 @@
 #include <asm/segment.h>
 #include <linux/miscdevice.h>
 
+#define DEBUG_SUBSYSTEM S_MDC
+
 #include <linux/obd_support.h>
 #include <linux/lustre_lib.h>
 #include <linux/lustre_idl.h>
@@ -77,7 +79,7 @@ struct ptlrpc_request *mds_prep_req(int opcode, int namelen, char *name,
                printk("llight request: cannot pack request %d\n", rc); 
                return NULL;
        }
-        CDEBUG(D_MDC, "--> mds_prep_req: len %d, req %p, tgtlen %d\n", 
+        CDEBUG(0, "--> mds_prep_req: len %d, req %p, tgtlen %d\n", 
               request->rq_reqlen, request->rq_req.mds, 
               request->rq_req.mds->tgtlen);
        request->rq_reqhdr->opc = opcode;
@@ -108,9 +110,9 @@ static int mds_queue_wait(struct ptlrpc_request *req, struct lustre_peer *peer)
        }
 
        init_waitqueue_head(&req->rq_wait_for_rep);
-        CDEBUG(D_MDC, "-- sleeping\n");
+        CDEBUG(0, "-- sleeping\n");
        interruptible_sleep_on(&req->rq_wait_for_rep);
-        CDEBUG(D_MDC, "-- done\n");
+        CDEBUG(0, "-- done\n");
 
        rc = mds_unpack_rep(req->rq_repbuf, req->rq_replen, &req->rq_rephdr, 
                            &req->rq_rep.mds);
@@ -120,7 +122,7 @@ static int mds_queue_wait(struct ptlrpc_request *req, struct lustre_peer *peer)
        }
 
        if ( req->rq_rephdr->status == 0 )
-                CDEBUG(D_MDC, "--> buf %p len %d status %d\n",
+                CDEBUG(0, "--> buf %p len %d status %d\n",
                       req->rq_repbuf, req->rq_replen, 
                       req->rq_rephdr->status); 
 
@@ -157,7 +159,7 @@ int mdc_getattr(struct lustre_peer *peer, ino_t ino, int type, int valid,
                goto out;
        }
 
-        CDEBUG(D_MDC, "mode: %o\n", request->rq_rep.mds->mode);
+        CDEBUG(0, "mode: %o\n", request->rq_rep.mds->mode);
 
        if (rep) { 
                *rep = request->rq_rep.mds;
@@ -180,7 +182,7 @@ int mdc_readpage(struct lustre_peer *peer, ino_t ino, int type, __u64 offset,
 
        niobuf.addr = (__u64) (long) addr;
 
-        CDEBUG(D_MDC, "inode: %ld\n", ino);
+        CDEBUG(D_INODE, "inode: %ld\n", ino);
 
        request = mds_prep_req(MDS_READPAGE, 0, NULL,
                               sizeof(struct niobuf), (char *)&niobuf);
@@ -204,7 +206,7 @@ int mdc_readpage(struct lustre_peer *peer, ino_t ino, int type, __u64 offset,
                goto out;
        }
 
-        CDEBUG(D_MDC, "mode: %o\n", request->rq_rep.mds->mode);
+        CDEBUG(0, "mode: %o\n", request->rq_rep.mds->mode);
 
        if (rep) { 
                *rep = request->rq_rep.mds;
index ca77a1c..130f805 100644 (file)
@@ -14,7 +14,6 @@
  * 
  */
 
-
 #define EXPORT_SYMTAB
 
 #include <linux/version.h>
@@ -26,6 +25,9 @@
 #include <linux/quotaops.h>
 #include <asm/unistd.h>
 #include <asm/uaccess.h>
+
+#define DEBUG_SUBSYSTEM S_MDS
+
 #include <linux/obd_support.h>
 #include <linux/obd.h>
 #include <linux/lustre_lib.h>
@@ -53,7 +55,7 @@ static int mds_queue_req(struct ptlrpc_request *req)
                return -ENOMEM;
        }
 
-        CDEBUG(D_MDS, "---> MDS at %d %p, incoming req %p, srv_req %p\n",
+        CDEBUG(0, "---> MDS at %d %p, incoming req %p, srv_req %p\n",
               __LINE__, MDS, req, srv_req);
 
        memset(srv_req, 0, sizeof(*req)); 
@@ -190,7 +192,7 @@ struct dentry *mds_fid2dentry(struct mds_obd *mds, struct ll_fid *fid,
        if (inode == NULL)
                return ERR_PTR(-ENOMEM);
 
-       CDEBUG(D_MDS, "--> mds_fid2dentry: sb %p\n", inode->i_sb); 
+       CDEBUG(D_DENTRY, "--> mds_fid2dentry: sb %p\n", inode->i_sb); 
 
        if (is_bad_inode(inode)
            || (generation && inode->i_generation != generation)
@@ -311,7 +313,7 @@ int mds_readpage(struct ptlrpc_request *req)
                return 0;
        }
 
-        CDEBUG(D_MDS, "ino %ld\n", de->d_inode->i_ino);
+        CDEBUG(D_INODE, "ino %ld\n", de->d_inode->i_ino);
 
        file = dentry_open(de, mnt, O_RDONLY | O_LARGEFILE); 
        /* note: in case of an error, dentry_open puts dentry */
index fc9beaa..7eeed71 100644 (file)
@@ -24,6 +24,9 @@
 #include <linux/quotaops.h>
 #include <asm/unistd.h>
 #include <asm/uaccess.h>
+
+#define DEBUG_SUBSYSTEM S_MDS
+
 #include <linux/obd_support.h>
 #include <linux/obd.h>
 #include <linux/lustre_lib.h>
@@ -43,7 +46,7 @@ static int mds_reint_setattr(struct mds_update_record *rec, struct ptlrpc_reques
                return 0;
        }
 
-        CDEBUG(D_MDS, "ino %ld\n", de->d_inode->i_ino);
+        CDEBUG(D_INODE, "ino %ld\n", de->d_inode->i_ino);
 
        /* a _really_ horrible hack to avoid removing the data stored
           in the block pointers; this data is the object id 
@@ -99,7 +102,7 @@ static int mds_reint_create(struct mds_update_record *rec,
                EXIT;
                return 0;
        }
-        CDEBUG(D_MDS, "ino %ld\n", de->d_inode->i_ino);
+        CDEBUG(D_INODE, "ino %ld\n", de->d_inode->i_ino);
 
        dchild = lookup_one_len(rec->ur_name, de, rec->ur_namelen - 1);
        rc = PTR_ERR(dchild);
@@ -180,7 +183,7 @@ static int mds_reint_unlink(struct mds_update_record *rec,
                EXIT;
                return 0;
        }
-        CDEBUG(D_MDS, "ino %ld\n", de->d_inode->i_ino);
+        CDEBUG(D_INODE, "ino %ld\n", de->d_inode->i_ino);
 
        dchild = lookup_one_len(rec->ur_name, de, rec->ur_namelen - 1);
        rc = PTR_ERR(dchild);
index 92d0e7a..70dd8e0 100644 (file)
@@ -52,6 +52,8 @@
 #include <asm/uaccess.h>
 #include <linux/miscdevice.h>
 
+#define DEBUG_SUBSYSTEM S_CLASS
+
 #include <linux/obd_support.h>
 #include <linux/obd_class.h>
 
index c24089c..9db8901 100644 (file)
  *
  */
 
-
 #include <linux/mm.h>
 #include <linux/pagemap.h>
 #include <linux/fs.h>
 #include <linux/sched.h>
 #include <asm/uaccess.h>
 
+#define DEBUG_SUBSYSTEM S_CLASS
+
 #include <linux/obd_support.h>
 #include <linux/obd_class.h>
 
-
 extern struct obd_device obd_dev[MAX_OBD_DEVICES];
 kmem_cache_t *obdo_cachep = NULL;
 
index cf68e0d..4ada516 100644 (file)
 #include <linux/version.h>
 #include <linux/proc_fs.h>
 
+#define DEBUG_SUBSYSTEM S_CLASS
+
 #include <linux/obd_support.h>
 #include <linux/obd_class.h>
 
-
 #ifdef CONFIG_PROC_FS
 extern struct proc_dir_entry proc_root;
 
index e080dad..575cc61 100644 (file)
@@ -21,6 +21,8 @@
 #include <asm/uaccess.h>
 #include <linux/utsname.h>
 
+#define DEBUG_SUBSYSTEM S_CLASS
+
 #include <linux/obd_support.h>
 
 struct ctl_table_header *obd_table_header = NULL;
index 893a10d..4be0175 100644 (file)
@@ -19,6 +19,9 @@
 #include <linux/ext2_fs.h>
 #include <linux/quotaops.h>
 #include <asm/unistd.h>
+
+#define DEBUG_SUBSYSTEM S_FILTER
+
 #include <linux/obd_support.h>
 #include <linux/obd_class.h>
 #include <linux/obd_ext2.h>
index d72f2e1..760026d 100644 (file)
@@ -24,6 +24,9 @@
 #include <linux/fs.h>
 #include <linux/ext2_fs.h>
 #include <linux/pagemap.h>
+
+#define DEBUG_SUBSYSTEM S_OBDFS
+
 #include <linux/obd_support.h>
 #include <linux/locks.h>
 
index a652e42..b1bd823 100644 (file)
@@ -34,6 +34,8 @@
 #include <linux/pagemap.h>
 #include <linux/smp_lock.h>
 
+#define DEBUG_SUBSYSTEM S_OBDFS
+
 #include <linux/obd_support.h>
 #include <linux/obdfs.h>
 
index eb3fb95..a360c3a 100644 (file)
@@ -30,6 +30,9 @@
 #include <linux/fs.h>
 #include <linux/locks.h>
 #include <linux/quotaops.h>
+
+#define DEBUG_SUBSYSTEM S_OBDFS
+
 #include <linux/obd_support.h>
 #include <linux/obdfs.h>
 extern struct address_space_operations obdfs_aops;
index 1b4a7ff..5b04775 100644 (file)
@@ -33,6 +33,8 @@
 #include <linux/pagemap.h>
 #include <linux/smp_lock.h>
 
+#define DEBUG_SUBSYSTEM S_OBDFS
+
 #include <linux/obd_support.h>
 #include <linux/obd_ext2.h>
 #include <linux/obdfs.h>
index 9804e61..aa787c2 100644 (file)
@@ -32,6 +32,8 @@
 #include <linux/vmalloc.h>
 #include <asm/segment.h>
 
+#define DEBUG_SUBSYSTEM S_OBDFS
+
 #include <linux/obd_support.h>
 #include <linux/obd_class.h>
 #include <linux/obdfs.h>
index b7adb80..3ae8a4d 100644 (file)
@@ -27,6 +27,9 @@
 #include <linux/mm.h>
 #include <linux/stat.h>
 #include <linux/locks.h>
+
+#define DEBUG_SUBSYSTEM S_OBDFS
+
 #include <linux/obd_support.h> /* for ENTRY and EXIT only */
 #include <linux/obdfs.h>
 
index e40bb36..b3a305f 100644 (file)
@@ -35,6 +35,8 @@
 #include <asm/segment.h>
 #include <linux/miscdevice.h>
 
+#define DEBUG_SUBSYSTEM S_OSC
+
 #include <linux/obd_support.h>
 #include <linux/obd_class.h>
 #include <linux/lustre_lib.h>
index 6ddc563..f8c1317 100644 (file)
@@ -19,7 +19,6 @@
  * 
  */
 
-
 #define EXPORT_SYMTAB
 
 #include <linux/version.h>
@@ -30,6 +29,9 @@
 #include <linux/ext2_fs.h>
 #include <linux/quotaops.h>
 #include <asm/unistd.h>
+
+#define DEBUG_SUBSYSTEM S_OST
+
 #include <linux/obd_support.h>
 #include <linux/obd.h>
 #include <linux/obd_class.h>
@@ -55,7 +57,7 @@ static int ost_queue_req(struct obd_device *obddev, struct ptlrpc_request *req)
                return -ENOMEM;
        }
 
-        CDEBUG(D_OST, "---> OST at %d %p, incoming req %p, srv_req %p\n",
+        CDEBUG(0, "---> OST at %d %p, incoming req %p, srv_req %p\n",
               __LINE__, ost, req, srv_req);
 
        memset(srv_req, 0, sizeof(*req)); 
@@ -252,7 +254,7 @@ static int ost_connect(struct ost_obd *ost, struct ptlrpc_request *req)
 
        req->rq_rep.ost->result =ost->ost_tgt->obd_type->typ_ops->o_connect(&conn);
 
-        CDEBUG(D_OST, "ost_connect: rep buffer %p, id %d\n", req->rq_repbuf,
+        CDEBUG(0, "ost_connect: rep buffer %p, id %d\n", req->rq_repbuf,
               conn.oc_id);
        req->rq_rep.ost->connid = conn.oc_id;
        EXIT;
@@ -397,7 +399,7 @@ int ost_handle(struct obd_device *obddev, struct ptlrpc_request *req)
        struct ptlreq_hdr *hdr;
 
        ENTRY;
-        CDEBUG(D_OST, "req at %p\n", req);
+        CDEBUG(0, "req at %p\n", req);
 
        hdr = (struct ptlreq_hdr *)req->rq_reqbuf;
        if (NTOH__u32(hdr->type) != OST_TYPE_REQ) {
index 160c8a1..fe81f46 100644 (file)
 #include <linux/module.h>
 #include <linux/kernel.h>
 
+#define DEBUG_SUBSYSTEM S_RPC
+
 #include <linux/obd_support.h>
 #include <linux/lustre_net.h>
 
 static ptl_handle_eq_t req_eq, bulk_source_eq, bulk_sink_eq;
-int obd_debug_level;
-int obd_print_entry;
 
 /*
  * 1. Free the request buffer after it has gone out on the wire