]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-client.git/commitdiff
ceph: add sync and async create tracepoints wip-async-dirops
authorJeff Layton <jlayton@kernel.org>
Tue, 10 Dec 2019 20:22:18 +0000 (15:22 -0500)
committerJeff Layton <jlayton@kernel.org>
Fri, 10 Jan 2020 16:54:26 +0000 (11:54 -0500)
Signed-off-by: Jeff Layton <jlayton@kernel.org>
fs/ceph/file.c
fs/ceph/trace.h

index 89e8b5c48975ad9989bf5322b2371b28363dfa22..f9d0a76650dad95c076fc5aba18fdb569bed5cd3 100644 (file)
@@ -16,6 +16,7 @@
 #include "mds_client.h"
 #include "cache.h"
 #include "io.h"
+#include "trace.h"
 
 static __le32 ceph_flags_sys2wire(u32 flags)
 {
@@ -653,6 +654,7 @@ retry:
                                /* set up inode, dentry and return */
                                err = ceph_finish_async_open(dir, dentry, file,
                                                        mode, req, &as_ctx);
+                               trace_ceph_async_create(dir, dentry);
                                goto out_req;
                        case -ECHILD:
                                /* do a sync create */
@@ -707,6 +709,7 @@ retry:
 out_fmode:
        if (!req->r_err && req->r_target_inode)
                ceph_put_fmode(ceph_inode(req->r_target_inode), req->r_fmode);
+       trace_ceph_sync_create(dir, dentry);
 out_req:
        ceph_mdsc_put_request(req);
 out_ctx:
index f425e19a6f3972bd3deb66ee219db2825d2e543c..0438dd1cfa341da29cd5a5014453f981f2d106e0 100644 (file)
@@ -56,19 +56,21 @@ DECLARE_EVENT_CLASS(ceph_directory_class,
                ),
                TP_ARGS(dir, dentry),
                TP_STRUCT__entry(
-                       __field(u64, ino)
+                       __field(u64, pino)
                        __field(u64, snap)
+                       __field(u64, ino)
                        __string(name, dentry->d_name.name)
                ),
                TP_fast_assign(
-                       __entry->ino = ceph_inode(dir)->i_vino.ino;
+                       __entry->pino = ceph_inode(dir)->i_vino.ino;
                        __entry->snap = ceph_inode(dir)->i_vino.snap;
+                       __entry->ino = d_inode(dentry) ? ceph_inode(d_inode(dentry))->i_vino.ino : 0;
                        __assign_str(name, dentry->d_name.name);
                ),
                TP_printk(
-                       "name=%s:0x%llx/%s",
-                       show_snapid(__entry->snap), __entry->ino,
-                       __get_str(name)
+                       "name=%s:0x%llx/%s(0x%llx)",
+                       show_snapid(__entry->snap), __entry->pino,
+                       __get_str(name), __entry->ino
                )
 );
 
@@ -79,6 +81,8 @@ DEFINE_EVENT(ceph_directory_class, ceph_##name,                               \
 
 DEFINE_CEPH_DIRECTORY_EVENT(async_unlink);
 DEFINE_CEPH_DIRECTORY_EVENT(sync_unlink);
+DEFINE_CEPH_DIRECTORY_EVENT(async_create);
+DEFINE_CEPH_DIRECTORY_EVENT(sync_create);
 
 #endif /* _CEPH_TRACE_H */