diff options
Diffstat (limited to 'include/trace')
-rw-r--r-- | include/trace/events/bcache.h | 12 | ||||
-rw-r--r-- | include/trace/events/block.h | 33 | ||||
-rw-r--r-- | include/trace/events/btrfs.h | 404 | ||||
-rw-r--r-- | include/trace/events/compaction.h | 12 | ||||
-rw-r--r-- | include/trace/events/devlink.h | 68 | ||||
-rw-r--r-- | include/trace/events/f2fs.h | 39 | ||||
-rw-r--r-- | include/trace/events/huge_memory.h | 50 | ||||
-rw-r--r-- | include/trace/events/kvm.h | 5 | ||||
-rw-r--r-- | include/trace/events/libata.h | 1 | ||||
-rw-r--r-- | include/trace/events/mmflags.h | 11 | ||||
-rw-r--r-- | include/trace/events/napi.h | 13 | ||||
-rw-r--r-- | include/trace/events/printk.h | 12 | ||||
-rw-r--r-- | include/trace/events/sunrpc.h | 71 | ||||
-rw-r--r-- | include/trace/events/vmscan.h | 63 | ||||
-rw-r--r-- | include/trace/events/vsock_virtio_transport_common.h | 144 | ||||
-rw-r--r-- | include/trace/events/wbt.h | 43 | ||||
-rw-r--r-- | include/trace/events/writeback.h | 32 | ||||
-rw-r--r-- | include/trace/perf.h | 2 | ||||
-rw-r--r-- | include/trace/trace_events.h | 2 |
19 files changed, 780 insertions, 237 deletions
diff --git a/include/trace/events/bcache.h b/include/trace/events/bcache.h index 981acf74b..d336b890e 100644 --- a/include/trace/events/bcache.h +++ b/include/trace/events/bcache.h @@ -27,7 +27,8 @@ DECLARE_EVENT_CLASS(bcache_request, __entry->sector = bio->bi_iter.bi_sector; __entry->orig_sector = bio->bi_iter.bi_sector - 16; __entry->nr_sector = bio->bi_iter.bi_size >> 9; - blk_fill_rwbs(__entry->rwbs, bio->bi_rw, bio->bi_iter.bi_size); + blk_fill_rwbs(__entry->rwbs, bio_op(bio), bio->bi_opf, + bio->bi_iter.bi_size); ), TP_printk("%d,%d %s %llu + %u (from %d,%d @ %llu)", @@ -101,7 +102,8 @@ DECLARE_EVENT_CLASS(bcache_bio, __entry->dev = bio->bi_bdev->bd_dev; __entry->sector = bio->bi_iter.bi_sector; __entry->nr_sector = bio->bi_iter.bi_size >> 9; - blk_fill_rwbs(__entry->rwbs, bio->bi_rw, bio->bi_iter.bi_size); + blk_fill_rwbs(__entry->rwbs, bio_op(bio), bio->bi_opf, + bio->bi_iter.bi_size); ), TP_printk("%d,%d %s %llu + %u", @@ -136,7 +138,8 @@ TRACE_EVENT(bcache_read, __entry->dev = bio->bi_bdev->bd_dev; __entry->sector = bio->bi_iter.bi_sector; __entry->nr_sector = bio->bi_iter.bi_size >> 9; - blk_fill_rwbs(__entry->rwbs, bio->bi_rw, bio->bi_iter.bi_size); + blk_fill_rwbs(__entry->rwbs, bio_op(bio), bio->bi_opf, + bio->bi_iter.bi_size); __entry->cache_hit = hit; __entry->bypass = bypass; ), @@ -167,7 +170,8 @@ TRACE_EVENT(bcache_write, __entry->inode = inode; __entry->sector = bio->bi_iter.bi_sector; __entry->nr_sector = bio->bi_iter.bi_size >> 9; - blk_fill_rwbs(__entry->rwbs, bio->bi_rw, bio->bi_iter.bi_size); + blk_fill_rwbs(__entry->rwbs, bio_op(bio), bio->bi_opf, + bio->bi_iter.bi_size); __entry->writeback = writeback; __entry->bypass = bypass; ), diff --git a/include/trace/events/block.h b/include/trace/events/block.h index e8a5eca1d..8f3a163b8 100644 --- a/include/trace/events/block.h +++ b/include/trace/events/block.h @@ -84,7 +84,8 @@ DECLARE_EVENT_CLASS(block_rq_with_error, 0 : blk_rq_sectors(rq); __entry->errors = rq->errors; - blk_fill_rwbs(__entry->rwbs, rq->cmd_flags, blk_rq_bytes(rq)); + blk_fill_rwbs(__entry->rwbs, req_op(rq), rq->cmd_flags, + blk_rq_bytes(rq)); blk_dump_cmd(__get_str(cmd), rq); ), @@ -162,7 +163,7 @@ TRACE_EVENT(block_rq_complete, __entry->nr_sector = nr_bytes >> 9; __entry->errors = rq->errors; - blk_fill_rwbs(__entry->rwbs, rq->cmd_flags, nr_bytes); + blk_fill_rwbs(__entry->rwbs, req_op(rq), rq->cmd_flags, nr_bytes); blk_dump_cmd(__get_str(cmd), rq); ), @@ -198,7 +199,8 @@ DECLARE_EVENT_CLASS(block_rq, __entry->bytes = (rq->cmd_type == REQ_TYPE_BLOCK_PC) ? blk_rq_bytes(rq) : 0; - blk_fill_rwbs(__entry->rwbs, rq->cmd_flags, blk_rq_bytes(rq)); + blk_fill_rwbs(__entry->rwbs, req_op(rq), rq->cmd_flags, + blk_rq_bytes(rq)); blk_dump_cmd(__get_str(cmd), rq); memcpy(__entry->comm, current->comm, TASK_COMM_LEN); ), @@ -272,7 +274,8 @@ TRACE_EVENT(block_bio_bounce, bio->bi_bdev->bd_dev : 0; __entry->sector = bio->bi_iter.bi_sector; __entry->nr_sector = bio_sectors(bio); - blk_fill_rwbs(__entry->rwbs, bio->bi_rw, bio->bi_iter.bi_size); + blk_fill_rwbs(__entry->rwbs, bio_op(bio), bio->bi_opf, + bio->bi_iter.bi_size); memcpy(__entry->comm, current->comm, TASK_COMM_LEN); ), @@ -310,7 +313,8 @@ TRACE_EVENT(block_bio_complete, __entry->sector = bio->bi_iter.bi_sector; __entry->nr_sector = bio_sectors(bio); __entry->error = error; - blk_fill_rwbs(__entry->rwbs, bio->bi_rw, bio->bi_iter.bi_size); + blk_fill_rwbs(__entry->rwbs, bio_op(bio), bio->bi_opf, + bio->bi_iter.bi_size); ), TP_printk("%d,%d %s %llu + %u [%d]", @@ -337,7 +341,8 @@ DECLARE_EVENT_CLASS(block_bio_merge, __entry->dev = bio->bi_bdev->bd_dev; __entry->sector = bio->bi_iter.bi_sector; __entry->nr_sector = bio_sectors(bio); - blk_fill_rwbs(__entry->rwbs, bio->bi_rw, bio->bi_iter.bi_size); + blk_fill_rwbs(__entry->rwbs, bio_op(bio), bio->bi_opf, + bio->bi_iter.bi_size); memcpy(__entry->comm, current->comm, TASK_COMM_LEN); ), @@ -404,7 +409,8 @@ TRACE_EVENT(block_bio_queue, __entry->dev = bio->bi_bdev->bd_dev; __entry->sector = bio->bi_iter.bi_sector; __entry->nr_sector = bio_sectors(bio); - blk_fill_rwbs(__entry->rwbs, bio->bi_rw, bio->bi_iter.bi_size); + blk_fill_rwbs(__entry->rwbs, bio_op(bio), bio->bi_opf, + bio->bi_iter.bi_size); memcpy(__entry->comm, current->comm, TASK_COMM_LEN); ), @@ -432,8 +438,8 @@ DECLARE_EVENT_CLASS(block_get_rq, __entry->dev = bio ? bio->bi_bdev->bd_dev : 0; __entry->sector = bio ? bio->bi_iter.bi_sector : 0; __entry->nr_sector = bio ? bio_sectors(bio) : 0; - blk_fill_rwbs(__entry->rwbs, - bio ? bio->bi_rw : 0, __entry->nr_sector); + blk_fill_rwbs(__entry->rwbs, bio ? bio_op(bio) : 0, + bio ? bio->bi_opf : 0, __entry->nr_sector); memcpy(__entry->comm, current->comm, TASK_COMM_LEN); ), @@ -567,7 +573,8 @@ TRACE_EVENT(block_split, __entry->dev = bio->bi_bdev->bd_dev; __entry->sector = bio->bi_iter.bi_sector; __entry->new_sector = new_sector; - blk_fill_rwbs(__entry->rwbs, bio->bi_rw, bio->bi_iter.bi_size); + blk_fill_rwbs(__entry->rwbs, bio_op(bio), bio->bi_opf, + bio->bi_iter.bi_size); memcpy(__entry->comm, current->comm, TASK_COMM_LEN); ), @@ -610,7 +617,8 @@ TRACE_EVENT(block_bio_remap, __entry->nr_sector = bio_sectors(bio); __entry->old_dev = dev; __entry->old_sector = from; - blk_fill_rwbs(__entry->rwbs, bio->bi_rw, bio->bi_iter.bi_size); + blk_fill_rwbs(__entry->rwbs, bio_op(bio), bio->bi_opf, + bio->bi_iter.bi_size); ), TP_printk("%d,%d %s %llu + %u <- (%d,%d) %llu", @@ -656,7 +664,8 @@ TRACE_EVENT(block_rq_remap, __entry->old_dev = dev; __entry->old_sector = from; __entry->nr_bios = blk_rq_count_bios(rq); - blk_fill_rwbs(__entry->rwbs, rq->cmd_flags, blk_rq_bytes(rq)); + blk_fill_rwbs(__entry->rwbs, req_op(rq), rq->cmd_flags, + blk_rq_bytes(rq)); ), TP_printk("%d,%d %s %llu + %u <- (%d,%d) %llu %u", diff --git a/include/trace/events/btrfs.h b/include/trace/events/btrfs.h index e90e82ad6..e030d6f6c 100644 --- a/include/trace/events/btrfs.h +++ b/include/trace/events/btrfs.h @@ -66,6 +66,21 @@ struct btrfs_qgroup_extent_record; { BTRFS_BLOCK_GROUP_RAID6, "RAID6"} #define BTRFS_UUID_SIZE 16 +#define TP_STRUCT__entry_fsid __array(u8, fsid, BTRFS_UUID_SIZE) + +#define TP_fast_assign_fsid(fs_info) \ + memcpy(__entry->fsid, fs_info->fsid, BTRFS_UUID_SIZE) + +#define TP_STRUCT__entry_btrfs(args...) \ + TP_STRUCT__entry( \ + TP_STRUCT__entry_fsid \ + args) +#define TP_fast_assign_btrfs(fs_info, args...) \ + TP_fast_assign( \ + TP_fast_assign_fsid(fs_info); \ + args) +#define TP_printk_btrfs(fmt, args...) \ + TP_printk("%pU: " fmt, __entry->fsid, args) TRACE_EVENT(btrfs_transaction_commit, @@ -73,17 +88,17 @@ TRACE_EVENT(btrfs_transaction_commit, TP_ARGS(root), - TP_STRUCT__entry( + TP_STRUCT__entry_btrfs( __field( u64, generation ) __field( u64, root_objectid ) ), - TP_fast_assign( + TP_fast_assign_btrfs(root->fs_info, __entry->generation = root->fs_info->generation; __entry->root_objectid = root->root_key.objectid; ), - TP_printk("root = %llu(%s), gen = %llu", + TP_printk_btrfs("root = %llu(%s), gen = %llu", show_root_type(__entry->root_objectid), (unsigned long long)__entry->generation) ); @@ -94,7 +109,7 @@ DECLARE_EVENT_CLASS(btrfs__inode, TP_ARGS(inode), - TP_STRUCT__entry( + TP_STRUCT__entry_btrfs( __field( ino_t, ino ) __field( blkcnt_t, blocks ) __field( u64, disk_i_size ) @@ -104,7 +119,7 @@ DECLARE_EVENT_CLASS(btrfs__inode, __field( u64, root_objectid ) ), - TP_fast_assign( + TP_fast_assign_btrfs(btrfs_sb(inode->i_sb), __entry->ino = inode->i_ino; __entry->blocks = inode->i_blocks; __entry->disk_i_size = BTRFS_I(inode)->disk_i_size; @@ -115,7 +130,7 @@ DECLARE_EVENT_CLASS(btrfs__inode, BTRFS_I(inode)->root->root_key.objectid; ), - TP_printk("root = %llu(%s), gen = %llu, ino = %lu, blocks = %llu, " + TP_printk_btrfs("root = %llu(%s), gen = %llu, ino = %lu, blocks = %llu, " "disk_i_size = %llu, last_trans = %llu, logged_trans = %llu", show_root_type(__entry->root_objectid), (unsigned long long)__entry->generation, @@ -175,7 +190,7 @@ TRACE_EVENT_CONDITION(btrfs_get_extent, TP_CONDITION(map), - TP_STRUCT__entry( + TP_STRUCT__entry_btrfs( __field( u64, root_objectid ) __field( u64, start ) __field( u64, len ) @@ -187,7 +202,7 @@ TRACE_EVENT_CONDITION(btrfs_get_extent, __field( unsigned int, compress_type ) ), - TP_fast_assign( + TP_fast_assign_btrfs(root->fs_info, __entry->root_objectid = root->root_key.objectid; __entry->start = map->start; __entry->len = map->len; @@ -199,7 +214,7 @@ TRACE_EVENT_CONDITION(btrfs_get_extent, __entry->compress_type = map->compress_type; ), - TP_printk("root = %llu(%s), start = %llu, len = %llu, " + TP_printk_btrfs("root = %llu(%s), start = %llu, len = %llu, " "orig_start = %llu, block_start = %llu(%s), " "block_len = %llu, flags = %s, refs = %u, " "compress_type = %u", @@ -233,7 +248,7 @@ DECLARE_EVENT_CLASS(btrfs__ordered_extent, TP_ARGS(inode, ordered), - TP_STRUCT__entry( + TP_STRUCT__entry_btrfs( __field( ino_t, ino ) __field( u64, file_offset ) __field( u64, start ) @@ -246,7 +261,7 @@ DECLARE_EVENT_CLASS(btrfs__ordered_extent, __field( u64, root_objectid ) ), - TP_fast_assign( + TP_fast_assign_btrfs(btrfs_sb(inode->i_sb), __entry->ino = inode->i_ino; __entry->file_offset = ordered->file_offset; __entry->start = ordered->start; @@ -260,7 +275,7 @@ DECLARE_EVENT_CLASS(btrfs__ordered_extent, BTRFS_I(inode)->root->root_key.objectid; ), - TP_printk("root = %llu(%s), ino = %llu, file_offset = %llu, " + TP_printk_btrfs("root = %llu(%s), ino = %llu, file_offset = %llu, " "start = %llu, len = %llu, disk_len = %llu, " "bytes_left = %llu, flags = %s, compress_type = %d, " "refs = %d", @@ -310,7 +325,7 @@ DECLARE_EVENT_CLASS(btrfs__writepage, TP_ARGS(page, inode, wbc), - TP_STRUCT__entry( + TP_STRUCT__entry_btrfs( __field( ino_t, ino ) __field( pgoff_t, index ) __field( long, nr_to_write ) @@ -324,7 +339,7 @@ DECLARE_EVENT_CLASS(btrfs__writepage, __field( u64, root_objectid ) ), - TP_fast_assign( + TP_fast_assign_btrfs(btrfs_sb(inode->i_sb), __entry->ino = inode->i_ino; __entry->index = page->index; __entry->nr_to_write = wbc->nr_to_write; @@ -339,7 +354,7 @@ DECLARE_EVENT_CLASS(btrfs__writepage, BTRFS_I(inode)->root->root_key.objectid; ), - TP_printk("root = %llu(%s), ino = %lu, page_index = %lu, " + TP_printk_btrfs("root = %llu(%s), ino = %lu, page_index = %lu, " "nr_to_write = %ld, pages_skipped = %ld, range_start = %llu, " "range_end = %llu, for_kupdate = %d, " "for_reclaim = %d, range_cyclic = %d, writeback_index = %lu", @@ -366,7 +381,7 @@ TRACE_EVENT(btrfs_writepage_end_io_hook, TP_ARGS(page, start, end, uptodate), - TP_STRUCT__entry( + TP_STRUCT__entry_btrfs( __field( ino_t, ino ) __field( pgoff_t, index ) __field( u64, start ) @@ -375,7 +390,7 @@ TRACE_EVENT(btrfs_writepage_end_io_hook, __field( u64, root_objectid ) ), - TP_fast_assign( + TP_fast_assign_btrfs(btrfs_sb(page->mapping->host->i_sb), __entry->ino = page->mapping->host->i_ino; __entry->index = page->index; __entry->start = start; @@ -385,7 +400,7 @@ TRACE_EVENT(btrfs_writepage_end_io_hook, BTRFS_I(page->mapping->host)->root->root_key.objectid; ), - TP_printk("root = %llu(%s), ino = %lu, page_index = %lu, start = %llu, " + TP_printk_btrfs("root = %llu(%s), ino = %lu, page_index = %lu, start = %llu, " "end = %llu, uptodate = %d", show_root_type(__entry->root_objectid), (unsigned long)__entry->ino, (unsigned long)__entry->index, @@ -399,7 +414,7 @@ TRACE_EVENT(btrfs_sync_file, TP_ARGS(file, datasync), - TP_STRUCT__entry( + TP_STRUCT__entry_btrfs( __field( ino_t, ino ) __field( ino_t, parent ) __field( int, datasync ) @@ -410,6 +425,7 @@ TRACE_EVENT(btrfs_sync_file, struct dentry *dentry = file->f_path.dentry; struct inode *inode = d_inode(dentry); + TP_fast_assign_fsid(btrfs_sb(file->f_path.dentry->d_sb)); __entry->ino = inode->i_ino; __entry->parent = d_inode(dentry->d_parent)->i_ino; __entry->datasync = datasync; @@ -417,7 +433,7 @@ TRACE_EVENT(btrfs_sync_file, BTRFS_I(inode)->root->root_key.objectid; ), - TP_printk("root = %llu(%s), ino = %ld, parent = %ld, datasync = %d", + TP_printk_btrfs("root = %llu(%s), ino = %ld, parent = %ld, datasync = %d", show_root_type(__entry->root_objectid), (unsigned long)__entry->ino, (unsigned long)__entry->parent, __entry->datasync) @@ -425,19 +441,59 @@ TRACE_EVENT(btrfs_sync_file, TRACE_EVENT(btrfs_sync_fs, - TP_PROTO(int wait), + TP_PROTO(struct btrfs_fs_info *fs_info, int wait), - TP_ARGS(wait), + TP_ARGS(fs_info, wait), - TP_STRUCT__entry( + TP_STRUCT__entry_btrfs( __field( int, wait ) ), - TP_fast_assign( + TP_fast_assign_btrfs(fs_info, __entry->wait = wait; ), - TP_printk("wait = %d", __entry->wait) + TP_printk_btrfs("wait = %d", __entry->wait) +); + +TRACE_EVENT(btrfs_add_block_group, + + TP_PROTO(struct btrfs_fs_info *fs_info, + struct btrfs_block_group_cache *block_group, int create), + + TP_ARGS(fs_info, block_group, create), + + TP_STRUCT__entry( + __array( u8, fsid, BTRFS_UUID_SIZE ) + __field( u64, offset ) + __field( u64, size ) + __field( u64, flags ) + __field( u64, bytes_used ) + __field( u64, bytes_super ) + __field( int, create ) + ), + + TP_fast_assign( + memcpy(__entry->fsid, fs_info->fsid, BTRFS_UUID_SIZE); + __entry->offset = block_group->key.objectid; + __entry->size = block_group->key.offset; + __entry->flags = block_group->flags; + __entry->bytes_used = + btrfs_block_group_used(&block_group->item); + __entry->bytes_super = block_group->bytes_super; + __entry->create = create; + ), + + TP_printk("%pU: block_group offset = %llu, size = %llu, " + "flags = %llu(%s), bytes_used = %llu, bytes_super = %llu, " + "create = %d", __entry->fsid, + (unsigned long long)__entry->offset, + (unsigned long long)__entry->size, + (unsigned long long)__entry->flags, + __print_flags((unsigned long)__entry->flags, "|", + BTRFS_GROUP_FLAGS), + (unsigned long long)__entry->bytes_used, + (unsigned long long)__entry->bytes_super, __entry->create) ); #define show_ref_action(action) \ @@ -450,13 +506,14 @@ TRACE_EVENT(btrfs_sync_fs, DECLARE_EVENT_CLASS(btrfs_delayed_tree_ref, - TP_PROTO(struct btrfs_delayed_ref_node *ref, + TP_PROTO(struct btrfs_fs_info *fs_info, + struct btrfs_delayed_ref_node *ref, struct btrfs_delayed_tree_ref *full_ref, int action), - TP_ARGS(ref, full_ref, action), + TP_ARGS(fs_info, ref, full_ref, action), - TP_STRUCT__entry( + TP_STRUCT__entry_btrfs( __field( u64, bytenr ) __field( u64, num_bytes ) __field( int, action ) @@ -467,7 +524,7 @@ DECLARE_EVENT_CLASS(btrfs_delayed_tree_ref, __field( u64, seq ) ), - TP_fast_assign( + TP_fast_assign_btrfs(fs_info, __entry->bytenr = ref->bytenr; __entry->num_bytes = ref->num_bytes; __entry->action = action; @@ -478,7 +535,7 @@ DECLARE_EVENT_CLASS(btrfs_delayed_tree_ref, __entry->seq = ref->seq; ), - TP_printk("bytenr = %llu, num_bytes = %llu, action = %s, " + TP_printk_btrfs("bytenr = %llu, num_bytes = %llu, action = %s, " "parent = %llu(%s), ref_root = %llu(%s), level = %d, " "type = %s, seq = %llu", (unsigned long long)__entry->bytenr, @@ -492,31 +549,34 @@ DECLARE_EVENT_CLASS(btrfs_delayed_tree_ref, DEFINE_EVENT(btrfs_delayed_tree_ref, add_delayed_tree_ref, - TP_PROTO(struct btrfs_delayed_ref_node *ref, + TP_PROTO(struct btrfs_fs_info *fs_info, + struct btrfs_delayed_ref_node *ref, struct btrfs_delayed_tree_ref *full_ref, int action), - TP_ARGS(ref, full_ref, action) + TP_ARGS(fs_info, ref, full_ref, action) ); DEFINE_EVENT(btrfs_delayed_tree_ref, run_delayed_tree_ref, - TP_PROTO(struct btrfs_delayed_ref_node *ref, + TP_PROTO(struct btrfs_fs_info *fs_info, + struct btrfs_delayed_ref_node *ref, struct btrfs_delayed_tree_ref *full_ref, int action), - TP_ARGS(ref, full_ref, action) + TP_ARGS(fs_info, ref, full_ref, action) ); DECLARE_EVENT_CLASS(btrfs_delayed_data_ref, - TP_PROTO(struct btrfs_delayed_ref_node *ref, + TP_PROTO(struct btrfs_fs_info *fs_info, + struct btrfs_delayed_ref_node *ref, struct btrfs_delayed_data_ref *full_ref, int action), - TP_ARGS(ref, full_ref, action), + TP_ARGS(fs_info, ref, full_ref, action), - TP_STRUCT__entry( + TP_STRUCT__entry_btrfs( __field( u64, bytenr ) __field( u64, num_bytes ) __field( int, action ) @@ -528,7 +588,7 @@ DECLARE_EVENT_CLASS(btrfs_delayed_data_ref, __field( u64, seq ) ), - TP_fast_assign( + TP_fast_assign_btrfs(fs_info, __entry->bytenr = ref->bytenr; __entry->num_bytes = ref->num_bytes; __entry->action = action; @@ -540,7 +600,7 @@ DECLARE_EVENT_CLASS(btrfs_delayed_data_ref, __entry->seq = ref->seq; ), - TP_printk("bytenr = %llu, num_bytes = %llu, action = %s, " + TP_printk_btrfs("bytenr = %llu, num_bytes = %llu, action = %s, " "parent = %llu(%s), ref_root = %llu(%s), owner = %llu, " "offset = %llu, type = %s, seq = %llu", (unsigned long long)__entry->bytenr, @@ -556,45 +616,48 @@ DECLARE_EVENT_CLASS(btrfs_delayed_data_ref, DEFINE_EVENT(btrfs_delayed_data_ref, add_delayed_data_ref, - TP_PROTO(struct btrfs_delayed_ref_node *ref, + TP_PROTO(struct btrfs_fs_info *fs_info, + struct btrfs_delayed_ref_node *ref, struct btrfs_delayed_data_ref *full_ref, int action), - TP_ARGS(ref, full_ref, action) + TP_ARGS(fs_info, ref, full_ref, action) ); DEFINE_EVENT(btrfs_delayed_data_ref, run_delayed_data_ref, - TP_PROTO(struct btrfs_delayed_ref_node *ref, + TP_PROTO(struct btrfs_fs_info *fs_info, + struct btrfs_delayed_ref_node *ref, struct btrfs_delayed_data_ref *full_ref, int action), - TP_ARGS(ref, full_ref, action) + TP_ARGS(fs_info, ref, full_ref, action) ); DECLARE_EVENT_CLASS(btrfs_delayed_ref_head, - TP_PROTO(struct btrfs_delayed_ref_node *ref, + TP_PROTO(struct btrfs_fs_info *fs_info, + struct btrfs_delayed_ref_node *ref, struct btrfs_delayed_ref_head *head_ref, int action), - TP_ARGS(ref, head_ref, action), + TP_ARGS(fs_info, ref, head_ref, action), - TP_STRUCT__entry( + TP_STRUCT__entry_btrfs( __field( u64, bytenr ) __field( u64, num_bytes ) __field( int, action ) __field( int, is_data ) ), - TP_fast_assign( + TP_fast_assign_btrfs(fs_info, __entry->bytenr = ref->bytenr; __entry->num_bytes = ref->num_bytes; __entry->action = action; __entry->is_data = head_ref->is_data; ), - TP_printk("bytenr = %llu, num_bytes = %llu, action = %s, is_data = %d", + TP_printk_btrfs("bytenr = %llu, num_bytes = %llu, action = %s, is_data = %d", (unsigned long long)__entry->bytenr, (unsigned long long)__entry->num_bytes, show_ref_action(__entry->action), @@ -603,20 +666,22 @@ DECLARE_EVENT_CLASS(btrfs_delayed_ref_head, DEFINE_EVENT(btrfs_delayed_ref_head, add_delayed_ref_head, - TP_PROTO(struct btrfs_delayed_ref_node *ref, + TP_PROTO(struct btrfs_fs_info *fs_info, + struct btrfs_delayed_ref_node *ref, struct btrfs_delayed_ref_head *head_ref, int action), - TP_ARGS(ref, head_ref, action) + TP_ARGS(fs_info, ref, head_ref, action) ); DEFINE_EVENT(btrfs_delayed_ref_head, run_delayed_ref_head, - TP_PROTO(struct btrfs_delayed_ref_node *ref, + TP_PROTO(struct btrfs_fs_info *fs_info, + struct btrfs_delayed_ref_node *ref, struct btrfs_delayed_ref_head *head_ref, int action), - TP_ARGS(ref, head_ref, action) + TP_ARGS(fs_info, ref, head_ref, action) ); #define show_chunk_type(type) \ @@ -638,7 +703,7 @@ DECLARE_EVENT_CLASS(btrfs__chunk, TP_ARGS(root, map, offset, size), - TP_STRUCT__entry( + TP_STRUCT__entry_btrfs( __field( int, num_stripes ) __field( u64, type ) __field( int, sub_stripes ) @@ -647,7 +712,7 @@ DECLARE_EVENT_CLASS(btrfs__chunk, __field( u64, root_objectid ) ), - TP_fast_assign( + TP_fast_assign_btrfs(root->fs_info, __entry->num_stripes = map->num_stripes; __entry->type = map->type; __entry->sub_stripes = map->sub_stripes; @@ -656,7 +721,7 @@ DECLARE_EVENT_CLASS(btrfs__chunk, __entry->root_objectid = root->root_key.objectid; ), - TP_printk("root = %llu(%s), offset = %llu, size = %llu, " + TP_printk_btrfs("root = %llu(%s), offset = %llu, size = %llu, " "num_stripes = %d, sub_stripes = %d, type = %s", show_root_type(__entry->root_objectid), (unsigned long long)__entry->offset, @@ -688,7 +753,7 @@ TRACE_EVENT(btrfs_cow_block, TP_ARGS(root, buf, cow), - TP_STRUCT__entry( + TP_STRUCT__entry_btrfs( __field( u64, root_objectid ) __field( u64, buf_start ) __field( int, refs ) @@ -697,7 +762,7 @@ TRACE_EVENT(btrfs_cow_block, __field( int, cow_level ) ), - TP_fast_assign( + TP_fast_assign_btrfs(root->fs_info, __entry->root_objectid = root->root_key.objectid; __entry->buf_start = buf->start; __entry->refs = atomic_read(&buf->refs); @@ -706,7 +771,7 @@ TRACE_EVENT(btrfs_cow_block, __entry->cow_level = btrfs_header_level(cow); ), - TP_printk("root = %llu(%s), refs = %d, orig_buf = %llu " + TP_printk_btrfs("root = %llu(%s), refs = %d, orig_buf = %llu " "(orig_level = %d), cow_buf = %llu (cow_level = %d)", show_root_type(__entry->root_objectid), __entry->refs, @@ -723,25 +788,105 @@ TRACE_EVENT(btrfs_space_reservation, TP_ARGS(fs_info, type, val, bytes, reserve), - TP_STRUCT__entry( - __array( u8, fsid, BTRFS_UUID_SIZE ) + TP_STRUCT__entry_btrfs( __string( type, type ) __field( u64, val ) __field( u64, bytes ) __field( int, reserve ) ), - TP_fast_assign( - memcpy(__entry->fsid, fs_info->fsid, BTRFS_UUID_SIZE); + TP_fast_assign_btrfs(fs_info, __assign_str(type, type); __entry->val = val; __entry->bytes = bytes; __entry->reserve = reserve; ), - TP_printk("%pU: %s: %Lu %s %Lu", __entry->fsid, __get_str(type), - __entry->val, __entry->reserve ? "reserve" : "release", - __entry->bytes) + TP_printk_btrfs("%s: %Lu %s %Lu", __get_str(type), __entry->val, + __entry->reserve ? "reserve" : "release", + __entry->bytes) +); + +#define show_flush_action(action) \ + __print_symbolic(action, \ + { BTRFS_RESERVE_NO_FLUSH, "BTRFS_RESERVE_NO_FLUSH"}, \ + { BTRFS_RESERVE_FLUSH_LIMIT, "BTRFS_RESERVE_FLUSH_LIMIT"}, \ + { BTRFS_RESERVE_FLUSH_ALL, "BTRFS_RESERVE_FLUSH_ALL"}) + +TRACE_EVENT(btrfs_trigger_flush, + + TP_PROTO(struct btrfs_fs_info *fs_info, u64 flags, u64 bytes, + int flush, char *reason), + + TP_ARGS(fs_info, flags, bytes, flush, reason), + + TP_STRUCT__entry( + __array( u8, fsid, BTRFS_UUID_SIZE ) + __field( u64, flags ) + __field( u64, bytes ) + __field( int, flush ) + __string( reason, reason ) + ), + + TP_fast_assign( + memcpy(__entry->fsid, fs_info->fsid, BTRFS_UUID_SIZE); + __entry->flags = flags; + __entry->bytes = bytes; + __entry->flush = flush; + __assign_str(reason, reason) + ), + + TP_printk("%pU: %s: flush = %d(%s), flags = %llu(%s), bytes = %llu", + __entry->fsid, __get_str(reason), __entry->flush, + show_flush_action(__entry->flush), + (unsigned long long)__entry->flags, + __print_flags((unsigned long)__entry->flags, "|", + BTRFS_GROUP_FLAGS), + (unsigned long long)__entry->bytes) +); + +#define show_flush_state(state) \ + __print_symbolic(state, \ + { FLUSH_DELAYED_ITEMS_NR, "FLUSH_DELAYED_ITEMS_NR"}, \ + { FLUSH_DELAYED_ITEMS, "FLUSH_DELAYED_ITEMS"}, \ + { FLUSH_DELALLOC, "FLUSH_DELALLOC"}, \ + { FLUSH_DELALLOC_WAIT, "FLUSH_DELALLOC_WAIT"}, \ + { ALLOC_CHUNK, "ALLOC_CHUNK"}, \ + { COMMIT_TRANS, "COMMIT_TRANS"}) + +TRACE_EVENT(btrfs_flush_space, + + TP_PROTO(struct btrfs_fs_info *fs_info, u64 flags, u64 num_bytes, + u64 orig_bytes, int state, int ret), + + TP_ARGS(fs_info, flags, num_bytes, orig_bytes, state, ret), + + TP_STRUCT__entry( + __array( u8, fsid, BTRFS_UUID_SIZE ) + __field( u64, flags ) + __field( u64, num_bytes ) + __field( u64, orig_bytes ) + __field( int, state ) + __field( int, ret ) + ), + + TP_fast_assign( + memcpy(__entry->fsid, fs_info->fsid, BTRFS_UUID_SIZE); + __entry->flags = flags; + __entry->num_bytes = num_bytes; + __entry->orig_bytes = orig_bytes; + __entry->state = state; + __entry->ret = ret; + ), + + TP_printk("%pU: state = %d(%s), flags = %llu(%s), num_bytes = %llu, " + "orig_bytes = %llu, ret = %d", __entry->fsid, __entry->state, + show_flush_state(__entry->state), + (unsigned long long)__entry->flags, + __print_flags((unsigned long)__entry->flags, "|", + BTRFS_GROUP_FLAGS), + (unsigned long long)__entry->num_bytes, + (unsigned long long)__entry->orig_bytes, __entry->ret) ); DECLARE_EVENT_CLASS(btrfs__reserved_extent, @@ -750,19 +895,19 @@ DECLARE_EVENT_CLASS(btrfs__reserved_extent, TP_ARGS(root, start, len), - TP_STRUCT__entry( + TP_STRUCT__entry_btrfs( __field( u64, root_objectid ) __field( u64, start ) __field( u64, len ) ), - TP_fast_assign( + TP_fast_assign_btrfs(root->fs_info, __entry->root_objectid = root->root_key.objectid; __entry->start = start; __entry->len = len; ), - TP_printk("root = %llu(%s), start = %llu, len = %llu", + TP_printk_btrfs("root = %llu(%s), start = %llu, len = %llu", show_root_type(__entry->root_objectid), (unsigned long long)__entry->start, (unsigned long long)__entry->len) @@ -789,21 +934,21 @@ TRACE_EVENT(find_free_extent, TP_ARGS(root, num_bytes, empty_size, data), - TP_STRUCT__entry( + TP_STRUCT__entry_btrfs( __field( u64, root_objectid ) __field( u64, num_bytes ) __field( u64, empty_size ) __field( u64, data ) ), - TP_fast_assign( + TP_fast_assign_btrfs(root->fs_info, __entry->root_objectid = root->root_key.objectid; __entry->num_bytes = num_bytes; __entry->empty_size = empty_size; __entry->data = data; ), - TP_printk("root = %Lu(%s), len = %Lu, empty_size = %Lu, " + TP_printk_btrfs("root = %Lu(%s), len = %Lu, empty_size = %Lu, " "flags = %Lu(%s)", show_root_type(__entry->root_objectid), __entry->num_bytes, __entry->empty_size, __entry->data, __print_flags((unsigned long)__entry->data, "|", @@ -818,7 +963,7 @@ DECLARE_EVENT_CLASS(btrfs__reserve_extent, TP_ARGS(root, block_group, start, len), - TP_STRUCT__entry( + TP_STRUCT__entry_btrfs( __field( u64, root_objectid ) __field( u64, bg_objectid ) __field( u64, flags ) @@ -826,7 +971,7 @@ DECLARE_EVENT_CLASS(btrfs__reserve_extent, __field( u64, len ) ), - TP_fast_assign( + TP_fast_assign_btrfs(root->fs_info, __entry->root_objectid = root->root_key.objectid; __entry->bg_objectid = block_group->key.objectid; __entry->flags = block_group->flags; @@ -834,7 +979,7 @@ DECLARE_EVENT_CLASS(btrfs__reserve_extent, __entry->len = len; ), - TP_printk("root = %Lu(%s), block_group = %Lu, flags = %Lu(%s), " + TP_printk_btrfs("root = %Lu(%s), block_group = %Lu, flags = %Lu(%s), " "start = %Lu, len = %Lu", show_root_type(__entry->root_objectid), __entry->bg_objectid, __entry->flags, __print_flags((unsigned long)__entry->flags, @@ -867,7 +1012,7 @@ TRACE_EVENT(btrfs_find_cluster, TP_ARGS(block_group, start, bytes, empty_size, min_bytes), - TP_STRUCT__entry( + TP_STRUCT__entry_btrfs( __field( u64, bg_objectid ) __field( u64, flags ) __field( u64, start ) @@ -876,7 +1021,7 @@ TRACE_EVENT(btrfs_find_cluster, __field( u64, min_bytes ) ), - TP_fast_assign( + TP_fast_assign_btrfs(block_group->fs_info, __entry->bg_objectid = block_group->key.objectid; __entry->flags = block_group->flags; __entry->start = start; @@ -885,7 +1030,7 @@ TRACE_EVENT(btrfs_find_cluster, __entry->min_bytes = min_bytes; ), - TP_printk("block_group = %Lu, flags = %Lu(%s), start = %Lu, len = %Lu," + TP_printk_btrfs("block_group = %Lu, flags = %Lu(%s), start = %Lu, len = %Lu," " empty_size = %Lu, min_bytes = %Lu", __entry->bg_objectid, __entry->flags, __print_flags((unsigned long)__entry->flags, "|", @@ -899,15 +1044,15 @@ TRACE_EVENT(btrfs_failed_cluster_setup, TP_ARGS(block_group), - TP_STRUCT__entry( + TP_STRUCT__entry_btrfs( __field( u64, bg_objectid ) ), - TP_fast_assign( + TP_fast_assign_btrfs(block_group->fs_info, __entry->bg_objectid = block_group->key.objectid; ), - TP_printk("block_group = %Lu", __entry->bg_objectid) + TP_printk_btrfs("block_group = %Lu", __entry->bg_objectid) ); TRACE_EVENT(btrfs_setup_cluster, @@ -917,7 +1062,7 @@ TRACE_EVENT(btrfs_setup_cluster, TP_ARGS(block_group, cluster, size, bitmap), - TP_STRUCT__entry( + TP_STRUCT__entry_btrfs( __field( u64, bg_objectid ) __field( u64, flags ) __field( u64, start ) @@ -926,7 +1071,7 @@ TRACE_EVENT(btrfs_setup_cluster, __field( int, bitmap ) ), - TP_fast_assign( + TP_fast_assign_btrfs(block_group->fs_info, __entry->bg_objectid = block_group->key.objectid; __entry->flags = block_group->flags; __entry->start = cluster->window_start; @@ -935,7 +1080,7 @@ TRACE_EVENT(btrfs_setup_cluster, __entry->bitmap = bitmap; ), - TP_printk("block_group = %Lu, flags = %Lu(%s), window_start = %Lu, " + TP_printk_btrfs("block_group = %Lu, flags = %Lu(%s), window_start = %Lu, " "size = %Lu, max_size = %Lu, bitmap = %d", __entry->bg_objectid, __entry->flags, @@ -993,7 +1138,7 @@ DECLARE_EVENT_CLASS(btrfs__work, TP_ARGS(work), - TP_STRUCT__entry( + TP_STRUCT__entry_btrfs( __field( void *, work ) __field( void *, wq ) __field( void *, func ) @@ -1002,7 +1147,7 @@ DECLARE_EVENT_CLASS(btrfs__work, __field( void *, normal_work ) ), - TP_fast_assign( + TP_fast_assign_btrfs(btrfs_work_owner(work), __entry->work = work; __entry->wq = work->wq; __entry->func = work->func; @@ -1011,7 +1156,7 @@ DECLARE_EVENT_CLASS(btrfs__work, __entry->normal_work = &work->normal_work; ), - TP_printk("work=%p (normal_work=%p), wq=%p, func=%pf, ordered_func=%p," + TP_printk_btrfs("work=%p (normal_work=%p), wq=%p, func=%pf, ordered_func=%p," " ordered_free=%p", __entry->work, __entry->normal_work, __entry->wq, __entry->func, __entry->ordered_func, __entry->ordered_free) @@ -1024,15 +1169,15 @@ DECLARE_EVENT_CLASS(btrfs__work__done, TP_ARGS(work), - TP_STRUCT__entry( + TP_STRUCT__entry_btrfs( __field( void *, work ) ), - TP_fast_assign( + TP_fast_assign_btrfs(btrfs_work_owner(work), __entry->work = work; ), - TP_printk("work->%p", __entry->work) + TP_printk_btrfs("work->%p", __entry->work) ); DEFINE_EVENT(btrfs__work, btrfs_work_queued, @@ -1069,19 +1214,19 @@ DECLARE_EVENT_CLASS(btrfs__workqueue, TP_ARGS(wq, name, high), - TP_STRUCT__entry( + TP_STRUCT__entry_btrfs( __field( void *, wq ) __string( name, name ) __field( int , high ) ), - TP_fast_assign( + TP_fast_assign_btrfs(btrfs_workqueue_owner(wq), __entry->wq = wq; __assign_str(name, name); __entry->high = high; ), - TP_printk("name=%s%s, wq=%p", __get_str(name), + TP_printk_btrfs("name=%s%s, wq=%p", __get_str(name), __print_flags(__entry->high, "", {(WQ_HIGHPRI), "-high"}), __entry->wq) @@ -1100,15 +1245,15 @@ DECLARE_EVENT_CLASS(btrfs__workqueue_done, TP_ARGS(wq), - TP_STRUCT__entry( + TP_STRUCT__entry_btrfs( __field( void *, wq ) ), - TP_fast_assign( + TP_fast_assign_btrfs(btrfs_workqueue_owner(wq), __entry->wq = wq; ), - TP_printk("wq=%p", __entry->wq) + TP_printk_btrfs("wq=%p", __entry->wq) ); DEFINE_EVENT(btrfs__workqueue_done, btrfs_workqueue_destroy, @@ -1124,19 +1269,19 @@ DECLARE_EVENT_CLASS(btrfs__qgroup_data_map, TP_ARGS(inode, free_reserved), - TP_STRUCT__entry( + TP_STRUCT__entry_btrfs( __field( u64, rootid ) __field( unsigned long, ino ) __field( u64, free_reserved ) ), - TP_fast_assign( + TP_fast_assign_btrfs(btrfs_sb(inode->i_sb), __entry->rootid = BTRFS_I(inode)->root->objectid; __entry->ino = inode->i_ino; __entry->free_reserved = free_reserved; ), - TP_printk("rootid=%llu, ino=%lu, free_reserved=%llu", + TP_printk_btrfs("rootid=%llu, ino=%lu, free_reserved=%llu", __entry->rootid, __entry->ino, __entry->free_reserved) ); @@ -1165,7 +1310,7 @@ DECLARE_EVENT_CLASS(btrfs__qgroup_rsv_data, TP_ARGS(inode, start, len, reserved, op), - TP_STRUCT__entry( + TP_STRUCT__entry_btrfs( __field( u64, rootid ) __field( unsigned long, ino ) __field( u64, start ) @@ -1174,7 +1319,7 @@ DECLARE_EVENT_CLASS(btrfs__qgroup_rsv_data, __field( int, op ) ), - TP_fast_assign( + TP_fast_assign_btrfs(btrfs_sb(inode->i_sb), __entry->rootid = BTRFS_I(inode)->root->objectid; __entry->ino = inode->i_ino; __entry->start = start; @@ -1183,7 +1328,7 @@ DECLARE_EVENT_CLASS(btrfs__qgroup_rsv_data, __entry->op = op; ), - TP_printk("root=%llu, ino=%lu, start=%llu, len=%llu, reserved=%llu, op=%s", + TP_printk_btrfs("root=%llu, ino=%lu, start=%llu, len=%llu, reserved=%llu, op=%s", __entry->rootid, __entry->ino, __entry->start, __entry->len, __entry->reserved, __print_flags((unsigned long)__entry->op, "", @@ -1207,86 +1352,90 @@ DEFINE_EVENT(btrfs__qgroup_rsv_data, btrfs_qgroup_release_data, DECLARE_EVENT_CLASS(btrfs__qgroup_delayed_ref, - TP_PROTO(u64 ref_root, u64 reserved), + TP_PROTO(struct btrfs_fs_info *fs_info, u64 ref_root, u64 reserved), - TP_ARGS(ref_root, reserved), + TP_ARGS(fs_info, ref_root, reserved), - TP_STRUCT__entry( + TP_STRUCT__entry_btrfs( __field( u64, ref_root ) __field( u64, reserved ) ), - TP_fast_assign( + TP_fast_assign_btrfs(fs_info, __entry->ref_root = ref_root; __entry->reserved = reserved; ), - TP_printk("root=%llu, reserved=%llu, op=free", + TP_printk_btrfs("root=%llu, reserved=%llu, op=free", __entry->ref_root, __entry->reserved) ); DEFINE_EVENT(btrfs__qgroup_delayed_ref, btrfs_qgroup_free_delayed_ref, - TP_PROTO(u64 ref_root, u64 reserved), + TP_PROTO(struct btrfs_fs_info *fs_info, u64 ref_root, u64 reserved), - TP_ARGS(ref_root, reserved) + TP_ARGS(fs_info, ref_root, reserved) ); DECLARE_EVENT_CLASS(btrfs_qgroup_extent, - TP_PROTO(struct btrfs_qgroup_extent_record *rec), + TP_PROTO(struct btrfs_fs_info *fs_info, + struct btrfs_qgroup_extent_record *rec), - TP_ARGS(rec), + TP_ARGS(fs_info, rec), - TP_STRUCT__entry( + TP_STRUCT__entry_btrfs( __field( u64, bytenr ) __field( u64, num_bytes ) ), - TP_fast_assign( + TP_fast_assign_btrfs(fs_info, __entry->bytenr = rec->bytenr, __entry->num_bytes = rec->num_bytes; ), - TP_printk("bytenr = %llu, num_bytes = %llu", + TP_printk_btrfs("bytenr = %llu, num_bytes = %llu", (unsigned long long)__entry->bytenr, (unsigned long long)__entry->num_bytes) ); DEFINE_EVENT(btrfs_qgroup_extent, btrfs_qgroup_account_extents, - TP_PROTO(struct btrfs_qgroup_extent_record *rec), + TP_PROTO(struct btrfs_fs_info *fs_info, + struct btrfs_qgroup_extent_record *rec), - TP_ARGS(rec) + TP_ARGS(fs_info, rec) ); DEFINE_EVENT(btrfs_qgroup_extent, btrfs_qgroup_insert_dirty_extent, - TP_PROTO(struct btrfs_qgroup_extent_record *rec), + TP_PROTO(struct btrfs_fs_info *fs_info, + struct btrfs_qgroup_extent_record *rec), - TP_ARGS(rec) + TP_ARGS(fs_info, rec) ); TRACE_EVENT(btrfs_qgroup_account_extent, - TP_PROTO(u64 bytenr, u64 num_bytes, u64 nr_old_roots, u64 nr_new_roots), + TP_PROTO(struct btrfs_fs_info *fs_info, u64 bytenr, + u64 num_bytes, u64 nr_old_roots, u64 nr_new_roots), - TP_ARGS(bytenr, num_bytes, nr_old_roots, nr_new_roots), + TP_ARGS(fs_info, bytenr, num_bytes, nr_old_roots, nr_new_roots), - TP_STRUCT__entry( + TP_STRUCT__entry_btrfs( __field( u64, bytenr ) __field( u64, num_bytes ) __field( u64, nr_old_roots ) __field( u64, nr_new_roots ) ), - TP_fast_assign( + TP_fast_assign_btrfs(fs_info, __entry->bytenr = bytenr; __entry->num_bytes = num_bytes; __entry->nr_old_roots = nr_old_roots; __entry->nr_new_roots = nr_new_roots; ), - TP_printk("bytenr = %llu, num_bytes = %llu, nr_old_roots = %llu, " + TP_printk_btrfs("bytenr = %llu, num_bytes = %llu, nr_old_roots = %llu, " "nr_new_roots = %llu", __entry->bytenr, __entry->num_bytes, @@ -1296,23 +1445,24 @@ TRACE_EVENT(btrfs_qgroup_account_extent, TRACE_EVENT(qgroup_update_counters, - TP_PROTO(u64 qgid, u64 cur_old_count, u64 cur_new_count), + TP_PROTO(struct btrfs_fs_info *fs_info, u64 qgid, + u64 cur_old_count, u64 cur_new_count), - TP_ARGS(qgid, cur_old_count, cur_new_count), + TP_ARGS(fs_info, qgid, cur_old_count, cur_new_count), - TP_STRUCT__entry( + TP_STRUCT__entry_btrfs( __field( u64, qgid ) __field( u64, cur_old_count ) __field( u64, cur_new_count ) ), - TP_fast_assign( + TP_fast_assign_btrfs(fs_info, __entry->qgid = qgid; __entry->cur_old_count = cur_old_count; __entry->cur_new_count = cur_new_count; ), - TP_printk("qgid = %llu, cur_old_count = %llu, cur_new_count = %llu", + TP_printk_btrfs("qgid = %llu, cur_old_count = %llu, cur_new_count = %llu", __entry->qgid, __entry->cur_old_count, __entry->cur_new_count) diff --git a/include/trace/events/compaction.h b/include/trace/events/compaction.h index 36e2d6fb1..c2ba402ab 100644 --- a/include/trace/events/compaction.h +++ b/include/trace/events/compaction.h @@ -226,26 +226,26 @@ TRACE_EVENT(mm_compaction_try_to_compact_pages, TP_PROTO( int order, gfp_t gfp_mask, - enum migrate_mode mode), + int prio), - TP_ARGS(order, gfp_mask, mode), + TP_ARGS(order, gfp_mask, prio), TP_STRUCT__entry( __field(int, order) __field(gfp_t, gfp_mask) - __field(enum migrate_mode, mode) + __field(int, prio) ), TP_fast_assign( __entry->order = order; __entry->gfp_mask = gfp_mask; - __entry->mode = mode; + __entry->prio = prio; ), - TP_printk("order=%d gfp_mask=0x%x mode=%d", + TP_printk("order=%d gfp_mask=0x%x priority=%d", __entry->order, __entry->gfp_mask, - (int)__entry->mode) + __entry->prio) ); DECLARE_EVENT_CLASS(mm_compaction_suitable_template, diff --git a/include/trace/events/devlink.h b/include/trace/events/devlink.h new file mode 100644 index 000000000..09f1df228 --- /dev/null +++ b/include/trace/events/devlink.h @@ -0,0 +1,68 @@ +#if IS_ENABLED(CONFIG_NET_DEVLINK) + +#undef TRACE_SYSTEM +#define TRACE_SYSTEM devlink + +#if !defined(_TRACE_DEVLINK_H) || defined(TRACE_HEADER_MULTI_READ) +#define _TRACE_DEVLINK_H + +#include <linux/device.h> +#include <net/devlink.h> +#include <linux/tracepoint.h> + +/* + * Tracepoint for devlink hardware message: + */ +TRACE_EVENT(devlink_hwmsg, + TP_PROTO(const struct devlink *devlink, bool incoming, + unsigned long type, const u8 *buf, size_t len), + + TP_ARGS(devlink, incoming, type, buf, len), + + TP_STRUCT__entry( + __string(bus_name, devlink->dev->bus->name) + __string(dev_name, dev_name(devlink->dev)) + __string(driver_name, devlink->dev->driver->name) + __field(bool, incoming) + __field(unsigned long, type) + __dynamic_array(u8, buf, len) + __field(size_t, len) + ), + + TP_fast_assign( + __assign_str(bus_name, devlink->dev->bus->name); + __assign_str(dev_name, dev_name(devlink->dev)); + __assign_str(driver_name, devlink->dev->driver->name); + __entry->incoming = incoming; + __entry->type = type; + memcpy(__get_dynamic_array(buf), buf, len); + __entry->len = len; + ), + + TP_printk("bus_name=%s dev_name=%s driver_name=%s incoming=%d type=%lu buf=0x[%*phD] len=%zu", + __get_str(bus_name), __get_str(dev_name), + __get_str(driver_name), __entry->incoming, __entry->type, + (int) __entry->len, __get_dynamic_array(buf), __entry->len) +); + +#endif /* _TRACE_DEVLINK_H */ + +/* This part must be outside protection */ +#include <trace/define_trace.h> + +#else /* CONFIG_NET_DEVLINK */ + +#if !defined(_TRACE_DEVLINK_H) +#define _TRACE_DEVLINK_H + +#include <net/devlink.h> + +static inline void trace_devlink_hwmsg(const struct devlink *devlink, + bool incoming, unsigned long type, + const u8 *buf, size_t len) +{ +} + +#endif /* _TRACE_DEVLINK_H */ + +#endif diff --git a/include/trace/events/f2fs.h b/include/trace/events/f2fs.h index 3a09bb4dc..ff95fd021 100644 --- a/include/trace/events/f2fs.h +++ b/include/trace/events/f2fs.h @@ -31,10 +31,9 @@ TRACE_DEFINE_ENUM(BG_GC); TRACE_DEFINE_ENUM(LFS); TRACE_DEFINE_ENUM(SSR); TRACE_DEFINE_ENUM(__REQ_RAHEAD); -TRACE_DEFINE_ENUM(__REQ_WRITE); TRACE_DEFINE_ENUM(__REQ_SYNC); TRACE_DEFINE_ENUM(__REQ_NOIDLE); -TRACE_DEFINE_ENUM(__REQ_FLUSH); +TRACE_DEFINE_ENUM(__REQ_PREFLUSH); TRACE_DEFINE_ENUM(__REQ_FUA); TRACE_DEFINE_ENUM(__REQ_PRIO); TRACE_DEFINE_ENUM(__REQ_META); @@ -56,17 +55,21 @@ TRACE_DEFINE_ENUM(CP_DISCARD); { IPU, "IN-PLACE" }, \ { OPU, "OUT-OF-PLACE" }) -#define F2FS_BIO_MASK(t) (t & (READA | WRITE_FLUSH_FUA)) +#define F2FS_BIO_FLAG_MASK(t) (t & (REQ_RAHEAD | WRITE_FLUSH_FUA)) #define F2FS_BIO_EXTRA_MASK(t) (t & (REQ_META | REQ_PRIO)) -#define show_bio_type(type) show_bio_base(type), show_bio_extra(type) +#define show_bio_type(op, op_flags) show_bio_op(op), \ + show_bio_op_flags(op_flags), show_bio_extra(op_flags) -#define show_bio_base(type) \ - __print_symbolic(F2FS_BIO_MASK(type), \ +#define show_bio_op(op) \ + __print_symbolic(op, \ { READ, "READ" }, \ - { READA, "READAHEAD" }, \ + { WRITE, "WRITE" }) + +#define show_bio_op_flags(flags) \ + __print_symbolic(F2FS_BIO_FLAG_MASK(flags), \ + { REQ_RAHEAD, "READAHEAD" }, \ { READ_SYNC, "READ_SYNC" }, \ - { WRITE, "WRITE" }, \ { WRITE_SYNC, "WRITE_SYNC" }, \ { WRITE_FLUSH, "WRITE_FLUSH" }, \ { WRITE_FUA, "WRITE_FUA" }, \ @@ -734,7 +737,8 @@ DECLARE_EVENT_CLASS(f2fs__submit_page_bio, __field(pgoff_t, index) __field(block_t, old_blkaddr) __field(block_t, new_blkaddr) - __field(int, rw) + __field(int, op) + __field(int, op_flags) __field(int, type) ), @@ -744,17 +748,18 @@ DECLARE_EVENT_CLASS(f2fs__submit_page_bio, __entry->index = page->index; __entry->old_blkaddr = fio->old_blkaddr; __entry->new_blkaddr = fio->new_blkaddr; - __entry->rw = fio->rw; + __entry->op = fio->op; + __entry->op_flags = fio->op_flags; __entry->type = fio->type; ), TP_printk("dev = (%d,%d), ino = %lu, page_index = 0x%lx, " - "oldaddr = 0x%llx, newaddr = 0x%llx rw = %s%s, type = %s", + "oldaddr = 0x%llx, newaddr = 0x%llx rw = %s%si%s, type = %s", show_dev_ino(__entry), (unsigned long)__entry->index, (unsigned long long)__entry->old_blkaddr, (unsigned long long)__entry->new_blkaddr, - show_bio_type(__entry->rw), + show_bio_type(__entry->op, __entry->op_flags), show_block_type(__entry->type)) ); @@ -785,7 +790,8 @@ DECLARE_EVENT_CLASS(f2fs__submit_bio, TP_STRUCT__entry( __field(dev_t, dev) - __field(int, rw) + __field(int, op) + __field(int, op_flags) __field(int, type) __field(sector_t, sector) __field(unsigned int, size) @@ -793,15 +799,16 @@ DECLARE_EVENT_CLASS(f2fs__submit_bio, TP_fast_assign( __entry->dev = sb->s_dev; - __entry->rw = fio->rw; + __entry->op = fio->op; + __entry->op_flags = fio->op_flags; __entry->type = fio->type; __entry->sector = bio->bi_iter.bi_sector; __entry->size = bio->bi_iter.bi_size; ), - TP_printk("dev = (%d,%d), %s%s, %s, sector = %lld, size = %u", + TP_printk("dev = (%d,%d), %s%s%s, %s, sector = %lld, size = %u", show_dev(__entry), - show_bio_type(__entry->rw), + show_bio_type(__entry->op, __entry->op_flags), show_block_type(__entry->type), (unsigned long long)__entry->sector, __entry->size) diff --git a/include/trace/events/huge_memory.h b/include/trace/events/huge_memory.h index 551ba4acd..04f58acda 100644 --- a/include/trace/events/huge_memory.h +++ b/include/trace/events/huge_memory.h @@ -13,7 +13,7 @@ EM( SCAN_EXCEED_NONE_PTE, "exceed_none_pte") \ EM( SCAN_PTE_NON_PRESENT, "pte_non_present") \ EM( SCAN_PAGE_RO, "no_writable_page") \ - EM( SCAN_NO_REFERENCED_PAGE, "no_referenced_page") \ + EM( SCAN_LACK_REFERENCED_PAGE, "lack_referenced_page") \ EM( SCAN_PAGE_NULL, "page_null") \ EM( SCAN_SCAN_ABORT, "scan_aborted") \ EM( SCAN_PAGE_COUNT, "not_suitable_page_count") \ @@ -28,7 +28,9 @@ EM( SCAN_SWAP_CACHE_PAGE, "page_swap_cache") \ EM( SCAN_DEL_PAGE_LRU, "could_not_delete_page_from_lru")\ EM( SCAN_ALLOC_HUGE_PAGE_FAIL, "alloc_huge_page_failed") \ - EMe( SCAN_CGROUP_CHARGE_FAIL, "ccgroup_charge_failed") + EM( SCAN_CGROUP_CHARGE_FAIL, "ccgroup_charge_failed") \ + EM( SCAN_EXCEED_SWAP_PTE, "exceed_swap_pte") \ + EMe(SCAN_TRUNCATED, "truncated") \ #undef EM #undef EMe @@ -45,17 +47,18 @@ SCAN_STATUS TRACE_EVENT(mm_khugepaged_scan_pmd, TP_PROTO(struct mm_struct *mm, struct page *page, bool writable, - bool referenced, int none_or_zero, int status), + int referenced, int none_or_zero, int status, int unmapped), - TP_ARGS(mm, page, writable, referenced, none_or_zero, status), + TP_ARGS(mm, page, writable, referenced, none_or_zero, status, unmapped), TP_STRUCT__entry( __field(struct mm_struct *, mm) __field(unsigned long, pfn) __field(bool, writable) - __field(bool, referenced) + __field(int, referenced) __field(int, none_or_zero) __field(int, status) + __field(int, unmapped) ), TP_fast_assign( @@ -65,15 +68,17 @@ TRACE_EVENT(mm_khugepaged_scan_pmd, __entry->referenced = referenced; __entry->none_or_zero = none_or_zero; __entry->status = status; + __entry->unmapped = unmapped; ), - TP_printk("mm=%p, scan_pfn=0x%lx, writable=%d, referenced=%d, none_or_zero=%d, status=%s", + TP_printk("mm=%p, scan_pfn=0x%lx, writable=%d, referenced=%d, none_or_zero=%d, status=%s, unmapped=%d", __entry->mm, __entry->pfn, __entry->writable, __entry->referenced, __entry->none_or_zero, - __print_symbolic(__entry->status, SCAN_STATUS)) + __print_symbolic(__entry->status, SCAN_STATUS), + __entry->unmapped) ); TRACE_EVENT(mm_collapse_huge_page, @@ -103,14 +108,14 @@ TRACE_EVENT(mm_collapse_huge_page, TRACE_EVENT(mm_collapse_huge_page_isolate, TP_PROTO(struct page *page, int none_or_zero, - bool referenced, bool writable, int status), + int referenced, bool writable, int status), TP_ARGS(page, none_or_zero, referenced, writable, status), TP_STRUCT__entry( __field(unsigned long, pfn) __field(int, none_or_zero) - __field(bool, referenced) + __field(int, referenced) __field(bool, writable) __field(int, status) ), @@ -131,5 +136,32 @@ TRACE_EVENT(mm_collapse_huge_page_isolate, __print_symbolic(__entry->status, SCAN_STATUS)) ); +TRACE_EVENT(mm_collapse_huge_page_swapin, + + TP_PROTO(struct mm_struct *mm, int swapped_in, int referenced, int ret), + + TP_ARGS(mm, swapped_in, referenced, ret), + + TP_STRUCT__entry( + __field(struct mm_struct *, mm) + __field(int, swapped_in) + __field(int, referenced) + __field(int, ret) + ), + + TP_fast_assign( + __entry->mm = mm; + __entry->swapped_in = swapped_in; + __entry->referenced = referenced; + __entry->ret = ret; + ), + + TP_printk("mm=%p, swapped_in=%d, referenced=%d, ret=%d", + __entry->mm, + __entry->swapped_in, + __entry->referenced, + __entry->ret) +); + #endif /* __HUGE_MEMORY_H */ #include <trace/define_trace.h> diff --git a/include/trace/events/kvm.h b/include/trace/events/kvm.h index f28292d73..8ade3eb6c 100644 --- a/include/trace/events/kvm.h +++ b/include/trace/events/kvm.h @@ -151,8 +151,9 @@ TRACE_EVENT(kvm_msi_set_irq, __entry->data = data; ), - TP_printk("dst %u vec %u (%s|%s|%s%s)", - (u8)(__entry->address >> 12), (u8)__entry->data, + TP_printk("dst %llx vec %u (%s|%s|%s%s)", + (u8)(__entry->address >> 12) | ((__entry->address >> 32) & 0xffffff00), + (u8)__entry->data, __print_symbolic((__entry->data >> 8 & 0x7), kvm_deliver_mode), (__entry->address & (1<<2)) ? "logical" : "physical", (__entry->data & (1<<15)) ? "level" : "edge", diff --git a/include/trace/events/libata.h b/include/trace/events/libata.h index 75fff8696..2fbbf990e 100644 --- a/include/trace/events/libata.h +++ b/include/trace/events/libata.h @@ -126,6 +126,7 @@ ata_protocol_name(ATA_PROT_PIO), \ ata_protocol_name(ATA_PROT_DMA), \ ata_protocol_name(ATA_PROT_NCQ), \ + ata_protocol_name(ATA_PROT_NCQ_NODATA), \ ata_protocol_name(ATAPI_PROT_NODATA), \ ata_protocol_name(ATAPI_PROT_PIO), \ ata_protocol_name(ATAPI_PROT_DMA)) diff --git a/include/trace/events/mmflags.h b/include/trace/events/mmflags.h index 98930eae5..5a81ab48a 100644 --- a/include/trace/events/mmflags.h +++ b/include/trace/events/mmflags.h @@ -11,6 +11,7 @@ #define __def_gfpflag_names \ {(unsigned long)GFP_TRANSHUGE, "GFP_TRANSHUGE"}, \ + {(unsigned long)GFP_TRANSHUGE_LIGHT, "GFP_TRANSHUGE_LIGHT"}, \ {(unsigned long)GFP_HIGHUSER_MOVABLE, "GFP_HIGHUSER_MOVABLE"},\ {(unsigned long)GFP_HIGHUSER, "GFP_HIGHUSER"}, \ {(unsigned long)GFP_USER, "GFP_USER"}, \ @@ -72,12 +73,6 @@ #define IF_HAVE_PG_HWPOISON(flag,string) #endif -#ifdef CONFIG_TUXONICE_ -#define IF_HAVE_PG_TUXONICE(flag,string) ,{1UL << flag, string} -#else -#define IF_HAVE_PG_TUXONICE(flag,string) -#endif - #if defined(CONFIG_IDLE_PAGE_TRACKING) && defined(CONFIG_64BIT) #define IF_HAVE_PG_IDLE(flag,string) ,{1UL << flag, string} #else @@ -108,10 +103,6 @@ IF_HAVE_PG_MLOCK(PG_mlocked, "mlocked" ) \ IF_HAVE_PG_UNCACHED(PG_uncached, "uncached" ) \ IF_HAVE_PG_HWPOISON(PG_hwpoison, "hwpoison" ) \ -IF_HAVE_PG_TUXONICE(PG_toi_untracked, "toi_untracked" ) \ -IF_HAVE_PG_TUXONICE(PG_toi_ro, "toi_ro" ) \ -IF_HAVE_PG_TUXONICE(PG_toi_cbw, "toi_cbw" ) \ -IF_HAVE_PG_TUXONICE(PG_toi_dirty, "toi_dirty" ) \ IF_HAVE_PG_IDLE(PG_young, "young" ) \ IF_HAVE_PG_IDLE(PG_idle, "idle" ) diff --git a/include/trace/events/napi.h b/include/trace/events/napi.h index 8fe1e93f5..0b9e5136a 100644 --- a/include/trace/events/napi.h +++ b/include/trace/events/napi.h @@ -12,22 +12,27 @@ TRACE_EVENT(napi_poll, - TP_PROTO(struct napi_struct *napi), + TP_PROTO(struct napi_struct *napi, int work, int budget), - TP_ARGS(napi), + TP_ARGS(napi, work, budget), TP_STRUCT__entry( __field( struct napi_struct *, napi) __string( dev_name, napi->dev ? napi->dev->name : NO_DEV) + __field( int, work) + __field( int, budget) ), TP_fast_assign( __entry->napi = napi; __assign_str(dev_name, napi->dev ? napi->dev->name : NO_DEV); + __entry->work = work; + __entry->budget = budget; ), - TP_printk("napi poll on napi struct %p for device %s", - __entry->napi, __get_str(dev_name)) + TP_printk("napi poll on napi struct %p for device %s work %d budget %d", + __entry->napi, __get_str(dev_name), + __entry->work, __entry->budget) ); #undef NO_DEV diff --git a/include/trace/events/printk.h b/include/trace/events/printk.h index c008bc99f..f35017005 100644 --- a/include/trace/events/printk.h +++ b/include/trace/events/printk.h @@ -16,8 +16,16 @@ TRACE_EVENT(console, ), TP_fast_assign( - memcpy(__get_dynamic_array(msg), text, len); - ((char *)__get_dynamic_array(msg))[len] = 0; + /* + * Each trace entry is printed in a new line. + * If the msg finishes with '\n', cut it off + * to avoid blank lines in the trace. + */ + if ((len > 0) && (text[len-1] == '\n')) + len -= 1; + + memcpy(__get_str(msg), text, len); + __get_str(msg)[len] = 0; ), TP_printk("%s", __get_str(msg)) diff --git a/include/trace/events/sunrpc.h b/include/trace/events/sunrpc.h index 5664ca07c..8a707f8a4 100644 --- a/include/trace/events/sunrpc.h +++ b/include/trace/events/sunrpc.h @@ -473,6 +473,39 @@ TRACE_EVENT(svc_recv, show_rqstp_flags(__entry->flags)) ); +DECLARE_EVENT_CLASS(svc_rqst_event, + + TP_PROTO(struct svc_rqst *rqst), + + TP_ARGS(rqst), + + TP_STRUCT__entry( + __field(__be32, xid) + __field(unsigned long, flags) + __dynamic_array(unsigned char, addr, rqst->rq_addrlen) + ), + + TP_fast_assign( + __entry->xid = rqst->rq_xid; + __entry->flags = rqst->rq_flags; + memcpy(__get_dynamic_array(addr), + &rqst->rq_addr, rqst->rq_addrlen); + ), + + TP_printk("addr=%pIScp rq_xid=0x%x flags=%s", + (struct sockaddr *)__get_dynamic_array(addr), + be32_to_cpu(__entry->xid), + show_rqstp_flags(__entry->flags)) +); + +DEFINE_EVENT(svc_rqst_event, svc_defer, + TP_PROTO(struct svc_rqst *rqst), + TP_ARGS(rqst)); + +DEFINE_EVENT(svc_rqst_event, svc_drop, + TP_PROTO(struct svc_rqst *rqst), + TP_ARGS(rqst)); + DECLARE_EVENT_CLASS(svc_rqst_status, TP_PROTO(struct svc_rqst *rqst, int status), @@ -553,7 +586,7 @@ TRACE_EVENT(svc_xprt_do_enqueue, __entry->pid, show_svc_xprt_flags(__entry->flags)) ); -TRACE_EVENT(svc_xprt_dequeue, +DECLARE_EVENT_CLASS(svc_xprt_event, TP_PROTO(struct svc_xprt *xprt), TP_ARGS(xprt), @@ -582,6 +615,14 @@ TRACE_EVENT(svc_xprt_dequeue, show_svc_xprt_flags(__entry->flags)) ); +DEFINE_EVENT(svc_xprt_event, svc_xprt_dequeue, + TP_PROTO(struct svc_xprt *xprt), + TP_ARGS(xprt)); + +DEFINE_EVENT(svc_xprt_event, svc_xprt_no_write_space, + TP_PROTO(struct svc_xprt *xprt), + TP_ARGS(xprt)); + TRACE_EVENT(svc_wake_up, TP_PROTO(int pid), @@ -628,6 +669,34 @@ TRACE_EVENT(svc_handle_xprt, (struct sockaddr *)__get_dynamic_array(addr) : NULL, __entry->len, show_svc_xprt_flags(__entry->flags)) ); + + +DECLARE_EVENT_CLASS(svc_deferred_event, + TP_PROTO(struct svc_deferred_req *dr), + + TP_ARGS(dr), + + TP_STRUCT__entry( + __field(__be32, xid) + __dynamic_array(unsigned char, addr, dr->addrlen) + ), + + TP_fast_assign( + __entry->xid = *(__be32 *)(dr->args + (dr->xprt_hlen>>2)); + memcpy(__get_dynamic_array(addr), &dr->addr, dr->addrlen); + ), + + TP_printk("addr=%pIScp xid=0x%x", + (struct sockaddr *)__get_dynamic_array(addr), + be32_to_cpu(__entry->xid)) +); + +DEFINE_EVENT(svc_deferred_event, svc_drop_deferred, + TP_PROTO(struct svc_deferred_req *dr), + TP_ARGS(dr)); +DEFINE_EVENT(svc_deferred_event, svc_revisit_deferred, + TP_PROTO(struct svc_deferred_req *dr), + TP_ARGS(dr)); #endif /* _TRACE_SUNRPC_H */ #include <trace/define_trace.h> diff --git a/include/trace/events/vmscan.h b/include/trace/events/vmscan.h index 0101ef37f..c88fd0934 100644 --- a/include/trace/events/vmscan.h +++ b/include/trace/events/vmscan.h @@ -55,21 +55,23 @@ TRACE_EVENT(mm_vmscan_kswapd_sleep, TRACE_EVENT(mm_vmscan_kswapd_wake, - TP_PROTO(int nid, int order), + TP_PROTO(int nid, int zid, int order), - TP_ARGS(nid, order), + TP_ARGS(nid, zid, order), TP_STRUCT__entry( __field( int, nid ) + __field( int, zid ) __field( int, order ) ), TP_fast_assign( __entry->nid = nid; + __entry->zid = zid; __entry->order = order; ), - TP_printk("nid=%d order=%d", __entry->nid, __entry->order) + TP_printk("nid=%d zid=%d order=%d", __entry->nid, __entry->zid, __entry->order) ); TRACE_EVENT(mm_vmscan_wakeup_kswapd, @@ -98,47 +100,50 @@ TRACE_EVENT(mm_vmscan_wakeup_kswapd, DECLARE_EVENT_CLASS(mm_vmscan_direct_reclaim_begin_template, - TP_PROTO(int order, int may_writepage, gfp_t gfp_flags), + TP_PROTO(int order, int may_writepage, gfp_t gfp_flags, int classzone_idx), - TP_ARGS(order, may_writepage, gfp_flags), + TP_ARGS(order, may_writepage, gfp_flags, classzone_idx), TP_STRUCT__entry( __field( int, order ) __field( int, may_writepage ) __field( gfp_t, gfp_flags ) + __field( int, classzone_idx ) ), TP_fast_assign( __entry->order = order; __entry->may_writepage = may_writepage; __entry->gfp_flags = gfp_flags; + __entry->classzone_idx = classzone_idx; ), - TP_printk("order=%d may_writepage=%d gfp_flags=%s", + TP_printk("order=%d may_writepage=%d gfp_flags=%s classzone_idx=%d", __entry->order, __entry->may_writepage, - show_gfp_flags(__entry->gfp_flags)) + show_gfp_flags(__entry->gfp_flags), + __entry->classzone_idx) ); DEFINE_EVENT(mm_vmscan_direct_reclaim_begin_template, mm_vmscan_direct_reclaim_begin, - TP_PROTO(int order, int may_writepage, gfp_t gfp_flags), + TP_PROTO(int order, int may_writepage, gfp_t gfp_flags, int classzone_idx), - TP_ARGS(order, may_writepage, gfp_flags) + TP_ARGS(order, may_writepage, gfp_flags, classzone_idx) ); DEFINE_EVENT(mm_vmscan_direct_reclaim_begin_template, mm_vmscan_memcg_reclaim_begin, - TP_PROTO(int order, int may_writepage, gfp_t gfp_flags), + TP_PROTO(int order, int may_writepage, gfp_t gfp_flags, int classzone_idx), - TP_ARGS(order, may_writepage, gfp_flags) + TP_ARGS(order, may_writepage, gfp_flags, classzone_idx) ); DEFINE_EVENT(mm_vmscan_direct_reclaim_begin_template, mm_vmscan_memcg_softlimit_reclaim_begin, - TP_PROTO(int order, int may_writepage, gfp_t gfp_flags), + TP_PROTO(int order, int may_writepage, gfp_t gfp_flags, int classzone_idx), - TP_ARGS(order, may_writepage, gfp_flags) + TP_ARGS(order, may_writepage, gfp_flags, classzone_idx) ); DECLARE_EVENT_CLASS(mm_vmscan_direct_reclaim_end_template, @@ -266,16 +271,18 @@ TRACE_EVENT(mm_shrink_slab_end, DECLARE_EVENT_CLASS(mm_vmscan_lru_isolate_template, - TP_PROTO(int order, + TP_PROTO(int classzone_idx, + int order, unsigned long nr_requested, unsigned long nr_scanned, unsigned long nr_taken, isolate_mode_t isolate_mode, int file), - TP_ARGS(order, nr_requested, nr_scanned, nr_taken, isolate_mode, file), + TP_ARGS(classzone_idx, order, nr_requested, nr_scanned, nr_taken, isolate_mode, file), TP_STRUCT__entry( + __field(int, classzone_idx) __field(int, order) __field(unsigned long, nr_requested) __field(unsigned long, nr_scanned) @@ -285,6 +292,7 @@ DECLARE_EVENT_CLASS(mm_vmscan_lru_isolate_template, ), TP_fast_assign( + __entry->classzone_idx = classzone_idx; __entry->order = order; __entry->nr_requested = nr_requested; __entry->nr_scanned = nr_scanned; @@ -293,8 +301,9 @@ DECLARE_EVENT_CLASS(mm_vmscan_lru_isolate_template, __entry->file = file; ), - TP_printk("isolate_mode=%d order=%d nr_requested=%lu nr_scanned=%lu nr_taken=%lu file=%d", + TP_printk("isolate_mode=%d classzone=%d order=%d nr_requested=%lu nr_scanned=%lu nr_taken=%lu file=%d", __entry->isolate_mode, + __entry->classzone_idx, __entry->order, __entry->nr_requested, __entry->nr_scanned, @@ -304,27 +313,29 @@ DECLARE_EVENT_CLASS(mm_vmscan_lru_isolate_template, DEFINE_EVENT(mm_vmscan_lru_isolate_template, mm_vmscan_lru_isolate, - TP_PROTO(int order, + TP_PROTO(int classzone_idx, + int order, unsigned long nr_requested, unsigned long nr_scanned, unsigned long nr_taken, isolate_mode_t isolate_mode, int file), - TP_ARGS(order, nr_requested, nr_scanned, nr_taken, isolate_mode, file) + TP_ARGS(classzone_idx, order, nr_requested, nr_scanned, nr_taken, isolate_mode, file) ); DEFINE_EVENT(mm_vmscan_lru_isolate_template, mm_vmscan_memcg_isolate, - TP_PROTO(int order, + TP_PROTO(int classzone_idx, + int order, unsigned long nr_requested, unsigned long nr_scanned, unsigned long nr_taken, isolate_mode_t isolate_mode, int file), - TP_ARGS(order, nr_requested, nr_scanned, nr_taken, isolate_mode, file) + TP_ARGS(classzone_idx, order, nr_requested, nr_scanned, nr_taken, isolate_mode, file) ); @@ -352,15 +363,14 @@ TRACE_EVENT(mm_vmscan_writepage, TRACE_EVENT(mm_vmscan_lru_shrink_inactive, - TP_PROTO(struct zone *zone, + TP_PROTO(int nid, unsigned long nr_scanned, unsigned long nr_reclaimed, int priority, int file), - TP_ARGS(zone, nr_scanned, nr_reclaimed, priority, file), + TP_ARGS(nid, nr_scanned, nr_reclaimed, priority, file), TP_STRUCT__entry( __field(int, nid) - __field(int, zid) __field(unsigned long, nr_scanned) __field(unsigned long, nr_reclaimed) __field(int, priority) @@ -368,16 +378,15 @@ TRACE_EVENT(mm_vmscan_lru_shrink_inactive, ), TP_fast_assign( - __entry->nid = zone_to_nid(zone); - __entry->zid = zone_idx(zone); + __entry->nid = nid; __entry->nr_scanned = nr_scanned; __entry->nr_reclaimed = nr_reclaimed; __entry->priority = priority; __entry->reclaim_flags = trace_shrink_flags(file); ), - TP_printk("nid=%d zid=%d nr_scanned=%ld nr_reclaimed=%ld priority=%d flags=%s", - __entry->nid, __entry->zid, + TP_printk("nid=%d nr_scanned=%ld nr_reclaimed=%ld priority=%d flags=%s", + __entry->nid, __entry->nr_scanned, __entry->nr_reclaimed, __entry->priority, show_reclaim_flags(__entry->reclaim_flags)) diff --git a/include/trace/events/vsock_virtio_transport_common.h b/include/trace/events/vsock_virtio_transport_common.h new file mode 100644 index 000000000..b7f1d6278 --- /dev/null +++ b/include/trace/events/vsock_virtio_transport_common.h @@ -0,0 +1,144 @@ +#undef TRACE_SYSTEM +#define TRACE_SYSTEM vsock + +#if !defined(_TRACE_VSOCK_VIRTIO_TRANSPORT_COMMON_H) || \ + defined(TRACE_HEADER_MULTI_READ) +#define _TRACE_VSOCK_VIRTIO_TRANSPORT_COMMON_H + +#include <linux/tracepoint.h> + +TRACE_DEFINE_ENUM(VIRTIO_VSOCK_TYPE_STREAM); + +#define show_type(val) \ + __print_symbolic(val, { VIRTIO_VSOCK_TYPE_STREAM, "STREAM" }) + +TRACE_DEFINE_ENUM(VIRTIO_VSOCK_OP_INVALID); +TRACE_DEFINE_ENUM(VIRTIO_VSOCK_OP_REQUEST); +TRACE_DEFINE_ENUM(VIRTIO_VSOCK_OP_RESPONSE); +TRACE_DEFINE_ENUM(VIRTIO_VSOCK_OP_RST); +TRACE_DEFINE_ENUM(VIRTIO_VSOCK_OP_SHUTDOWN); +TRACE_DEFINE_ENUM(VIRTIO_VSOCK_OP_RW); +TRACE_DEFINE_ENUM(VIRTIO_VSOCK_OP_CREDIT_UPDATE); +TRACE_DEFINE_ENUM(VIRTIO_VSOCK_OP_CREDIT_REQUEST); + +#define show_op(val) \ + __print_symbolic(val, \ + { VIRTIO_VSOCK_OP_INVALID, "INVALID" }, \ + { VIRTIO_VSOCK_OP_REQUEST, "REQUEST" }, \ + { VIRTIO_VSOCK_OP_RESPONSE, "RESPONSE" }, \ + { VIRTIO_VSOCK_OP_RST, "RST" }, \ + { VIRTIO_VSOCK_OP_SHUTDOWN, "SHUTDOWN" }, \ + { VIRTIO_VSOCK_OP_RW, "RW" }, \ + { VIRTIO_VSOCK_OP_CREDIT_UPDATE, "CREDIT_UPDATE" }, \ + { VIRTIO_VSOCK_OP_CREDIT_REQUEST, "CREDIT_REQUEST" }) + +TRACE_EVENT(virtio_transport_alloc_pkt, + TP_PROTO( + __u32 src_cid, __u32 src_port, + __u32 dst_cid, __u32 dst_port, + __u32 len, + __u16 type, + __u16 op, + __u32 flags + ), + TP_ARGS( + src_cid, src_port, + dst_cid, dst_port, + len, + type, + op, + flags + ), + TP_STRUCT__entry( + __field(__u32, src_cid) + __field(__u32, src_port) + __field(__u32, dst_cid) + __field(__u32, dst_port) + __field(__u32, len) + __field(__u16, type) + __field(__u16, op) + __field(__u32, flags) + ), + TP_fast_assign( + __entry->src_cid = src_cid; + __entry->src_port = src_port; + __entry->dst_cid = dst_cid; + __entry->dst_port = dst_port; + __entry->len = len; + __entry->type = type; + __entry->op = op; + __entry->flags = flags; + ), + TP_printk("%u:%u -> %u:%u len=%u type=%s op=%s flags=%#x", + __entry->src_cid, __entry->src_port, + __entry->dst_cid, __entry->dst_port, + __entry->len, + show_type(__entry->type), + show_op(__entry->op), + __entry->flags) +); + +TRACE_EVENT(virtio_transport_recv_pkt, + TP_PROTO( + __u32 src_cid, __u32 src_port, + __u32 dst_cid, __u32 dst_port, + __u32 len, + __u16 type, + __u16 op, + __u32 flags, + __u32 buf_alloc, + __u32 fwd_cnt + ), + TP_ARGS( + src_cid, src_port, + dst_cid, dst_port, + len, + type, + op, + flags, + buf_alloc, + fwd_cnt + ), + TP_STRUCT__entry( + __field(__u32, src_cid) + __field(__u32, src_port) + __field(__u32, dst_cid) + __field(__u32, dst_port) + __field(__u32, len) + __field(__u16, type) + __field(__u16, op) + __field(__u32, flags) + __field(__u32, buf_alloc) + __field(__u32, fwd_cnt) + ), + TP_fast_assign( + __entry->src_cid = src_cid; + __entry->src_port = src_port; + __entry->dst_cid = dst_cid; + __entry->dst_port = dst_port; + __entry->len = len; + __entry->type = type; + __entry->op = op; + __entry->flags = flags; + __entry->buf_alloc = buf_alloc; + __entry->fwd_cnt = fwd_cnt; + ), + TP_printk("%u:%u -> %u:%u len=%u type=%s op=%s flags=%#x " + "buf_alloc=%u fwd_cnt=%u", + __entry->src_cid, __entry->src_port, + __entry->dst_cid, __entry->dst_port, + __entry->len, + show_type(__entry->type), + show_op(__entry->op), + __entry->flags, + __entry->buf_alloc, + __entry->fwd_cnt) +); + +#endif /* _TRACE_VSOCK_VIRTIO_TRANSPORT_COMMON_H */ + +#undef TRACE_INCLUDE_FILE +#define TRACE_INCLUDE_FILE vsock_virtio_transport_common + +/* This part must be outside protection */ +#include <trace/define_trace.h> diff --git a/include/trace/events/wbt.h b/include/trace/events/wbt.h index a4b8b2e57..926c7ee0e 100644 --- a/include/trace/events/wbt.h +++ b/include/trace/events/wbt.h @@ -67,10 +67,10 @@ TRACE_EVENT(wbt_lat, TP_fast_assign( strncpy(__entry->name, dev_name(bdi->dev), 32); - __entry->lat = lat; + __entry->lat = div_u64(lat, 1000); ), - TP_printk("%s: latency %llu\n", __entry->name, + TP_printk("%s: latency %lluus\n", __entry->name, (unsigned long long) __entry->lat) ); @@ -86,7 +86,7 @@ TRACE_EVENT(wbt_lat, TRACE_EVENT(wbt_step, TP_PROTO(struct backing_dev_info *bdi, const char *msg, - unsigned int step, unsigned long window, unsigned int bg, + int step, unsigned long window, unsigned int bg, unsigned int normal, unsigned int max), TP_ARGS(bdi, msg, step, window, bg, normal, max), @@ -94,7 +94,7 @@ TRACE_EVENT(wbt_step, TP_STRUCT__entry( __array(char, name, 32) __field(const char *, msg) - __field(unsigned int, step) + __field(int, step) __field(unsigned long, window) __field(unsigned int, bg) __field(unsigned int, normal) @@ -105,17 +105,48 @@ TRACE_EVENT(wbt_step, strncpy(__entry->name, dev_name(bdi->dev), 32); __entry->msg = msg; __entry->step = step; - __entry->window = window; + __entry->window = div_u64(window, 1000); __entry->bg = bg; __entry->normal = normal; __entry->max = max; ), - TP_printk("%s: %s: step=%u, window=%lu, background=%u, normal=%u, max=%u\n", + TP_printk("%s: %s: step=%d, window=%luus, background=%u, normal=%u, max=%u\n", __entry->name, __entry->msg, __entry->step, __entry->window, __entry->bg, __entry->normal, __entry->max) ); +/** + * wbt_timer - trace wb timer event + * @status: timer state status + * @step: the current scale step count + * @inflight: tracked writes inflight + */ +TRACE_EVENT(wbt_timer, + + TP_PROTO(struct backing_dev_info *bdi, unsigned int status, + int step, unsigned int inflight), + + TP_ARGS(bdi, status, step, inflight), + + TP_STRUCT__entry( + __array(char, name, 32) + __field(unsigned int, status) + __field(int, step) + __field(unsigned int, inflight) + ), + + TP_fast_assign( + strncpy(__entry->name, dev_name(bdi->dev), 32); + __entry->status = status; + __entry->step = step; + __entry->inflight = inflight; + ), + + TP_printk("%s: status=%u, step=%d, inflight=%u\n", __entry->name, + __entry->status, __entry->step, __entry->inflight) +); + #endif /* _TRACE_WBT_H */ /* This part must be outside protection */ diff --git a/include/trace/events/writeback.h b/include/trace/events/writeback.h index 73614ce1d..2ccd9ccbf 100644 --- a/include/trace/events/writeback.h +++ b/include/trace/events/writeback.h @@ -412,11 +412,11 @@ TRACE_EVENT(global_dirty_state, ), TP_fast_assign( - __entry->nr_dirty = global_page_state(NR_FILE_DIRTY); - __entry->nr_writeback = global_page_state(NR_WRITEBACK); - __entry->nr_unstable = global_page_state(NR_UNSTABLE_NFS); - __entry->nr_dirtied = global_page_state(NR_DIRTIED); - __entry->nr_written = global_page_state(NR_WRITTEN); + __entry->nr_dirty = global_node_page_state(NR_FILE_DIRTY); + __entry->nr_writeback = global_node_page_state(NR_WRITEBACK); + __entry->nr_unstable = global_node_page_state(NR_UNSTABLE_NFS); + __entry->nr_dirtied = global_node_page_state(NR_DIRTIED); + __entry->nr_written = global_node_page_state(NR_WRITTEN); __entry->background_thresh = background_thresh; __entry->dirty_thresh = dirty_thresh; __entry->dirty_limit = global_wb_domain.dirty_limit; @@ -696,7 +696,7 @@ DEFINE_EVENT(writeback_single_inode_template, writeback_single_inode, TP_ARGS(inode, wbc, nr_to_write) ); -DECLARE_EVENT_CLASS(writeback_lazytime_template, +DECLARE_EVENT_CLASS(writeback_inode_template, TP_PROTO(struct inode *inode), TP_ARGS(inode), @@ -723,25 +723,39 @@ DECLARE_EVENT_CLASS(writeback_lazytime_template, show_inode_state(__entry->state), __entry->mode) ); -DEFINE_EVENT(writeback_lazytime_template, writeback_lazytime, +DEFINE_EVENT(writeback_inode_template, writeback_lazytime, TP_PROTO(struct inode *inode), TP_ARGS(inode) ); -DEFINE_EVENT(writeback_lazytime_template, writeback_lazytime_iput, +DEFINE_EVENT(writeback_inode_template, writeback_lazytime_iput, TP_PROTO(struct inode *inode), TP_ARGS(inode) ); -DEFINE_EVENT(writeback_lazytime_template, writeback_dirty_inode_enqueue, +DEFINE_EVENT(writeback_inode_template, writeback_dirty_inode_enqueue, TP_PROTO(struct inode *inode), TP_ARGS(inode) ); +/* + * Inode writeback list tracking. + */ + +DEFINE_EVENT(writeback_inode_template, sb_mark_inode_writeback, + TP_PROTO(struct inode *inode), + TP_ARGS(inode) +); + +DEFINE_EVENT(writeback_inode_template, sb_clear_inode_writeback, + TP_PROTO(struct inode *inode), + TP_ARGS(inode) +); + #endif /* _TRACE_WRITEBACK_H */ /* This part must be outside protection */ diff --git a/include/trace/perf.h b/include/trace/perf.h index 88de5c205..04fe68bbe 100644 --- a/include/trace/perf.h +++ b/include/trace/perf.h @@ -15,7 +15,7 @@ ((__entry->__data_loc_##field >> 16) & 0xffff) #undef __get_str -#define __get_str(field) (char *)__get_dynamic_array(field) +#define __get_str(field) ((char *)__get_dynamic_array(field)) #undef __get_bitmask #define __get_bitmask(field) (char *)__get_dynamic_array(field) diff --git a/include/trace/trace_events.h b/include/trace/trace_events.h index 80679a9fa..467e12f78 100644 --- a/include/trace/trace_events.h +++ b/include/trace/trace_events.h @@ -256,7 +256,7 @@ TRACE_MAKE_SYSTEM_STR(); ((__entry->__data_loc_##field >> 16) & 0xffff) #undef __get_str -#define __get_str(field) (char *)__get_dynamic_array(field) +#define __get_str(field) ((char *)__get_dynamic_array(field)) #undef __get_bitmask #define __get_bitmask(field) \ |