Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-or-later */
0002 /* CacheFiles tracepoints
0003  *
0004  * Copyright (C) 2021 Red Hat, Inc. All Rights Reserved.
0005  * Written by David Howells (dhowells@redhat.com)
0006  */
0007 #undef TRACE_SYSTEM
0008 #define TRACE_SYSTEM cachefiles
0009 
0010 #if !defined(_TRACE_CACHEFILES_H) || defined(TRACE_HEADER_MULTI_READ)
0011 #define _TRACE_CACHEFILES_H
0012 
0013 #include <linux/tracepoint.h>
0014 
0015 /*
0016  * Define enums for tracing information.
0017  */
0018 #ifndef __CACHEFILES_DECLARE_TRACE_ENUMS_ONCE_ONLY
0019 #define __CACHEFILES_DECLARE_TRACE_ENUMS_ONCE_ONLY
0020 
0021 enum cachefiles_obj_ref_trace {
0022     cachefiles_obj_get_ioreq,
0023     cachefiles_obj_new,
0024     cachefiles_obj_put_alloc_fail,
0025     cachefiles_obj_put_detach,
0026     cachefiles_obj_put_ioreq,
0027     cachefiles_obj_see_clean_commit,
0028     cachefiles_obj_see_clean_delete,
0029     cachefiles_obj_see_clean_drop_tmp,
0030     cachefiles_obj_see_lookup_cookie,
0031     cachefiles_obj_see_lookup_failed,
0032     cachefiles_obj_see_withdraw_cookie,
0033     cachefiles_obj_see_withdrawal,
0034     cachefiles_obj_get_ondemand_fd,
0035     cachefiles_obj_put_ondemand_fd,
0036 };
0037 
0038 enum fscache_why_object_killed {
0039     FSCACHE_OBJECT_IS_STALE,
0040     FSCACHE_OBJECT_IS_WEIRD,
0041     FSCACHE_OBJECT_INVALIDATED,
0042     FSCACHE_OBJECT_NO_SPACE,
0043     FSCACHE_OBJECT_WAS_RETIRED,
0044     FSCACHE_OBJECT_WAS_CULLED,
0045     FSCACHE_VOLUME_IS_WEIRD,
0046 };
0047 
0048 enum cachefiles_coherency_trace {
0049     cachefiles_coherency_check_aux,
0050     cachefiles_coherency_check_content,
0051     cachefiles_coherency_check_dirty,
0052     cachefiles_coherency_check_len,
0053     cachefiles_coherency_check_objsize,
0054     cachefiles_coherency_check_ok,
0055     cachefiles_coherency_check_type,
0056     cachefiles_coherency_check_xattr,
0057     cachefiles_coherency_set_fail,
0058     cachefiles_coherency_set_ok,
0059     cachefiles_coherency_vol_check_cmp,
0060     cachefiles_coherency_vol_check_ok,
0061     cachefiles_coherency_vol_check_resv,
0062     cachefiles_coherency_vol_check_xattr,
0063     cachefiles_coherency_vol_set_fail,
0064     cachefiles_coherency_vol_set_ok,
0065 };
0066 
0067 enum cachefiles_trunc_trace {
0068     cachefiles_trunc_dio_adjust,
0069     cachefiles_trunc_expand_tmpfile,
0070     cachefiles_trunc_shrink,
0071 };
0072 
0073 enum cachefiles_prepare_read_trace {
0074     cachefiles_trace_read_after_eof,
0075     cachefiles_trace_read_found_hole,
0076     cachefiles_trace_read_found_part,
0077     cachefiles_trace_read_have_data,
0078     cachefiles_trace_read_no_data,
0079     cachefiles_trace_read_no_file,
0080     cachefiles_trace_read_seek_error,
0081     cachefiles_trace_read_seek_nxio,
0082 };
0083 
0084 enum cachefiles_error_trace {
0085     cachefiles_trace_fallocate_error,
0086     cachefiles_trace_getxattr_error,
0087     cachefiles_trace_link_error,
0088     cachefiles_trace_lookup_error,
0089     cachefiles_trace_mkdir_error,
0090     cachefiles_trace_notify_change_error,
0091     cachefiles_trace_open_error,
0092     cachefiles_trace_read_error,
0093     cachefiles_trace_remxattr_error,
0094     cachefiles_trace_rename_error,
0095     cachefiles_trace_seek_error,
0096     cachefiles_trace_setxattr_error,
0097     cachefiles_trace_statfs_error,
0098     cachefiles_trace_tmpfile_error,
0099     cachefiles_trace_trunc_error,
0100     cachefiles_trace_unlink_error,
0101     cachefiles_trace_write_error,
0102 };
0103 
0104 #endif
0105 
0106 /*
0107  * Define enum -> string mappings for display.
0108  */
0109 #define cachefiles_obj_kill_traces              \
0110     EM(FSCACHE_OBJECT_IS_STALE, "stale")        \
0111     EM(FSCACHE_OBJECT_IS_WEIRD, "weird")        \
0112     EM(FSCACHE_OBJECT_INVALIDATED,  "inval")        \
0113     EM(FSCACHE_OBJECT_NO_SPACE, "no_space")     \
0114     EM(FSCACHE_OBJECT_WAS_RETIRED,  "was_retired")      \
0115     EM(FSCACHE_OBJECT_WAS_CULLED,   "was_culled")       \
0116     E_(FSCACHE_VOLUME_IS_WEIRD, "volume_weird")
0117 
0118 #define cachefiles_obj_ref_traces                   \
0119     EM(cachefiles_obj_get_ioreq,        "GET ioreq")        \
0120     EM(cachefiles_obj_new,          "NEW obj")      \
0121     EM(cachefiles_obj_put_alloc_fail,   "PUT alloc_fail")   \
0122     EM(cachefiles_obj_put_detach,       "PUT detach")       \
0123     EM(cachefiles_obj_put_ioreq,        "PUT ioreq")        \
0124     EM(cachefiles_obj_see_clean_commit, "SEE clean_commit") \
0125     EM(cachefiles_obj_see_clean_delete, "SEE clean_delete") \
0126     EM(cachefiles_obj_see_clean_drop_tmp,   "SEE clean_drop_tmp")   \
0127     EM(cachefiles_obj_see_lookup_cookie,    "SEE lookup_cookie")    \
0128     EM(cachefiles_obj_see_lookup_failed,    "SEE lookup_failed")    \
0129     EM(cachefiles_obj_see_withdraw_cookie,  "SEE withdraw_cookie")  \
0130     E_(cachefiles_obj_see_withdrawal,   "SEE withdrawal")
0131 
0132 #define cachefiles_coherency_traces                 \
0133     EM(cachefiles_coherency_check_aux,  "BAD aux ")     \
0134     EM(cachefiles_coherency_check_content,  "BAD cont")     \
0135     EM(cachefiles_coherency_check_dirty,    "BAD dirt")     \
0136     EM(cachefiles_coherency_check_len,  "BAD len ")     \
0137     EM(cachefiles_coherency_check_objsize,  "BAD osiz")     \
0138     EM(cachefiles_coherency_check_ok,   "OK      ")     \
0139     EM(cachefiles_coherency_check_type, "BAD type")     \
0140     EM(cachefiles_coherency_check_xattr,    "BAD xatt")     \
0141     EM(cachefiles_coherency_set_fail,   "SET fail")     \
0142     EM(cachefiles_coherency_set_ok,     "SET ok  ")     \
0143     EM(cachefiles_coherency_vol_check_cmp,  "VOL BAD cmp ")     \
0144     EM(cachefiles_coherency_vol_check_ok,   "VOL OK      ")     \
0145     EM(cachefiles_coherency_vol_check_resv, "VOL BAD resv") \
0146     EM(cachefiles_coherency_vol_check_xattr,"VOL BAD xatt")     \
0147     EM(cachefiles_coherency_vol_set_fail,   "VOL SET fail")     \
0148     E_(cachefiles_coherency_vol_set_ok, "VOL SET ok  ")
0149 
0150 #define cachefiles_trunc_traces                     \
0151     EM(cachefiles_trunc_dio_adjust,     "DIOADJ")       \
0152     EM(cachefiles_trunc_expand_tmpfile, "EXPTMP")       \
0153     E_(cachefiles_trunc_shrink,     "SHRINK")
0154 
0155 #define cachefiles_prepare_read_traces                  \
0156     EM(cachefiles_trace_read_after_eof, "after-eof ")       \
0157     EM(cachefiles_trace_read_found_hole,    "found-hole")       \
0158     EM(cachefiles_trace_read_found_part,    "found-part")       \
0159     EM(cachefiles_trace_read_have_data, "have-data ")       \
0160     EM(cachefiles_trace_read_no_data,   "no-data   ")       \
0161     EM(cachefiles_trace_read_no_file,   "no-file   ")       \
0162     EM(cachefiles_trace_read_seek_error,    "seek-error")       \
0163     E_(cachefiles_trace_read_seek_nxio, "seek-enxio")
0164 
0165 #define cachefiles_error_traces                     \
0166     EM(cachefiles_trace_fallocate_error,    "fallocate")        \
0167     EM(cachefiles_trace_getxattr_error, "getxattr")     \
0168     EM(cachefiles_trace_link_error,     "link")         \
0169     EM(cachefiles_trace_lookup_error,   "lookup")       \
0170     EM(cachefiles_trace_mkdir_error,    "mkdir")        \
0171     EM(cachefiles_trace_notify_change_error, "notify_change")   \
0172     EM(cachefiles_trace_open_error,     "open")         \
0173     EM(cachefiles_trace_read_error,     "read")         \
0174     EM(cachefiles_trace_remxattr_error, "remxattr")     \
0175     EM(cachefiles_trace_rename_error,   "rename")       \
0176     EM(cachefiles_trace_seek_error,     "seek")         \
0177     EM(cachefiles_trace_setxattr_error, "setxattr")     \
0178     EM(cachefiles_trace_statfs_error,   "statfs")       \
0179     EM(cachefiles_trace_tmpfile_error,  "tmpfile")      \
0180     EM(cachefiles_trace_trunc_error,    "trunc")        \
0181     EM(cachefiles_trace_unlink_error,   "unlink")       \
0182     E_(cachefiles_trace_write_error,    "write")
0183 
0184 
0185 /*
0186  * Export enum symbols via userspace.
0187  */
0188 #undef EM
0189 #undef E_
0190 #define EM(a, b) TRACE_DEFINE_ENUM(a);
0191 #define E_(a, b) TRACE_DEFINE_ENUM(a);
0192 
0193 cachefiles_obj_kill_traces;
0194 cachefiles_obj_ref_traces;
0195 cachefiles_coherency_traces;
0196 cachefiles_trunc_traces;
0197 cachefiles_prepare_read_traces;
0198 cachefiles_error_traces;
0199 
0200 /*
0201  * Now redefine the EM() and E_() macros to map the enums to the strings that
0202  * will be printed in the output.
0203  */
0204 #undef EM
0205 #undef E_
0206 #define EM(a, b)    { a, b },
0207 #define E_(a, b)    { a, b }
0208 
0209 
0210 TRACE_EVENT(cachefiles_ref,
0211         TP_PROTO(unsigned int object_debug_id,
0212              unsigned int cookie_debug_id,
0213              int usage,
0214              enum cachefiles_obj_ref_trace why),
0215 
0216         TP_ARGS(object_debug_id, cookie_debug_id, usage, why),
0217 
0218         /* Note that obj may be NULL */
0219         TP_STRUCT__entry(
0220             __field(unsigned int,           obj     )
0221             __field(unsigned int,           cookie      )
0222             __field(enum cachefiles_obj_ref_trace,  why     )
0223             __field(int,                usage       )
0224                  ),
0225 
0226         TP_fast_assign(
0227             __entry->obj    = object_debug_id;
0228             __entry->cookie = cookie_debug_id;
0229             __entry->usage  = usage;
0230             __entry->why    = why;
0231                ),
0232 
0233         TP_printk("c=%08x o=%08x u=%d %s",
0234               __entry->cookie, __entry->obj, __entry->usage,
0235               __print_symbolic(__entry->why, cachefiles_obj_ref_traces))
0236         );
0237 
0238 TRACE_EVENT(cachefiles_lookup,
0239         TP_PROTO(struct cachefiles_object *obj,
0240              struct dentry *dir,
0241              struct dentry *de),
0242 
0243         TP_ARGS(obj, dir, de),
0244 
0245         TP_STRUCT__entry(
0246             __field(unsigned int,       obj )
0247             __field(short,          error   )
0248             __field(unsigned long,      dino    )
0249             __field(unsigned long,      ino )
0250                  ),
0251 
0252         TP_fast_assign(
0253             __entry->obj    = obj ? obj->debug_id : 0;
0254             __entry->dino   = d_backing_inode(dir)->i_ino;
0255             __entry->ino    = (!IS_ERR(de) && d_backing_inode(de) ?
0256                        d_backing_inode(de)->i_ino : 0);
0257             __entry->error  = IS_ERR(de) ? PTR_ERR(de) : 0;
0258                ),
0259 
0260         TP_printk("o=%08x dB=%lx B=%lx e=%d",
0261               __entry->obj, __entry->dino, __entry->ino, __entry->error)
0262         );
0263 
0264 TRACE_EVENT(cachefiles_mkdir,
0265         TP_PROTO(struct dentry *dir, struct dentry *subdir),
0266 
0267         TP_ARGS(dir, subdir),
0268 
0269         TP_STRUCT__entry(
0270             __field(unsigned int,           dir )
0271             __field(unsigned int,           subdir  )
0272                  ),
0273 
0274         TP_fast_assign(
0275             __entry->dir    = d_backing_inode(dir)->i_ino;
0276             __entry->subdir = d_backing_inode(subdir)->i_ino;
0277                ),
0278 
0279         TP_printk("dB=%x sB=%x",
0280               __entry->dir,
0281               __entry->subdir)
0282         );
0283 
0284 TRACE_EVENT(cachefiles_tmpfile,
0285         TP_PROTO(struct cachefiles_object *obj, struct inode *backer),
0286 
0287         TP_ARGS(obj, backer),
0288 
0289         TP_STRUCT__entry(
0290             __field(unsigned int,           obj )
0291             __field(unsigned int,           backer  )
0292                  ),
0293 
0294         TP_fast_assign(
0295             __entry->obj    = obj->debug_id;
0296             __entry->backer = backer->i_ino;
0297                ),
0298 
0299         TP_printk("o=%08x B=%x",
0300               __entry->obj,
0301               __entry->backer)
0302         );
0303 
0304 TRACE_EVENT(cachefiles_link,
0305         TP_PROTO(struct cachefiles_object *obj, struct inode *backer),
0306 
0307         TP_ARGS(obj, backer),
0308 
0309         TP_STRUCT__entry(
0310             __field(unsigned int,           obj )
0311             __field(unsigned int,           backer  )
0312                  ),
0313 
0314         TP_fast_assign(
0315             __entry->obj    = obj->debug_id;
0316             __entry->backer = backer->i_ino;
0317                ),
0318 
0319         TP_printk("o=%08x B=%x",
0320               __entry->obj,
0321               __entry->backer)
0322         );
0323 
0324 TRACE_EVENT(cachefiles_unlink,
0325         TP_PROTO(struct cachefiles_object *obj,
0326              ino_t ino,
0327              enum fscache_why_object_killed why),
0328 
0329         TP_ARGS(obj, ino, why),
0330 
0331         /* Note that obj may be NULL */
0332         TP_STRUCT__entry(
0333             __field(unsigned int,       obj     )
0334             __field(unsigned int,       ino     )
0335             __field(enum fscache_why_object_killed, why     )
0336                  ),
0337 
0338         TP_fast_assign(
0339             __entry->obj    = obj ? obj->debug_id : UINT_MAX;
0340             __entry->ino    = ino;
0341             __entry->why    = why;
0342                ),
0343 
0344         TP_printk("o=%08x B=%x w=%s",
0345               __entry->obj, __entry->ino,
0346               __print_symbolic(__entry->why, cachefiles_obj_kill_traces))
0347         );
0348 
0349 TRACE_EVENT(cachefiles_rename,
0350         TP_PROTO(struct cachefiles_object *obj,
0351              ino_t ino,
0352              enum fscache_why_object_killed why),
0353 
0354         TP_ARGS(obj, ino, why),
0355 
0356         /* Note that obj may be NULL */
0357         TP_STRUCT__entry(
0358             __field(unsigned int,       obj     )
0359             __field(unsigned int,       ino     )
0360             __field(enum fscache_why_object_killed, why     )
0361                  ),
0362 
0363         TP_fast_assign(
0364             __entry->obj    = obj ? obj->debug_id : UINT_MAX;
0365             __entry->ino    = ino;
0366             __entry->why    = why;
0367                ),
0368 
0369         TP_printk("o=%08x B=%x w=%s",
0370               __entry->obj, __entry->ino,
0371               __print_symbolic(__entry->why, cachefiles_obj_kill_traces))
0372         );
0373 
0374 TRACE_EVENT(cachefiles_coherency,
0375         TP_PROTO(struct cachefiles_object *obj,
0376              ino_t ino,
0377              enum cachefiles_content content,
0378              enum cachefiles_coherency_trace why),
0379 
0380         TP_ARGS(obj, ino, content, why),
0381 
0382         /* Note that obj may be NULL */
0383         TP_STRUCT__entry(
0384             __field(unsigned int,           obj )
0385             __field(enum cachefiles_coherency_trace,    why )
0386             __field(enum cachefiles_content,        content )
0387             __field(u64,                ino )
0388                  ),
0389 
0390         TP_fast_assign(
0391             __entry->obj    = obj->debug_id;
0392             __entry->why    = why;
0393             __entry->content    = content;
0394             __entry->ino    = ino;
0395                ),
0396 
0397         TP_printk("o=%08x %s B=%llx c=%u",
0398               __entry->obj,
0399               __print_symbolic(__entry->why, cachefiles_coherency_traces),
0400               __entry->ino,
0401               __entry->content)
0402         );
0403 
0404 TRACE_EVENT(cachefiles_vol_coherency,
0405         TP_PROTO(struct cachefiles_volume *volume,
0406              ino_t ino,
0407              enum cachefiles_coherency_trace why),
0408 
0409         TP_ARGS(volume, ino, why),
0410 
0411         /* Note that obj may be NULL */
0412         TP_STRUCT__entry(
0413             __field(unsigned int,           vol )
0414             __field(enum cachefiles_coherency_trace,    why )
0415             __field(u64,                ino )
0416                  ),
0417 
0418         TP_fast_assign(
0419             __entry->vol    = volume->vcookie->debug_id;
0420             __entry->why    = why;
0421             __entry->ino    = ino;
0422                ),
0423 
0424         TP_printk("V=%08x %s B=%llx",
0425               __entry->vol,
0426               __print_symbolic(__entry->why, cachefiles_coherency_traces),
0427               __entry->ino)
0428         );
0429 
0430 TRACE_EVENT(cachefiles_prep_read,
0431         TP_PROTO(struct netfs_io_subrequest *sreq,
0432              enum netfs_io_source source,
0433              enum cachefiles_prepare_read_trace why,
0434              ino_t cache_inode),
0435 
0436         TP_ARGS(sreq, source, why, cache_inode),
0437 
0438         TP_STRUCT__entry(
0439             __field(unsigned int,       rreq        )
0440             __field(unsigned short,     index       )
0441             __field(unsigned short,     flags       )
0442             __field(enum netfs_io_source,   source      )
0443             __field(enum cachefiles_prepare_read_trace, why )
0444             __field(size_t,         len     )
0445             __field(loff_t,         start       )
0446             __field(unsigned int,       netfs_inode )
0447             __field(unsigned int,       cache_inode )
0448                  ),
0449 
0450         TP_fast_assign(
0451             __entry->rreq   = sreq->rreq->debug_id;
0452             __entry->index  = sreq->debug_index;
0453             __entry->flags  = sreq->flags;
0454             __entry->source = source;
0455             __entry->why    = why;
0456             __entry->len    = sreq->len;
0457             __entry->start  = sreq->start;
0458             __entry->netfs_inode = sreq->rreq->inode->i_ino;
0459             __entry->cache_inode = cache_inode;
0460                ),
0461 
0462         TP_printk("R=%08x[%u] %s %s f=%02x s=%llx %zx ni=%x B=%x",
0463               __entry->rreq, __entry->index,
0464               __print_symbolic(__entry->source, netfs_sreq_sources),
0465               __print_symbolic(__entry->why, cachefiles_prepare_read_traces),
0466               __entry->flags,
0467               __entry->start, __entry->len,
0468               __entry->netfs_inode, __entry->cache_inode)
0469         );
0470 
0471 TRACE_EVENT(cachefiles_read,
0472         TP_PROTO(struct cachefiles_object *obj,
0473              struct inode *backer,
0474              loff_t start,
0475              size_t len),
0476 
0477         TP_ARGS(obj, backer, start, len),
0478 
0479         TP_STRUCT__entry(
0480             __field(unsigned int,           obj )
0481             __field(unsigned int,           backer  )
0482             __field(size_t,             len )
0483             __field(loff_t,             start   )
0484                  ),
0485 
0486         TP_fast_assign(
0487             __entry->obj    = obj->debug_id;
0488             __entry->backer = backer->i_ino;
0489             __entry->start  = start;
0490             __entry->len    = len;
0491                ),
0492 
0493         TP_printk("o=%08x B=%x s=%llx l=%zx",
0494               __entry->obj,
0495               __entry->backer,
0496               __entry->start,
0497               __entry->len)
0498         );
0499 
0500 TRACE_EVENT(cachefiles_write,
0501         TP_PROTO(struct cachefiles_object *obj,
0502              struct inode *backer,
0503              loff_t start,
0504              size_t len),
0505 
0506         TP_ARGS(obj, backer, start, len),
0507 
0508         TP_STRUCT__entry(
0509             __field(unsigned int,           obj )
0510             __field(unsigned int,           backer  )
0511             __field(size_t,             len )
0512             __field(loff_t,             start   )
0513                  ),
0514 
0515         TP_fast_assign(
0516             __entry->obj    = obj->debug_id;
0517             __entry->backer = backer->i_ino;
0518             __entry->start  = start;
0519             __entry->len    = len;
0520                ),
0521 
0522         TP_printk("o=%08x B=%x s=%llx l=%zx",
0523               __entry->obj,
0524               __entry->backer,
0525               __entry->start,
0526               __entry->len)
0527         );
0528 
0529 TRACE_EVENT(cachefiles_trunc,
0530         TP_PROTO(struct cachefiles_object *obj, struct inode *backer,
0531              loff_t from, loff_t to, enum cachefiles_trunc_trace why),
0532 
0533         TP_ARGS(obj, backer, from, to, why),
0534 
0535         TP_STRUCT__entry(
0536             __field(unsigned int,           obj )
0537             __field(unsigned int,           backer  )
0538             __field(enum cachefiles_trunc_trace,    why )
0539             __field(loff_t,             from    )
0540             __field(loff_t,             to  )
0541                  ),
0542 
0543         TP_fast_assign(
0544             __entry->obj    = obj->debug_id;
0545             __entry->backer = backer->i_ino;
0546             __entry->from   = from;
0547             __entry->to     = to;
0548             __entry->why    = why;
0549                ),
0550 
0551         TP_printk("o=%08x B=%x %s l=%llx->%llx",
0552               __entry->obj,
0553               __entry->backer,
0554               __print_symbolic(__entry->why, cachefiles_trunc_traces),
0555               __entry->from,
0556               __entry->to)
0557         );
0558 
0559 TRACE_EVENT(cachefiles_mark_active,
0560         TP_PROTO(struct cachefiles_object *obj,
0561              struct inode *inode),
0562 
0563         TP_ARGS(obj, inode),
0564 
0565         /* Note that obj may be NULL */
0566         TP_STRUCT__entry(
0567             __field(unsigned int,       obj     )
0568             __field(ino_t,          inode       )
0569                  ),
0570 
0571         TP_fast_assign(
0572             __entry->obj    = obj ? obj->debug_id : 0;
0573             __entry->inode  = inode->i_ino;
0574                ),
0575 
0576         TP_printk("o=%08x B=%lx",
0577               __entry->obj, __entry->inode)
0578         );
0579 
0580 TRACE_EVENT(cachefiles_mark_failed,
0581         TP_PROTO(struct cachefiles_object *obj,
0582              struct inode *inode),
0583 
0584         TP_ARGS(obj, inode),
0585 
0586         /* Note that obj may be NULL */
0587         TP_STRUCT__entry(
0588             __field(unsigned int,       obj     )
0589             __field(ino_t,          inode       )
0590                  ),
0591 
0592         TP_fast_assign(
0593             __entry->obj    = obj ? obj->debug_id : 0;
0594             __entry->inode  = inode->i_ino;
0595                ),
0596 
0597         TP_printk("o=%08x B=%lx",
0598               __entry->obj, __entry->inode)
0599         );
0600 
0601 TRACE_EVENT(cachefiles_mark_inactive,
0602         TP_PROTO(struct cachefiles_object *obj,
0603              struct inode *inode),
0604 
0605         TP_ARGS(obj, inode),
0606 
0607         /* Note that obj may be NULL */
0608         TP_STRUCT__entry(
0609             __field(unsigned int,       obj     )
0610             __field(ino_t,          inode       )
0611                  ),
0612 
0613         TP_fast_assign(
0614             __entry->obj    = obj ? obj->debug_id : 0;
0615             __entry->inode  = inode->i_ino;
0616                ),
0617 
0618         TP_printk("o=%08x B=%lx",
0619               __entry->obj, __entry->inode)
0620         );
0621 
0622 TRACE_EVENT(cachefiles_vfs_error,
0623         TP_PROTO(struct cachefiles_object *obj, struct inode *backer,
0624              int error, enum cachefiles_error_trace where),
0625 
0626         TP_ARGS(obj, backer, error, where),
0627 
0628         TP_STRUCT__entry(
0629             __field(unsigned int,           obj )
0630             __field(unsigned int,           backer  )
0631             __field(enum cachefiles_error_trace,    where   )
0632             __field(short,              error   )
0633                  ),
0634 
0635         TP_fast_assign(
0636             __entry->obj    = obj ? obj->debug_id : 0;
0637             __entry->backer = backer->i_ino;
0638             __entry->error  = error;
0639             __entry->where  = where;
0640                ),
0641 
0642         TP_printk("o=%08x B=%x %s e=%d",
0643               __entry->obj,
0644               __entry->backer,
0645               __print_symbolic(__entry->where, cachefiles_error_traces),
0646               __entry->error)
0647         );
0648 
0649 TRACE_EVENT(cachefiles_io_error,
0650         TP_PROTO(struct cachefiles_object *obj, struct inode *backer,
0651              int error, enum cachefiles_error_trace where),
0652 
0653         TP_ARGS(obj, backer, error, where),
0654 
0655         TP_STRUCT__entry(
0656             __field(unsigned int,           obj )
0657             __field(unsigned int,           backer  )
0658             __field(enum cachefiles_error_trace,    where   )
0659             __field(short,              error   )
0660                  ),
0661 
0662         TP_fast_assign(
0663             __entry->obj    = obj ? obj->debug_id : 0;
0664             __entry->backer = backer->i_ino;
0665             __entry->error  = error;
0666             __entry->where  = where;
0667                ),
0668 
0669         TP_printk("o=%08x B=%x %s e=%d",
0670               __entry->obj,
0671               __entry->backer,
0672               __print_symbolic(__entry->where, cachefiles_error_traces),
0673               __entry->error)
0674         );
0675 
0676 TRACE_EVENT(cachefiles_ondemand_open,
0677         TP_PROTO(struct cachefiles_object *obj, struct cachefiles_msg *msg,
0678              struct cachefiles_open *load),
0679 
0680         TP_ARGS(obj, msg, load),
0681 
0682         TP_STRUCT__entry(
0683             __field(unsigned int,   obj     )
0684             __field(unsigned int,   msg_id      )
0685             __field(unsigned int,   object_id   )
0686             __field(unsigned int,   fd      )
0687             __field(unsigned int,   flags       )
0688                  ),
0689 
0690         TP_fast_assign(
0691             __entry->obj    = obj ? obj->debug_id : 0;
0692             __entry->msg_id = msg->msg_id;
0693             __entry->object_id  = msg->object_id;
0694             __entry->fd     = load->fd;
0695             __entry->flags  = load->flags;
0696                ),
0697 
0698         TP_printk("o=%08x mid=%x oid=%x fd=%d f=%x",
0699               __entry->obj,
0700               __entry->msg_id,
0701               __entry->object_id,
0702               __entry->fd,
0703               __entry->flags)
0704         );
0705 
0706 TRACE_EVENT(cachefiles_ondemand_copen,
0707         TP_PROTO(struct cachefiles_object *obj, unsigned int msg_id,
0708              long len),
0709 
0710         TP_ARGS(obj, msg_id, len),
0711 
0712         TP_STRUCT__entry(
0713             __field(unsigned int,   obj )
0714             __field(unsigned int,   msg_id  )
0715             __field(long,       len )
0716                  ),
0717 
0718         TP_fast_assign(
0719             __entry->obj    = obj ? obj->debug_id : 0;
0720             __entry->msg_id = msg_id;
0721             __entry->len    = len;
0722                ),
0723 
0724         TP_printk("o=%08x mid=%x l=%lx",
0725               __entry->obj,
0726               __entry->msg_id,
0727               __entry->len)
0728         );
0729 
0730 TRACE_EVENT(cachefiles_ondemand_close,
0731         TP_PROTO(struct cachefiles_object *obj, struct cachefiles_msg *msg),
0732 
0733         TP_ARGS(obj, msg),
0734 
0735         TP_STRUCT__entry(
0736             __field(unsigned int,   obj     )
0737             __field(unsigned int,   msg_id      )
0738             __field(unsigned int,   object_id   )
0739                  ),
0740 
0741         TP_fast_assign(
0742             __entry->obj    = obj ? obj->debug_id : 0;
0743             __entry->msg_id = msg->msg_id;
0744             __entry->object_id  = msg->object_id;
0745                ),
0746 
0747         TP_printk("o=%08x mid=%x oid=%x",
0748               __entry->obj,
0749               __entry->msg_id,
0750               __entry->object_id)
0751         );
0752 
0753 TRACE_EVENT(cachefiles_ondemand_read,
0754         TP_PROTO(struct cachefiles_object *obj, struct cachefiles_msg *msg,
0755              struct cachefiles_read *load),
0756 
0757         TP_ARGS(obj, msg, load),
0758 
0759         TP_STRUCT__entry(
0760             __field(unsigned int,   obj     )
0761             __field(unsigned int,   msg_id      )
0762             __field(unsigned int,   object_id   )
0763             __field(loff_t,     start       )
0764             __field(size_t,     len     )
0765                  ),
0766 
0767         TP_fast_assign(
0768             __entry->obj    = obj ? obj->debug_id : 0;
0769             __entry->msg_id = msg->msg_id;
0770             __entry->object_id  = msg->object_id;
0771             __entry->start  = load->off;
0772             __entry->len    = load->len;
0773                ),
0774 
0775         TP_printk("o=%08x mid=%x oid=%x s=%llx l=%zx",
0776               __entry->obj,
0777               __entry->msg_id,
0778               __entry->object_id,
0779               __entry->start,
0780               __entry->len)
0781         );
0782 
0783 TRACE_EVENT(cachefiles_ondemand_cread,
0784         TP_PROTO(struct cachefiles_object *obj, unsigned int msg_id),
0785 
0786         TP_ARGS(obj, msg_id),
0787 
0788         TP_STRUCT__entry(
0789             __field(unsigned int,   obj )
0790             __field(unsigned int,   msg_id  )
0791                  ),
0792 
0793         TP_fast_assign(
0794             __entry->obj    = obj ? obj->debug_id : 0;
0795             __entry->msg_id = msg_id;
0796                ),
0797 
0798         TP_printk("o=%08x mid=%x",
0799               __entry->obj,
0800               __entry->msg_id)
0801         );
0802 
0803 TRACE_EVENT(cachefiles_ondemand_fd_write,
0804         TP_PROTO(struct cachefiles_object *obj, struct inode *backer,
0805              loff_t start, size_t len),
0806 
0807         TP_ARGS(obj, backer, start, len),
0808 
0809         TP_STRUCT__entry(
0810             __field(unsigned int,   obj )
0811             __field(unsigned int,   backer  )
0812             __field(loff_t,     start   )
0813             __field(size_t,     len )
0814                  ),
0815 
0816         TP_fast_assign(
0817             __entry->obj    = obj ? obj->debug_id : 0;
0818             __entry->backer = backer->i_ino;
0819             __entry->start  = start;
0820             __entry->len    = len;
0821                ),
0822 
0823         TP_printk("o=%08x iB=%x s=%llx l=%zx",
0824               __entry->obj,
0825               __entry->backer,
0826               __entry->start,
0827               __entry->len)
0828         );
0829 
0830 TRACE_EVENT(cachefiles_ondemand_fd_release,
0831         TP_PROTO(struct cachefiles_object *obj, int object_id),
0832 
0833         TP_ARGS(obj, object_id),
0834 
0835         TP_STRUCT__entry(
0836             __field(unsigned int,   obj     )
0837             __field(unsigned int,   object_id   )
0838                  ),
0839 
0840         TP_fast_assign(
0841             __entry->obj    = obj ? obj->debug_id : 0;
0842             __entry->object_id  = object_id;
0843                ),
0844 
0845         TP_printk("o=%08x oid=%x",
0846               __entry->obj,
0847               __entry->object_id)
0848         );
0849 
0850 #endif /* _TRACE_CACHEFILES_H */
0851 
0852 /* This part must be outside protection */
0853 #include <trace/define_trace.h>