Whamcloud - gitweb
LU-930 misc: limit CDEBUG console message frequency 71/40571/4
authorAndreas Dilger <adilger@whamcloud.com>
Sat, 7 Nov 2020 07:53:28 +0000 (00:53 -0700)
committerOleg Drokin <green@whamcloud.com>
Wed, 21 Apr 2021 03:15:01 +0000 (03:15 +0000)
Some CDEBUG() messages have variable message levels, but if printed
to the console it is not rate limited like CWARN() and CERROR():

 server_bulk_callback()) event type 5, status -110
 server_bulk_callback()) event type 5, status -110
 server_bulk_callback()) event type 5, status -110
 :

Instead, use CDEBUG_LIMIT() for those messages to limit them.

Test-Parameters: trivial
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: I9081398c7d014b2873e764dc283ce2f4623ebbe5
Reviewed-on: https://review.whamcloud.com/40571
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Wang Shilong <wshilong@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/llite/file.c
lustre/lod/lod_object.c
lustre/lov/lov_obd.c
lustre/mdt/mdt_handler.c
lustre/ptlrpc/client.c
lustre/ptlrpc/events.c
lustre/ptlrpc/import.c

index bdeac63..3871c89 100644 (file)
@@ -324,8 +324,9 @@ static int ll_md_close(struct inode *inode, struct file *file)
                /* Usually the lease is not released when the
                 * application crashed, we need to release here. */
                rc = ll_lease_close(fd->fd_lease_och, inode, &lease_broken);
-               CDEBUG(rc ? D_ERROR : D_INODE, "Clean up lease "DFID" %d/%d\n",
-                       PFID(&lli->lli_fid), rc, lease_broken);
+               CDEBUG_LIMIT(rc ? D_ERROR : D_INODE,
+                            "Clean up lease "DFID" %d/%d\n",
+                            PFID(&lli->lli_fid), rc, lease_broken);
 
                fd->fd_lease_och = NULL;
        }
index 017d389..a1cdfc7 100644 (file)
@@ -920,13 +920,12 @@ int lod_load_lmv_shards(const struct lu_env *env, struct lod_object *lo,
                /* The ent->lde_name is composed of ${FID}:${index} */
                if (ent->lde_namelen < len + 1 ||
                    memcmp(ent->lde_name, name, len) != 0) {
-                       CDEBUG(lod->lod_lmv_failout ? D_ERROR : D_INFO,
-                              "%s: invalid shard name %.*s with the FID "DFID
-                              " for the striped directory "DFID", %s\n",
-                              lod2obd(lod)->obd_name, ent->lde_namelen,
-                              ent->lde_name, PFID(&fid),
-                              PFID(lu_object_fid(&obj->do_lu)),
-                              lod->lod_lmv_failout ? "failout" : "skip");
+                       CDEBUG_LIMIT(lod->lod_lmv_failout ? D_ERROR : D_INFO,
+                                    "%s: invalid shard name %.*s with the FID "DFID" for the striped directory "DFID", %s\n",
+                                    lod2obd(lod)->obd_name, ent->lde_namelen,
+                                    ent->lde_name, PFID(&fid),
+                                    PFID(lu_object_fid(&obj->do_lu)),
+                                    lod->lod_lmv_failout ? "failout" : "skip");
 
                        if (lod->lod_lmv_failout)
                                break;
@@ -938,15 +937,15 @@ int lod_load_lmv_shards(const struct lu_env *env, struct lod_object *lo,
                do {
                        if (ent->lde_name[len] < '0' ||
                            ent->lde_name[len] > '9') {
-                               CDEBUG(lod->lod_lmv_failout ? D_ERROR : D_INFO,
-                                      "%s: invalid shard name %.*s with the "
-                                      "FID "DFID" for the striped directory "
-                                      DFID", %s\n",
-                                      lod2obd(lod)->obd_name, ent->lde_namelen,
-                                      ent->lde_name, PFID(&fid),
-                                      PFID(lu_object_fid(&obj->do_lu)),
-                                      lod->lod_lmv_failout ?
-                                      "failout" : "skip");
+                               CDEBUG_LIMIT(lod->lod_lmv_failout ?
+                                            D_ERROR : D_INFO,
+                                            "%s: invalid shard name %.*s with the FID "DFID" for the striped directory "DFID", %s\n",
+                                            lod2obd(lod)->obd_name,
+                                            ent->lde_namelen,
+                                            ent->lde_name, PFID(&fid),
+                                            PFID(lu_object_fid(&obj->do_lu)),
+                                            lod->lod_lmv_failout ?
+                                            "failout" : "skip");
 
                                if (lod->lod_lmv_failout)
                                        break;
index 79fe4c9..cd3be35 100644 (file)
@@ -1067,11 +1067,11 @@ static int lov_iocontrol(unsigned int cmd, struct obd_export *exp, int len,
                                            len, karg, uarg);
                        if (err) {
                                if (lov->lov_tgts[i]->ltd_active) {
-                                       CDEBUG(err == -ENOTTY ?
-                                              D_IOCTL : D_WARNING,
-                                              "iocontrol OSC %s on OST idx %d cmd %x: err = %d\n",
-                                              lov_uuid2str(lov, i),
-                                              i, cmd, err);
+                                       CDEBUG_LIMIT(err == -ENOTTY ?
+                                                    D_IOCTL : D_WARNING,
+                                                    "iocontrol OSC %s on OST idx %d cmd %x: err = %d\n",
+                                                    lov_uuid2str(lov, i),
+                                                    i, cmd, err);
                                        if (!rc)
                                                rc = err;
                                }
index e8d9582..bf1d0d7 100644 (file)
@@ -1416,10 +1416,10 @@ static int mdt_getattr_internal(struct mdt_thread_info *info,
 
        rc = mdt_attr_get_complex(info, o, ma);
        if (unlikely(rc)) {
-               CDEBUG(rc == -ENOENT ? D_OTHER : D_ERROR,
-                      "%s: getattr error for "DFID": rc = %d\n",
-                      mdt_obd_name(info->mti_mdt),
-                      PFID(mdt_object_fid(o)), rc);
+               CDEBUG_LIMIT(rc == -ENOENT ? D_OTHER : D_ERROR,
+                            "%s: getattr error for "DFID": rc = %d\n",
+                            mdt_obd_name(info->mti_mdt),
+                            PFID(mdt_object_fid(o)), rc);
                RETURN(rc);
        }
 
index 71174f8..aacfb39 100644 (file)
@@ -406,10 +406,10 @@ void ptlrpc_at_adj_net_latency(struct ptlrpc_request *req,
                 * resent time, but server sent back service time of original
                 * RPC.
                 */
-               CDEBUG((lustre_msg_get_flags(req->rq_reqmsg) & MSG_RESENT) ?
-                      D_ADAPTTO : D_WARNING,
-                      "Reported service time %u > total measured time %lld\n",
-                      service_timeout, now - req->rq_sent);
+               CDEBUG_LIMIT((lustre_msg_get_flags(req->rq_reqmsg) &
+                             MSG_RESENT) ?  D_ADAPTTO : D_WARNING,
+                            "Reported service time %u > total measured time %lld\n",
+                            service_timeout, now - req->rq_sent);
                return;
        }
 
index 8d569a7..ff8f883 100644 (file)
@@ -203,15 +203,15 @@ void client_bulk_callback(struct lnet_event *ev)
                ev->type == LNET_EVENT_UNLINK);
        LASSERT(ev->unlinked);
 
-        if (CFS_FAIL_CHECK_ORSET(OBD_FAIL_PTLRPC_CLIENT_BULK_CB, CFS_FAIL_ONCE))
-                ev->status = -EIO;
+       if (CFS_FAIL_CHECK_ORSET(OBD_FAIL_PTLRPC_CLIENT_BULK_CB, CFS_FAIL_ONCE))
+               ev->status = -EIO;
 
-        if (CFS_FAIL_CHECK_ORSET(OBD_FAIL_PTLRPC_CLIENT_BULK_CB2,CFS_FAIL_ONCE))
-                ev->status = -EIO;
+       if (CFS_FAIL_CHECK_ORSET(OBD_FAIL_PTLRPC_CLIENT_BULK_CB2,CFS_FAIL_ONCE))
+               ev->status = -EIO;
 
-        CDEBUG((ev->status == 0) ? D_NET : D_ERROR,
-               "event type %d, status %d, desc %p\n",
-               ev->type, ev->status, desc);
+       CDEBUG_LIMIT((ev->status == 0) ? D_NET : D_ERROR,
+                    "event type %d, status %d, desc %p\n",
+                    ev->type, ev->status, desc);
 
        spin_lock(&desc->bd_lock);
        req = desc->bd_req;
@@ -314,24 +314,23 @@ void request_in_callback(struct lnet_event *ev)
        LASSERT((char *)ev->md_start + ev->offset + ev->mlength <=
                rqbd->rqbd_buffer + service->srv_buf_size);
 
-       CDEBUG((ev->status == 0) ? D_NET : D_ERROR,
-              "event type %d, status %d, service %s\n",
-              ev->type, ev->status, service->srv_name);
+       CDEBUG_LIMIT((ev->status == 0) ? D_NET : D_ERROR,
+                    "event type %d, status %d, service %s\n",
+                    ev->type, ev->status, service->srv_name);
 
-        if (ev->unlinked) {
-                /* If this is the last request message to fit in the
-                 * request buffer we can use the request object embedded in
-                 * rqbd.  Note that if we failed to allocate a request,
-                 * we'd have to re-post the rqbd, which we can't do in this
-                 * context. */
-                req = &rqbd->rqbd_req;
-                memset(req, 0, sizeof (*req));
-        } else {
-                LASSERT (ev->type == LNET_EVENT_PUT);
-                if (ev->status != 0) {
-                        /* We moaned above already... */
-                        return;
-                }
+       if (ev->unlinked) {
+               /* If this is the last request message to fit in the
+                * request buffer we can use the request object embedded in
+                * rqbd.  Note that if we failed to allocate a request,
+                * we'd have to re-post the rqbd, which we can't do in this
+                * context.
+                */
+               req = &rqbd->rqbd_req;
+               memset(req, 0, sizeof(*req));
+       } else {
+               LASSERT(ev->type == LNET_EVENT_PUT);
+               if (ev->status != 0) /* We moaned above already... */
+                       return;
                req = ptlrpc_request_cache_alloc(GFP_ATOMIC);
                 if (req == NULL) {
                         CERROR("Can't allocate incoming request descriptor: "
@@ -459,9 +458,9 @@ void server_bulk_callback(struct lnet_event *ev)
                (ptlrpc_is_bulk_get_sink(desc->bd_type) &&
                 ev->type == LNET_EVENT_REPLY));
 
-        CDEBUG((ev->status == 0) ? D_NET : D_ERROR,
-               "event type %d, status %d, desc %p\n",
-               ev->type, ev->status, desc);
+       CDEBUG_LIMIT((ev->status == 0) ? D_NET : D_ERROR,
+                    "event type %d, status %d, desc %p\n",
+                    ev->type, ev->status, desc);
 
        spin_lock(&desc->bd_lock);
 
index beb67b3..26d7b98 100644 (file)
@@ -1213,7 +1213,7 @@ static int ptlrpc_connect_interpret(const struct lu_env *env,
                         * with server again
                         */
                        if ((MSG_CONNECT_RECOVERING & msg_flags)) {
-                               CDEBUG(level,
+                               CDEBUG_LIMIT(level,
                                       "%s@%s changed server handle from "
                                       "%#llx to %#llx"
                                       " but is still in recovery\n",