Namjae Jeon | a2a4a7e | 2013-04-20 01:28:40 +0900 | [diff] [blame] | 1 | #undef TRACE_SYSTEM |
| 2 | #define TRACE_SYSTEM f2fs |
| 3 | |
| 4 | #if !defined(_TRACE_F2FS_H) || defined(TRACE_HEADER_MULTI_READ) |
| 5 | #define _TRACE_F2FS_H |
| 6 | |
| 7 | #include <linux/tracepoint.h> |
| 8 | |
| 9 | #define show_dev(entry) MAJOR(entry->dev), MINOR(entry->dev) |
| 10 | #define show_dev_ino(entry) show_dev(entry), (unsigned long)entry->ino |
Namjae Jeon | 6ec178d | 2013-04-23 17:51:43 +0900 | [diff] [blame] | 11 | |
| 12 | #define show_block_type(type) \ |
| 13 | __print_symbolic(type, \ |
| 14 | { NODE, "NODE" }, \ |
| 15 | { DATA, "DATA" }, \ |
| 16 | { META, "META" }, \ |
| 17 | { META_FLUSH, "META_FLUSH" }) |
| 18 | |
Namjae Jeon | 848753a | 2013-04-23 16:38:02 +0900 | [diff] [blame] | 19 | #define show_bio_type(type) \ |
| 20 | __print_symbolic(type, \ |
Chao Yu | d4d288b | 2013-11-24 12:36:42 +0900 | [diff] [blame] | 21 | { READ, "READ" }, \ |
| 22 | { READA, "READAHEAD" }, \ |
| 23 | { READ_SYNC, "READ_SYNC" }, \ |
| 24 | { WRITE, "WRITE" }, \ |
| 25 | { WRITE_SYNC, "WRITE_SYNC" }, \ |
| 26 | { WRITE_FLUSH, "WRITE_FLUSH" }, \ |
| 27 | { WRITE_FUA, "WRITE_FUA" }, \ |
| 28 | { WRITE_FLUSH_FUA, "WRITE_FLUSH_FUA" }) |
Namjae Jeon | a2a4a7e | 2013-04-20 01:28:40 +0900 | [diff] [blame] | 29 | |
Namjae Jeon | 8e46b3e | 2013-04-23 16:42:53 +0900 | [diff] [blame] | 30 | #define show_data_type(type) \ |
| 31 | __print_symbolic(type, \ |
| 32 | { CURSEG_HOT_DATA, "Hot DATA" }, \ |
| 33 | { CURSEG_WARM_DATA, "Warm DATA" }, \ |
| 34 | { CURSEG_COLD_DATA, "Cold DATA" }, \ |
| 35 | { CURSEG_HOT_NODE, "Hot NODE" }, \ |
| 36 | { CURSEG_WARM_NODE, "Warm NODE" }, \ |
| 37 | { CURSEG_COLD_NODE, "Cold NODE" }, \ |
| 38 | { NO_CHECK_TYPE, "No TYPE" }) |
| 39 | |
Jaegeuk Kim | 26c6b88 | 2013-10-24 17:53:29 +0900 | [diff] [blame] | 40 | #define show_file_type(type) \ |
| 41 | __print_symbolic(type, \ |
| 42 | { 0, "FILE" }, \ |
| 43 | { 1, "DIR" }) |
| 44 | |
Namjae Jeon | 8e46b3e | 2013-04-23 16:42:53 +0900 | [diff] [blame] | 45 | #define show_gc_type(type) \ |
| 46 | __print_symbolic(type, \ |
| 47 | { FG_GC, "Foreground GC" }, \ |
| 48 | { BG_GC, "Background GC" }) |
| 49 | |
| 50 | #define show_alloc_mode(type) \ |
| 51 | __print_symbolic(type, \ |
| 52 | { LFS, "LFS-mode" }, \ |
| 53 | { SSR, "SSR-mode" }) |
| 54 | |
| 55 | #define show_victim_policy(type) \ |
| 56 | __print_symbolic(type, \ |
| 57 | { GC_GREEDY, "Greedy" }, \ |
| 58 | { GC_CB, "Cost-Benefit" }) |
| 59 | |
| 60 | struct victim_sel_policy; |
| 61 | |
Namjae Jeon | a2a4a7e | 2013-04-20 01:28:40 +0900 | [diff] [blame] | 62 | DECLARE_EVENT_CLASS(f2fs__inode, |
| 63 | |
| 64 | TP_PROTO(struct inode *inode), |
| 65 | |
| 66 | TP_ARGS(inode), |
| 67 | |
| 68 | TP_STRUCT__entry( |
| 69 | __field(dev_t, dev) |
| 70 | __field(ino_t, ino) |
| 71 | __field(ino_t, pino) |
| 72 | __field(umode_t, mode) |
| 73 | __field(loff_t, size) |
| 74 | __field(unsigned int, nlink) |
| 75 | __field(blkcnt_t, blocks) |
| 76 | __field(__u8, advise) |
| 77 | ), |
| 78 | |
| 79 | TP_fast_assign( |
| 80 | __entry->dev = inode->i_sb->s_dev; |
| 81 | __entry->ino = inode->i_ino; |
| 82 | __entry->pino = F2FS_I(inode)->i_pino; |
| 83 | __entry->mode = inode->i_mode; |
| 84 | __entry->nlink = inode->i_nlink; |
| 85 | __entry->size = inode->i_size; |
| 86 | __entry->blocks = inode->i_blocks; |
| 87 | __entry->advise = F2FS_I(inode)->i_advise; |
| 88 | ), |
| 89 | |
| 90 | TP_printk("dev = (%d,%d), ino = %lu, pino = %lu, i_mode = 0x%hx, " |
| 91 | "i_size = %lld, i_nlink = %u, i_blocks = %llu, i_advise = 0x%x", |
| 92 | show_dev_ino(__entry), |
| 93 | (unsigned long)__entry->pino, |
| 94 | __entry->mode, |
| 95 | __entry->size, |
| 96 | (unsigned int)__entry->nlink, |
| 97 | (unsigned long long)__entry->blocks, |
| 98 | (unsigned char)__entry->advise) |
| 99 | ); |
| 100 | |
| 101 | DECLARE_EVENT_CLASS(f2fs__inode_exit, |
| 102 | |
| 103 | TP_PROTO(struct inode *inode, int ret), |
| 104 | |
| 105 | TP_ARGS(inode, ret), |
| 106 | |
| 107 | TP_STRUCT__entry( |
| 108 | __field(dev_t, dev) |
| 109 | __field(ino_t, ino) |
| 110 | __field(int, ret) |
| 111 | ), |
| 112 | |
| 113 | TP_fast_assign( |
| 114 | __entry->dev = inode->i_sb->s_dev; |
| 115 | __entry->ino = inode->i_ino; |
| 116 | __entry->ret = ret; |
| 117 | ), |
| 118 | |
| 119 | TP_printk("dev = (%d,%d), ino = %lu, ret = %d", |
| 120 | show_dev_ino(__entry), |
| 121 | __entry->ret) |
| 122 | ); |
| 123 | |
| 124 | DEFINE_EVENT(f2fs__inode, f2fs_sync_file_enter, |
| 125 | |
| 126 | TP_PROTO(struct inode *inode), |
| 127 | |
| 128 | TP_ARGS(inode) |
| 129 | ); |
| 130 | |
| 131 | TRACE_EVENT(f2fs_sync_file_exit, |
| 132 | |
| 133 | TP_PROTO(struct inode *inode, bool need_cp, int datasync, int ret), |
| 134 | |
| 135 | TP_ARGS(inode, need_cp, datasync, ret), |
| 136 | |
| 137 | TP_STRUCT__entry( |
| 138 | __field(dev_t, dev) |
| 139 | __field(ino_t, ino) |
| 140 | __field(bool, need_cp) |
| 141 | __field(int, datasync) |
| 142 | __field(int, ret) |
| 143 | ), |
| 144 | |
| 145 | TP_fast_assign( |
| 146 | __entry->dev = inode->i_sb->s_dev; |
| 147 | __entry->ino = inode->i_ino; |
| 148 | __entry->need_cp = need_cp; |
| 149 | __entry->datasync = datasync; |
| 150 | __entry->ret = ret; |
| 151 | ), |
| 152 | |
| 153 | TP_printk("dev = (%d,%d), ino = %lu, checkpoint is %s, " |
| 154 | "datasync = %d, ret = %d", |
| 155 | show_dev_ino(__entry), |
| 156 | __entry->need_cp ? "needed" : "not needed", |
| 157 | __entry->datasync, |
| 158 | __entry->ret) |
| 159 | ); |
| 160 | |
| 161 | TRACE_EVENT(f2fs_sync_fs, |
| 162 | |
| 163 | TP_PROTO(struct super_block *sb, int wait), |
| 164 | |
| 165 | TP_ARGS(sb, wait), |
| 166 | |
| 167 | TP_STRUCT__entry( |
| 168 | __field(dev_t, dev) |
| 169 | __field(int, dirty) |
| 170 | __field(int, wait) |
| 171 | ), |
| 172 | |
| 173 | TP_fast_assign( |
| 174 | __entry->dev = sb->s_dev; |
| 175 | __entry->dirty = F2FS_SB(sb)->s_dirty; |
| 176 | __entry->wait = wait; |
| 177 | ), |
| 178 | |
| 179 | TP_printk("dev = (%d,%d), superblock is %s, wait = %d", |
| 180 | show_dev(__entry), |
| 181 | __entry->dirty ? "dirty" : "not dirty", |
| 182 | __entry->wait) |
| 183 | ); |
| 184 | |
| 185 | DEFINE_EVENT(f2fs__inode, f2fs_iget, |
| 186 | |
| 187 | TP_PROTO(struct inode *inode), |
| 188 | |
| 189 | TP_ARGS(inode) |
| 190 | ); |
| 191 | |
| 192 | DEFINE_EVENT(f2fs__inode_exit, f2fs_iget_exit, |
| 193 | |
| 194 | TP_PROTO(struct inode *inode, int ret), |
| 195 | |
| 196 | TP_ARGS(inode, ret) |
| 197 | ); |
| 198 | |
| 199 | DEFINE_EVENT(f2fs__inode, f2fs_evict_inode, |
| 200 | |
| 201 | TP_PROTO(struct inode *inode), |
| 202 | |
| 203 | TP_ARGS(inode) |
| 204 | ); |
| 205 | |
Jaegeuk Kim | d70b4f5 | 2013-04-25 13:24:33 +0900 | [diff] [blame] | 206 | DEFINE_EVENT(f2fs__inode_exit, f2fs_new_inode, |
| 207 | |
| 208 | TP_PROTO(struct inode *inode, int ret), |
| 209 | |
| 210 | TP_ARGS(inode, ret) |
| 211 | ); |
| 212 | |
Namjae Jeon | a2a4a7e | 2013-04-20 01:28:40 +0900 | [diff] [blame] | 213 | TRACE_EVENT(f2fs_unlink_enter, |
| 214 | |
| 215 | TP_PROTO(struct inode *dir, struct dentry *dentry), |
| 216 | |
| 217 | TP_ARGS(dir, dentry), |
| 218 | |
| 219 | TP_STRUCT__entry( |
| 220 | __field(dev_t, dev) |
| 221 | __field(ino_t, ino) |
| 222 | __field(loff_t, size) |
| 223 | __field(blkcnt_t, blocks) |
| 224 | __field(const char *, name) |
| 225 | ), |
| 226 | |
| 227 | TP_fast_assign( |
| 228 | __entry->dev = dir->i_sb->s_dev; |
| 229 | __entry->ino = dir->i_ino; |
| 230 | __entry->size = dir->i_size; |
| 231 | __entry->blocks = dir->i_blocks; |
| 232 | __entry->name = dentry->d_name.name; |
| 233 | ), |
| 234 | |
| 235 | TP_printk("dev = (%d,%d), dir ino = %lu, i_size = %lld, " |
| 236 | "i_blocks = %llu, name = %s", |
| 237 | show_dev_ino(__entry), |
| 238 | __entry->size, |
| 239 | (unsigned long long)__entry->blocks, |
| 240 | __entry->name) |
| 241 | ); |
| 242 | |
| 243 | DEFINE_EVENT(f2fs__inode_exit, f2fs_unlink_exit, |
| 244 | |
| 245 | TP_PROTO(struct inode *inode, int ret), |
| 246 | |
| 247 | TP_ARGS(inode, ret) |
| 248 | ); |
Namjae Jeon | 51dd624 | 2013-04-20 01:28:52 +0900 | [diff] [blame] | 249 | |
| 250 | DEFINE_EVENT(f2fs__inode, f2fs_truncate, |
| 251 | |
| 252 | TP_PROTO(struct inode *inode), |
| 253 | |
| 254 | TP_ARGS(inode) |
| 255 | ); |
| 256 | |
| 257 | TRACE_EVENT(f2fs_truncate_data_blocks_range, |
| 258 | |
| 259 | TP_PROTO(struct inode *inode, nid_t nid, unsigned int ofs, int free), |
| 260 | |
| 261 | TP_ARGS(inode, nid, ofs, free), |
| 262 | |
| 263 | TP_STRUCT__entry( |
| 264 | __field(dev_t, dev) |
| 265 | __field(ino_t, ino) |
| 266 | __field(nid_t, nid) |
| 267 | __field(unsigned int, ofs) |
| 268 | __field(int, free) |
| 269 | ), |
| 270 | |
| 271 | TP_fast_assign( |
| 272 | __entry->dev = inode->i_sb->s_dev; |
| 273 | __entry->ino = inode->i_ino; |
| 274 | __entry->nid = nid; |
| 275 | __entry->ofs = ofs; |
| 276 | __entry->free = free; |
| 277 | ), |
| 278 | |
| 279 | TP_printk("dev = (%d,%d), ino = %lu, nid = %u, offset = %u, freed = %d", |
| 280 | show_dev_ino(__entry), |
| 281 | (unsigned int)__entry->nid, |
| 282 | __entry->ofs, |
| 283 | __entry->free) |
| 284 | ); |
| 285 | |
| 286 | DECLARE_EVENT_CLASS(f2fs__truncate_op, |
| 287 | |
| 288 | TP_PROTO(struct inode *inode, u64 from), |
| 289 | |
| 290 | TP_ARGS(inode, from), |
| 291 | |
| 292 | TP_STRUCT__entry( |
| 293 | __field(dev_t, dev) |
| 294 | __field(ino_t, ino) |
| 295 | __field(loff_t, size) |
| 296 | __field(blkcnt_t, blocks) |
| 297 | __field(u64, from) |
| 298 | ), |
| 299 | |
| 300 | TP_fast_assign( |
| 301 | __entry->dev = inode->i_sb->s_dev; |
| 302 | __entry->ino = inode->i_ino; |
| 303 | __entry->size = inode->i_size; |
| 304 | __entry->blocks = inode->i_blocks; |
| 305 | __entry->from = from; |
| 306 | ), |
| 307 | |
| 308 | TP_printk("dev = (%d,%d), ino = %lu, i_size = %lld, i_blocks = %llu, " |
| 309 | "start file offset = %llu", |
| 310 | show_dev_ino(__entry), |
| 311 | __entry->size, |
| 312 | (unsigned long long)__entry->blocks, |
| 313 | (unsigned long long)__entry->from) |
| 314 | ); |
| 315 | |
| 316 | DEFINE_EVENT(f2fs__truncate_op, f2fs_truncate_blocks_enter, |
| 317 | |
| 318 | TP_PROTO(struct inode *inode, u64 from), |
| 319 | |
| 320 | TP_ARGS(inode, from) |
| 321 | ); |
| 322 | |
| 323 | DEFINE_EVENT(f2fs__inode_exit, f2fs_truncate_blocks_exit, |
| 324 | |
| 325 | TP_PROTO(struct inode *inode, int ret), |
| 326 | |
| 327 | TP_ARGS(inode, ret) |
| 328 | ); |
| 329 | |
| 330 | DEFINE_EVENT(f2fs__truncate_op, f2fs_truncate_inode_blocks_enter, |
| 331 | |
| 332 | TP_PROTO(struct inode *inode, u64 from), |
| 333 | |
| 334 | TP_ARGS(inode, from) |
| 335 | ); |
| 336 | |
| 337 | DEFINE_EVENT(f2fs__inode_exit, f2fs_truncate_inode_blocks_exit, |
| 338 | |
| 339 | TP_PROTO(struct inode *inode, int ret), |
| 340 | |
| 341 | TP_ARGS(inode, ret) |
| 342 | ); |
| 343 | |
| 344 | DECLARE_EVENT_CLASS(f2fs__truncate_node, |
| 345 | |
| 346 | TP_PROTO(struct inode *inode, nid_t nid, block_t blk_addr), |
| 347 | |
| 348 | TP_ARGS(inode, nid, blk_addr), |
| 349 | |
| 350 | TP_STRUCT__entry( |
| 351 | __field(dev_t, dev) |
| 352 | __field(ino_t, ino) |
| 353 | __field(nid_t, nid) |
| 354 | __field(block_t, blk_addr) |
| 355 | ), |
| 356 | |
| 357 | TP_fast_assign( |
| 358 | __entry->dev = inode->i_sb->s_dev; |
| 359 | __entry->ino = inode->i_ino; |
| 360 | __entry->nid = nid; |
| 361 | __entry->blk_addr = blk_addr; |
| 362 | ), |
| 363 | |
| 364 | TP_printk("dev = (%d,%d), ino = %lu, nid = %u, block_address = 0x%llx", |
| 365 | show_dev_ino(__entry), |
| 366 | (unsigned int)__entry->nid, |
| 367 | (unsigned long long)__entry->blk_addr) |
| 368 | ); |
| 369 | |
| 370 | DEFINE_EVENT(f2fs__truncate_node, f2fs_truncate_nodes_enter, |
| 371 | |
| 372 | TP_PROTO(struct inode *inode, nid_t nid, block_t blk_addr), |
| 373 | |
| 374 | TP_ARGS(inode, nid, blk_addr) |
| 375 | ); |
| 376 | |
| 377 | DEFINE_EVENT(f2fs__inode_exit, f2fs_truncate_nodes_exit, |
| 378 | |
| 379 | TP_PROTO(struct inode *inode, int ret), |
| 380 | |
| 381 | TP_ARGS(inode, ret) |
| 382 | ); |
| 383 | |
| 384 | DEFINE_EVENT(f2fs__truncate_node, f2fs_truncate_node, |
| 385 | |
| 386 | TP_PROTO(struct inode *inode, nid_t nid, block_t blk_addr), |
| 387 | |
| 388 | TP_ARGS(inode, nid, blk_addr) |
| 389 | ); |
| 390 | |
| 391 | TRACE_EVENT(f2fs_truncate_partial_nodes, |
| 392 | |
| 393 | TP_PROTO(struct inode *inode, nid_t nid[], int depth, int err), |
| 394 | |
| 395 | TP_ARGS(inode, nid, depth, err), |
| 396 | |
| 397 | TP_STRUCT__entry( |
| 398 | __field(dev_t, dev) |
| 399 | __field(ino_t, ino) |
| 400 | __field(nid_t, nid[3]) |
| 401 | __field(int, depth) |
| 402 | __field(int, err) |
| 403 | ), |
| 404 | |
| 405 | TP_fast_assign( |
| 406 | __entry->dev = inode->i_sb->s_dev; |
| 407 | __entry->ino = inode->i_ino; |
| 408 | __entry->nid[0] = nid[0]; |
| 409 | __entry->nid[1] = nid[1]; |
| 410 | __entry->nid[2] = nid[2]; |
| 411 | __entry->depth = depth; |
| 412 | __entry->err = err; |
| 413 | ), |
| 414 | |
| 415 | TP_printk("dev = (%d,%d), ino = %lu, " |
| 416 | "nid[0] = %u, nid[1] = %u, nid[2] = %u, depth = %d, err = %d", |
| 417 | show_dev_ino(__entry), |
| 418 | (unsigned int)__entry->nid[0], |
| 419 | (unsigned int)__entry->nid[1], |
| 420 | (unsigned int)__entry->nid[2], |
| 421 | __entry->depth, |
| 422 | __entry->err) |
| 423 | ); |
| 424 | |
Namjae Jeon | 848753a | 2013-04-23 16:38:02 +0900 | [diff] [blame] | 425 | TRACE_EVENT_CONDITION(f2fs_readpage, |
| 426 | |
| 427 | TP_PROTO(struct page *page, sector_t blkaddr, int type), |
| 428 | |
| 429 | TP_ARGS(page, blkaddr, type), |
| 430 | |
| 431 | TP_CONDITION(page->mapping), |
| 432 | |
| 433 | TP_STRUCT__entry( |
| 434 | __field(dev_t, dev) |
| 435 | __field(ino_t, ino) |
| 436 | __field(pgoff_t, index) |
| 437 | __field(sector_t, blkaddr) |
| 438 | __field(int, type) |
| 439 | ), |
| 440 | |
| 441 | TP_fast_assign( |
| 442 | __entry->dev = page->mapping->host->i_sb->s_dev; |
| 443 | __entry->ino = page->mapping->host->i_ino; |
| 444 | __entry->index = page->index; |
| 445 | __entry->blkaddr = blkaddr; |
| 446 | __entry->type = type; |
| 447 | ), |
| 448 | |
| 449 | TP_printk("dev = (%d,%d), ino = %lu, page_index = 0x%lx, " |
| 450 | "blkaddr = 0x%llx, bio_type = %s", |
| 451 | show_dev_ino(__entry), |
| 452 | (unsigned long)__entry->index, |
| 453 | (unsigned long long)__entry->blkaddr, |
| 454 | show_bio_type(__entry->type)) |
| 455 | ); |
| 456 | |
| 457 | TRACE_EVENT(f2fs_get_data_block, |
| 458 | TP_PROTO(struct inode *inode, sector_t iblock, |
| 459 | struct buffer_head *bh, int ret), |
| 460 | |
| 461 | TP_ARGS(inode, iblock, bh, ret), |
| 462 | |
| 463 | TP_STRUCT__entry( |
| 464 | __field(dev_t, dev) |
| 465 | __field(ino_t, ino) |
| 466 | __field(sector_t, iblock) |
| 467 | __field(sector_t, bh_start) |
| 468 | __field(size_t, bh_size) |
| 469 | __field(int, ret) |
| 470 | ), |
| 471 | |
| 472 | TP_fast_assign( |
| 473 | __entry->dev = inode->i_sb->s_dev; |
| 474 | __entry->ino = inode->i_ino; |
| 475 | __entry->iblock = iblock; |
| 476 | __entry->bh_start = bh->b_blocknr; |
| 477 | __entry->bh_size = bh->b_size; |
| 478 | __entry->ret = ret; |
| 479 | ), |
| 480 | |
| 481 | TP_printk("dev = (%d,%d), ino = %lu, file offset = %llu, " |
| 482 | "start blkaddr = 0x%llx, len = 0x%llx bytes, err = %d", |
| 483 | show_dev_ino(__entry), |
| 484 | (unsigned long long)__entry->iblock, |
| 485 | (unsigned long long)__entry->bh_start, |
| 486 | (unsigned long long)__entry->bh_size, |
| 487 | __entry->ret) |
| 488 | ); |
| 489 | |
Namjae Jeon | 8e46b3e | 2013-04-23 16:42:53 +0900 | [diff] [blame] | 490 | TRACE_EVENT(f2fs_get_victim, |
| 491 | |
| 492 | TP_PROTO(struct super_block *sb, int type, int gc_type, |
| 493 | struct victim_sel_policy *p, unsigned int pre_victim, |
| 494 | unsigned int prefree, unsigned int free), |
| 495 | |
| 496 | TP_ARGS(sb, type, gc_type, p, pre_victim, prefree, free), |
| 497 | |
| 498 | TP_STRUCT__entry( |
| 499 | __field(dev_t, dev) |
| 500 | __field(int, type) |
| 501 | __field(int, gc_type) |
| 502 | __field(int, alloc_mode) |
| 503 | __field(int, gc_mode) |
| 504 | __field(unsigned int, victim) |
| 505 | __field(unsigned int, ofs_unit) |
| 506 | __field(unsigned int, pre_victim) |
| 507 | __field(unsigned int, prefree) |
| 508 | __field(unsigned int, free) |
| 509 | ), |
| 510 | |
| 511 | TP_fast_assign( |
| 512 | __entry->dev = sb->s_dev; |
| 513 | __entry->type = type; |
| 514 | __entry->gc_type = gc_type; |
| 515 | __entry->alloc_mode = p->alloc_mode; |
| 516 | __entry->gc_mode = p->gc_mode; |
| 517 | __entry->victim = p->min_segno; |
| 518 | __entry->ofs_unit = p->ofs_unit; |
| 519 | __entry->pre_victim = pre_victim; |
| 520 | __entry->prefree = prefree; |
| 521 | __entry->free = free; |
| 522 | ), |
| 523 | |
| 524 | TP_printk("dev = (%d,%d), type = %s, policy = (%s, %s, %s), victim = %u " |
| 525 | "ofs_unit = %u, pre_victim_secno = %d, prefree = %u, free = %u", |
| 526 | show_dev(__entry), |
| 527 | show_data_type(__entry->type), |
| 528 | show_gc_type(__entry->gc_type), |
| 529 | show_alloc_mode(__entry->alloc_mode), |
| 530 | show_victim_policy(__entry->gc_mode), |
| 531 | __entry->victim, |
| 532 | __entry->ofs_unit, |
| 533 | (int)__entry->pre_victim, |
| 534 | __entry->prefree, |
| 535 | __entry->free) |
| 536 | ); |
| 537 | |
Namjae Jeon | c01e285 | 2013-04-23 17:00:52 +0900 | [diff] [blame] | 538 | TRACE_EVENT(f2fs_fallocate, |
| 539 | |
| 540 | TP_PROTO(struct inode *inode, int mode, |
| 541 | loff_t offset, loff_t len, int ret), |
| 542 | |
| 543 | TP_ARGS(inode, mode, offset, len, ret), |
| 544 | |
| 545 | TP_STRUCT__entry( |
| 546 | __field(dev_t, dev) |
| 547 | __field(ino_t, ino) |
| 548 | __field(int, mode) |
| 549 | __field(loff_t, offset) |
| 550 | __field(loff_t, len) |
| 551 | __field(loff_t, size) |
| 552 | __field(blkcnt_t, blocks) |
| 553 | __field(int, ret) |
| 554 | ), |
| 555 | |
| 556 | TP_fast_assign( |
| 557 | __entry->dev = inode->i_sb->s_dev; |
| 558 | __entry->ino = inode->i_ino; |
| 559 | __entry->mode = mode; |
| 560 | __entry->offset = offset; |
| 561 | __entry->len = len; |
| 562 | __entry->size = inode->i_size; |
| 563 | __entry->blocks = inode->i_blocks; |
| 564 | __entry->ret = ret; |
| 565 | ), |
| 566 | |
| 567 | TP_printk("dev = (%d,%d), ino = %lu, mode = %x, offset = %lld, " |
| 568 | "len = %lld, i_size = %lld, i_blocks = %llu, ret = %d", |
| 569 | show_dev_ino(__entry), |
| 570 | __entry->mode, |
| 571 | (unsigned long long)__entry->offset, |
| 572 | (unsigned long long)__entry->len, |
| 573 | (unsigned long long)__entry->size, |
| 574 | (unsigned long long)__entry->blocks, |
| 575 | __entry->ret) |
| 576 | ); |
| 577 | |
| 578 | TRACE_EVENT(f2fs_reserve_new_block, |
| 579 | |
| 580 | TP_PROTO(struct inode *inode, nid_t nid, unsigned int ofs_in_node), |
| 581 | |
| 582 | TP_ARGS(inode, nid, ofs_in_node), |
| 583 | |
| 584 | TP_STRUCT__entry( |
| 585 | __field(dev_t, dev) |
| 586 | __field(nid_t, nid) |
| 587 | __field(unsigned int, ofs_in_node) |
| 588 | ), |
| 589 | |
| 590 | TP_fast_assign( |
| 591 | __entry->dev = inode->i_sb->s_dev; |
| 592 | __entry->nid = nid; |
| 593 | __entry->ofs_in_node = ofs_in_node; |
| 594 | ), |
| 595 | |
| 596 | TP_printk("dev = (%d,%d), nid = %u, ofs_in_node = %u", |
| 597 | show_dev(__entry), |
| 598 | (unsigned int)__entry->nid, |
| 599 | __entry->ofs_in_node) |
| 600 | ); |
| 601 | |
Chao Yu | d4d288b | 2013-11-24 12:36:42 +0900 | [diff] [blame] | 602 | DECLARE_EVENT_CLASS(f2fs__submit_bio, |
Namjae Jeon | 6ec178d | 2013-04-23 17:51:43 +0900 | [diff] [blame] | 603 | |
Chao Yu | d4d288b | 2013-11-24 12:36:42 +0900 | [diff] [blame] | 604 | TP_PROTO(struct super_block *sb, int rw, int type, struct bio *bio), |
Namjae Jeon | 6ec178d | 2013-04-23 17:51:43 +0900 | [diff] [blame] | 605 | |
Chao Yu | d4d288b | 2013-11-24 12:36:42 +0900 | [diff] [blame] | 606 | TP_ARGS(sb, rw, type, bio), |
Namjae Jeon | 6ec178d | 2013-04-23 17:51:43 +0900 | [diff] [blame] | 607 | |
| 608 | TP_STRUCT__entry( |
| 609 | __field(dev_t, dev) |
Chao Yu | d4d288b | 2013-11-24 12:36:42 +0900 | [diff] [blame] | 610 | __field(int, rw) |
| 611 | __field(int, type) |
Namjae Jeon | 6ec178d | 2013-04-23 17:51:43 +0900 | [diff] [blame] | 612 | __field(sector_t, sector) |
| 613 | __field(unsigned int, size) |
| 614 | ), |
| 615 | |
| 616 | TP_fast_assign( |
| 617 | __entry->dev = sb->s_dev; |
Chao Yu | d4d288b | 2013-11-24 12:36:42 +0900 | [diff] [blame] | 618 | __entry->rw = rw; |
| 619 | __entry->type = type; |
Namjae Jeon | 6ec178d | 2013-04-23 17:51:43 +0900 | [diff] [blame] | 620 | __entry->sector = bio->bi_sector; |
| 621 | __entry->size = bio->bi_size; |
| 622 | ), |
| 623 | |
Chao Yu | d4d288b | 2013-11-24 12:36:42 +0900 | [diff] [blame] | 624 | TP_printk("dev = (%d,%d), %s, %s, sector = %lld, size = %u", |
Namjae Jeon | 6ec178d | 2013-04-23 17:51:43 +0900 | [diff] [blame] | 625 | show_dev(__entry), |
Chao Yu | d4d288b | 2013-11-24 12:36:42 +0900 | [diff] [blame] | 626 | show_bio_type(__entry->rw), |
| 627 | show_block_type(__entry->type), |
Namjae Jeon | 6ec178d | 2013-04-23 17:51:43 +0900 | [diff] [blame] | 628 | (unsigned long long)__entry->sector, |
| 629 | __entry->size) |
| 630 | ); |
| 631 | |
Chao Yu | d4d288b | 2013-11-24 12:36:42 +0900 | [diff] [blame] | 632 | DEFINE_EVENT(f2fs__submit_bio, f2fs_submit_write_bio, |
| 633 | |
| 634 | TP_PROTO(struct super_block *sb, int rw, int type, struct bio *bio), |
| 635 | |
| 636 | TP_ARGS(sb, rw, type, bio) |
| 637 | ); |
| 638 | |
| 639 | DEFINE_EVENT(f2fs__submit_bio, f2fs_submit_read_bio, |
| 640 | |
| 641 | TP_PROTO(struct super_block *sb, int rw, int type, struct bio *bio), |
| 642 | |
| 643 | TP_ARGS(sb, rw, type, bio) |
| 644 | ); |
| 645 | |
Jaegeuk Kim | 26c6b88 | 2013-10-24 17:53:29 +0900 | [diff] [blame] | 646 | DECLARE_EVENT_CLASS(f2fs__page, |
| 647 | |
| 648 | TP_PROTO(struct page *page, int type), |
| 649 | |
| 650 | TP_ARGS(page, type), |
| 651 | |
| 652 | TP_STRUCT__entry( |
| 653 | __field(dev_t, dev) |
| 654 | __field(ino_t, ino) |
| 655 | __field(int, type) |
| 656 | __field(int, dir) |
| 657 | __field(pgoff_t, index) |
| 658 | __field(int, dirty) |
| 659 | ), |
| 660 | |
| 661 | TP_fast_assign( |
| 662 | __entry->dev = page->mapping->host->i_sb->s_dev; |
| 663 | __entry->ino = page->mapping->host->i_ino; |
| 664 | __entry->type = type; |
| 665 | __entry->dir = S_ISDIR(page->mapping->host->i_mode); |
| 666 | __entry->index = page->index; |
| 667 | __entry->dirty = PageDirty(page); |
| 668 | ), |
| 669 | |
| 670 | TP_printk("dev = (%d,%d), ino = %lu, %s, %s, index = %lu, dirty = %d", |
| 671 | show_dev_ino(__entry), |
| 672 | show_block_type(__entry->type), |
| 673 | show_file_type(__entry->dir), |
| 674 | (unsigned long)__entry->index, |
| 675 | __entry->dirty) |
| 676 | ); |
| 677 | |
| 678 | DEFINE_EVENT(f2fs__page, f2fs_set_page_dirty, |
| 679 | |
| 680 | TP_PROTO(struct page *page, int type), |
| 681 | |
| 682 | TP_ARGS(page, type) |
| 683 | ); |
| 684 | |
Jaegeuk Kim | e943a10 | 2013-10-25 14:26:31 +0900 | [diff] [blame] | 685 | DEFINE_EVENT(f2fs__page, f2fs_vm_page_mkwrite, |
| 686 | |
| 687 | TP_PROTO(struct page *page, int type), |
| 688 | |
| 689 | TP_ARGS(page, type) |
| 690 | ); |
| 691 | |
Chao Yu | 87b8872 | 2013-11-20 16:40:10 +0800 | [diff] [blame] | 692 | DECLARE_EVENT_CLASS(f2fs_io_page, |
Namjae Jeon | 6ec178d | 2013-04-23 17:51:43 +0900 | [diff] [blame] | 693 | |
Chao Yu | 87b8872 | 2013-11-20 16:40:10 +0800 | [diff] [blame] | 694 | TP_PROTO(struct page *page, int rw, int type, block_t blk_addr), |
Namjae Jeon | 6ec178d | 2013-04-23 17:51:43 +0900 | [diff] [blame] | 695 | |
Chao Yu | 87b8872 | 2013-11-20 16:40:10 +0800 | [diff] [blame] | 696 | TP_ARGS(page, rw, type, blk_addr), |
Namjae Jeon | 6ec178d | 2013-04-23 17:51:43 +0900 | [diff] [blame] | 697 | |
| 698 | TP_STRUCT__entry( |
| 699 | __field(dev_t, dev) |
| 700 | __field(ino_t, ino) |
Chao Yu | 87b8872 | 2013-11-20 16:40:10 +0800 | [diff] [blame] | 701 | __field(int, rw) |
Namjae Jeon | 6ec178d | 2013-04-23 17:51:43 +0900 | [diff] [blame] | 702 | __field(int, type) |
| 703 | __field(pgoff_t, index) |
| 704 | __field(block_t, block) |
| 705 | ), |
| 706 | |
| 707 | TP_fast_assign( |
| 708 | __entry->dev = page->mapping->host->i_sb->s_dev; |
| 709 | __entry->ino = page->mapping->host->i_ino; |
Chao Yu | 87b8872 | 2013-11-20 16:40:10 +0800 | [diff] [blame] | 710 | __entry->rw = rw; |
Namjae Jeon | 6ec178d | 2013-04-23 17:51:43 +0900 | [diff] [blame] | 711 | __entry->type = type; |
| 712 | __entry->index = page->index; |
| 713 | __entry->block = blk_addr; |
| 714 | ), |
| 715 | |
Chao Yu | 87b8872 | 2013-11-20 16:40:10 +0800 | [diff] [blame] | 716 | TP_printk("dev = (%d,%d), ino = %lu, %s, %s, index = %lu, blkaddr = 0x%llx", |
Namjae Jeon | 6ec178d | 2013-04-23 17:51:43 +0900 | [diff] [blame] | 717 | show_dev_ino(__entry), |
Chao Yu | 87b8872 | 2013-11-20 16:40:10 +0800 | [diff] [blame] | 718 | show_bio_type(__entry->rw), |
Namjae Jeon | 6ec178d | 2013-04-23 17:51:43 +0900 | [diff] [blame] | 719 | show_block_type(__entry->type), |
| 720 | (unsigned long)__entry->index, |
| 721 | (unsigned long long)__entry->block) |
| 722 | ); |
| 723 | |
Chao Yu | 87b8872 | 2013-11-20 16:40:10 +0800 | [diff] [blame] | 724 | DEFINE_EVENT(f2fs_io_page, f2fs_submit_write_page, |
| 725 | |
| 726 | TP_PROTO(struct page *page, int rw, int type, block_t blk_addr), |
| 727 | |
| 728 | TP_ARGS(page, rw, type, blk_addr) |
| 729 | ); |
| 730 | |
| 731 | DEFINE_EVENT(f2fs_io_page, f2fs_submit_read_page, |
| 732 | |
| 733 | TP_PROTO(struct page *page, int rw, int type, block_t blk_addr), |
| 734 | |
| 735 | TP_ARGS(page, rw, type, blk_addr) |
| 736 | ); |
| 737 | |
Namjae Jeon | 2af4bd6 | 2013-04-23 18:26:54 +0900 | [diff] [blame] | 738 | TRACE_EVENT(f2fs_write_checkpoint, |
| 739 | |
| 740 | TP_PROTO(struct super_block *sb, bool is_umount, char *msg), |
| 741 | |
| 742 | TP_ARGS(sb, is_umount, msg), |
| 743 | |
| 744 | TP_STRUCT__entry( |
| 745 | __field(dev_t, dev) |
| 746 | __field(bool, is_umount) |
| 747 | __field(char *, msg) |
| 748 | ), |
| 749 | |
| 750 | TP_fast_assign( |
| 751 | __entry->dev = sb->s_dev; |
| 752 | __entry->is_umount = is_umount; |
| 753 | __entry->msg = msg; |
| 754 | ), |
| 755 | |
| 756 | TP_printk("dev = (%d,%d), checkpoint for %s, state = %s", |
| 757 | show_dev(__entry), |
| 758 | __entry->is_umount ? "clean umount" : "consistency", |
| 759 | __entry->msg) |
| 760 | ); |
| 761 | |
Jaegeuk Kim | 1661d07 | 2013-11-12 17:01:00 +0900 | [diff] [blame] | 762 | TRACE_EVENT(f2fs_issue_discard, |
| 763 | |
| 764 | TP_PROTO(struct super_block *sb, block_t blkstart, block_t blklen), |
| 765 | |
| 766 | TP_ARGS(sb, blkstart, blklen), |
| 767 | |
| 768 | TP_STRUCT__entry( |
| 769 | __field(dev_t, dev) |
| 770 | __field(block_t, blkstart) |
| 771 | __field(block_t, blklen) |
| 772 | ), |
| 773 | |
| 774 | TP_fast_assign( |
| 775 | __entry->dev = sb->s_dev; |
| 776 | __entry->blkstart = blkstart; |
| 777 | __entry->blklen = blklen; |
| 778 | ), |
| 779 | |
| 780 | TP_printk("dev = (%d,%d), blkstart = 0x%llx, blklen = 0x%llx", |
| 781 | show_dev(__entry), |
| 782 | (unsigned long long)__entry->blkstart, |
| 783 | (unsigned long long)__entry->blklen) |
| 784 | ); |
Namjae Jeon | a2a4a7e | 2013-04-20 01:28:40 +0900 | [diff] [blame] | 785 | #endif /* _TRACE_F2FS_H */ |
| 786 | |
| 787 | /* This part must be outside protection */ |
| 788 | #include <trace/define_trace.h> |