Whamcloud - gitweb
LU-15317 osc: Add RPC to iotrace
authorPatrick Farrell <pfarrell@whamcloud.com>
Fri, 4 Mar 2022 15:34:43 +0000 (10:34 -0500)
committerAndreas Dilger <adilger@whamcloud.com>
Wed, 9 Mar 2022 17:18:22 +0000 (17:18 +0000)
Add RPCs to iotrace debugging.

To avoid creating too much debug output, this debug
ignores the possiblity that an RPC contains non-contiguous
extents.  Thus the eventual visualization will act as
though the RPC is a continuous whole.  I judge this to be
superior to the amount of log data and complexity of
capturing each extent separately.  If that level of detail
is needed, a higher debug level can be used.

Lustre-change: https://review.whamcloud.com/45894/
Lustre-commit: 711182c0188b66c87c696fa11165de41c6e3675f (tbd)

Test-parameters: trivial

Signed-off-by: Patrick Farrell <pfarrell@whamcloud.com>
Change-Id: I6fe416ba44be5572f130704ba9d3e9b85d09c656
Reviewed-on: https://review.whamcloud.com/46005
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Sebastien Buisson <sbuisson@ddn.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
lustre/osc/osc_request.c

index 25c01db..625e204 100644 (file)
@@ -2620,6 +2620,7 @@ int osc_build_rpc(const struct lu_env *env, struct client_obd *cli,
 
        spin_lock(&cli->cl_loi_list_lock);
        starting_offset >>= PAGE_SHIFT;
+       ending_offset >>= PAGE_SHIFT;
        if (cmd == OBD_BRW_READ) {
                cli->cl_r_in_flight++;
                lprocfs_oh_tally_log2(&cli->cl_read_page_hist, page_count);
@@ -2636,8 +2637,19 @@ int osc_build_rpc(const struct lu_env *env, struct client_obd *cli,
        spin_unlock(&cli->cl_loi_list_lock);
 
        DEBUG_REQ(D_INODE, req, "%d pages, aa %p, now %ur/%uw in flight",
-                 page_count, aa, cli->cl_r_in_flight,
-                 cli->cl_w_in_flight);
+                 page_count, aa, cli->cl_r_in_flight, cli->cl_w_in_flight);
+       if (libcfs_debug & D_IOTRACE) {
+               struct lu_fid fid;
+
+               fid.f_seq = crattr->cra_oa->o_parent_seq;
+               fid.f_oid = crattr->cra_oa->o_parent_oid;
+               fid.f_ver = crattr->cra_oa->o_parent_ver;
+               CDEBUG(D_IOTRACE,
+                      DFID": %d %s pages, start %lld, end %lld, now %ur/%uw in flight\n",
+                      PFID(&fid), page_count,
+                      cmd == OBD_BRW_READ ? "read" : "write", starting_offset,
+                      ending_offset, cli->cl_r_in_flight, cli->cl_w_in_flight);
+       }
        OBD_FAIL_TIMEOUT(OBD_FAIL_OSC_DELAY_IO, cfs_fail_val);
 
        ptlrpcd_add_req(req);