summaryrefslogtreecommitdiff
path: root/include/trace
diff options
context:
space:
mode:
Diffstat (limited to 'include/trace')
-rw-r--r--include/trace/events/f2fs.h142
-rw-r--r--include/trace/events/fsverity.h146
-rw-r--r--include/trace/perf.h4
-rw-r--r--include/trace/stages/stage3_trace_output.h4
-rw-r--r--include/trace/trace_events.h4
5 files changed, 293 insertions, 7 deletions
diff --git a/include/trace/events/f2fs.h b/include/trace/events/f2fs.h
index df4017dcc701..9364e6775562 100644
--- a/include/trace/events/f2fs.h
+++ b/include/trace/events/f2fs.h
@@ -184,6 +184,15 @@ TRACE_DEFINE_ENUM(CP_PHASE_FINISH_CHECKPOINT);
{ CP_PHASE_FINISH_BLOCK_OPS, "finish block_ops" }, \
{ CP_PHASE_FINISH_CHECKPOINT, "finish checkpoint" })
+#define show_lock_name(lock) \
+ __print_symbolic(lock, \
+ { LOCK_NAME_CP_RWSEM, "cp_rwsem" }, \
+ { LOCK_NAME_NODE_CHANGE, "node_change" }, \
+ { LOCK_NAME_NODE_WRITE, "node_write" }, \
+ { LOCK_NAME_GC_LOCK, "gc_lock" }, \
+ { LOCK_NAME_CP_GLOBAL, "cp_global" }, \
+ { LOCK_NAME_IO_RWSEM, "io_rwsem" })
+
struct f2fs_sb_info;
struct f2fs_io_info;
struct extent_info;
@@ -1358,6 +1367,7 @@ DECLARE_EVENT_CLASS(f2fs__folio,
__field(int, type)
__field(int, dir)
__field(pgoff_t, index)
+ __field(pgoff_t, nrpages)
__field(int, dirty)
__field(int, uptodate)
),
@@ -1368,16 +1378,18 @@ DECLARE_EVENT_CLASS(f2fs__folio,
__entry->type = type;
__entry->dir = S_ISDIR(folio->mapping->host->i_mode);
__entry->index = folio->index;
+ __entry->nrpages= folio_nr_pages(folio);
__entry->dirty = folio_test_dirty(folio);
__entry->uptodate = folio_test_uptodate(folio);
),
- TP_printk("dev = (%d,%d), ino = %lu, %s, %s, index = %lu, "
+ TP_printk("dev = (%d,%d), ino = %lu, %s, %s, index = %lu, nr_pages = %lu, "
"dirty = %d, uptodate = %d",
show_dev_ino(__entry),
show_block_type(__entry->type),
show_file_type(__entry->dir),
(unsigned long)__entry->index,
+ (unsigned long)__entry->nrpages,
__entry->dirty,
__entry->uptodate)
);
@@ -1403,6 +1415,13 @@ DEFINE_EVENT(f2fs__folio, f2fs_readpage,
TP_ARGS(folio, type)
);
+DEFINE_EVENT(f2fs__folio, f2fs_read_folio,
+
+ TP_PROTO(struct folio *folio, int type),
+
+ TP_ARGS(folio, type)
+);
+
DEFINE_EVENT(f2fs__folio, f2fs_set_page_dirty,
TP_PROTO(struct folio *folio, int type),
@@ -2442,6 +2461,127 @@ DEFINE_EVENT(f2fs__rw_end, f2fs_datawrite_end,
TP_ARGS(inode, offset, bytes)
);
+TRACE_EVENT(f2fs_lock_elapsed_time,
+
+ TP_PROTO(struct f2fs_sb_info *sbi, enum f2fs_lock_name lock_name,
+ bool is_write, struct task_struct *p, int ioprio,
+ unsigned long long total_time,
+ unsigned long long running_time,
+ unsigned long long runnable_time,
+ unsigned long long io_sleep_time,
+ unsigned long long other_time),
+
+ TP_ARGS(sbi, lock_name, is_write, p, ioprio, total_time, running_time,
+ runnable_time, io_sleep_time, other_time),
+
+ TP_STRUCT__entry(
+ __field(dev_t, dev)
+ __array(char, comm, TASK_COMM_LEN)
+ __field(pid_t, pid)
+ __field(int, prio)
+ __field(int, ioprio_class)
+ __field(int, ioprio_data)
+ __field(unsigned int, lock_name)
+ __field(bool, is_write)
+ __field(unsigned long long, total_time)
+ __field(unsigned long long, running_time)
+ __field(unsigned long long, runnable_time)
+ __field(unsigned long long, io_sleep_time)
+ __field(unsigned long long, other_time)
+ ),
+
+ TP_fast_assign(
+ __entry->dev = sbi->sb->s_dev;
+ memcpy(__entry->comm, p->comm, TASK_COMM_LEN);
+ __entry->pid = p->pid;
+ __entry->prio = p->prio;
+ __entry->ioprio_class = IOPRIO_PRIO_CLASS(ioprio);
+ __entry->ioprio_data = IOPRIO_PRIO_DATA(ioprio);
+ __entry->lock_name = lock_name;
+ __entry->is_write = is_write;
+ __entry->total_time = total_time;
+ __entry->running_time = running_time;
+ __entry->runnable_time = runnable_time;
+ __entry->io_sleep_time = io_sleep_time;
+ __entry->other_time = other_time;
+ ),
+
+ TP_printk("dev = (%d,%d), comm: %s, pid: %d, prio: %d, "
+ "ioprio_class: %d, ioprio_data: %d, lock_name: %s, "
+ "lock_type: %s, total: %llu, running: %llu, "
+ "runnable: %llu, io_sleep: %llu, other: %llu",
+ show_dev(__entry->dev),
+ __entry->comm,
+ __entry->pid,
+ __entry->prio,
+ __entry->ioprio_class,
+ __entry->ioprio_data,
+ show_lock_name(__entry->lock_name),
+ __entry->is_write ? "wlock" : "rlock",
+ __entry->total_time,
+ __entry->running_time,
+ __entry->runnable_time,
+ __entry->io_sleep_time,
+ __entry->other_time)
+);
+
+DECLARE_EVENT_CLASS(f2fs_priority_update,
+
+ TP_PROTO(struct f2fs_sb_info *sbi, enum f2fs_lock_name lock_name,
+ bool is_write, struct task_struct *p, int orig_prio,
+ int new_prio),
+
+ TP_ARGS(sbi, lock_name, is_write, p, orig_prio, new_prio),
+
+ TP_STRUCT__entry(
+ __field(dev_t, dev)
+ __array(char, comm, TASK_COMM_LEN)
+ __field(pid_t, pid)
+ __field(unsigned int, lock_name)
+ __field(bool, is_write)
+ __field(int, orig_prio)
+ __field(int, new_prio)
+ ),
+
+ TP_fast_assign(
+ __entry->dev = sbi->sb->s_dev;
+ memcpy(__entry->comm, p->comm, TASK_COMM_LEN);
+ __entry->pid = p->pid;
+ __entry->lock_name = lock_name;
+ __entry->is_write = is_write;
+ __entry->orig_prio = orig_prio;
+ __entry->new_prio = new_prio;
+ ),
+
+ TP_printk("dev = (%d,%d), comm: %s, pid: %d, lock_name: %s, "
+ "lock_type: %s, orig_prio: %d, new_prio: %d",
+ show_dev(__entry->dev),
+ __entry->comm,
+ __entry->pid,
+ show_lock_name(__entry->lock_name),
+ __entry->is_write ? "wlock" : "rlock",
+ __entry->orig_prio,
+ __entry->new_prio)
+);
+
+DEFINE_EVENT(f2fs_priority_update, f2fs_priority_uplift,
+
+ TP_PROTO(struct f2fs_sb_info *sbi, enum f2fs_lock_name lock_name,
+ bool is_write, struct task_struct *p, int orig_prio,
+ int new_prio),
+
+ TP_ARGS(sbi, lock_name, is_write, p, orig_prio, new_prio)
+);
+
+DEFINE_EVENT(f2fs_priority_update, f2fs_priority_restore,
+
+ TP_PROTO(struct f2fs_sb_info *sbi, enum f2fs_lock_name lock_name,
+ bool is_write, struct task_struct *p, int orig_prio,
+ int new_prio),
+
+ TP_ARGS(sbi, lock_name, is_write, p, orig_prio, new_prio)
+);
+
#endif /* _TRACE_F2FS_H */
/* This part must be outside protection */
diff --git a/include/trace/events/fsverity.h b/include/trace/events/fsverity.h
new file mode 100644
index 000000000000..a8c52f21cbd5
--- /dev/null
+++ b/include/trace/events/fsverity.h
@@ -0,0 +1,146 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#undef TRACE_SYSTEM
+#define TRACE_SYSTEM fsverity
+
+#if !defined(_TRACE_FSVERITY_H) || defined(TRACE_HEADER_MULTI_READ)
+#define _TRACE_FSVERITY_H
+
+#include <linux/tracepoint.h>
+
+struct fsverity_descriptor;
+struct merkle_tree_params;
+struct fsverity_info;
+
+TRACE_EVENT(fsverity_enable,
+ TP_PROTO(const struct inode *inode,
+ const struct merkle_tree_params *params),
+ TP_ARGS(inode, params),
+ TP_STRUCT__entry(
+ __field(ino_t, ino)
+ __field(u64, data_size)
+ __field(u64, tree_size)
+ __field(unsigned int, merkle_block)
+ __field(unsigned int, num_levels)
+ ),
+ TP_fast_assign(
+ __entry->ino = inode->i_ino;
+ __entry->data_size = i_size_read(inode);
+ __entry->tree_size = params->tree_size;
+ __entry->merkle_block = params->block_size;
+ __entry->num_levels = params->num_levels;
+ ),
+ TP_printk("ino %lu data_size %llu tree_size %llu merkle_block %u levels %u",
+ (unsigned long) __entry->ino,
+ __entry->data_size,
+ __entry->tree_size,
+ __entry->merkle_block,
+ __entry->num_levels)
+);
+
+TRACE_EVENT(fsverity_tree_done,
+ TP_PROTO(const struct inode *inode, const struct fsverity_info *vi,
+ const struct merkle_tree_params *params),
+ TP_ARGS(inode, vi, params),
+ TP_STRUCT__entry(
+ __field(ino_t, ino)
+ __field(u64, data_size)
+ __field(u64, tree_size)
+ __field(unsigned int, merkle_block)
+ __field(unsigned int, levels)
+ __dynamic_array(u8, root_hash, params->digest_size)
+ __dynamic_array(u8, file_digest, params->digest_size)
+ ),
+ TP_fast_assign(
+ __entry->ino = inode->i_ino;
+ __entry->data_size = i_size_read(inode);
+ __entry->tree_size = params->tree_size;
+ __entry->merkle_block = params->block_size;
+ __entry->levels = params->num_levels;
+ memcpy(__get_dynamic_array(root_hash), vi->root_hash, __get_dynamic_array_len(root_hash));
+ memcpy(__get_dynamic_array(file_digest), vi->file_digest, __get_dynamic_array_len(file_digest));
+ ),
+ TP_printk("ino %lu data_size %llu tree_size %lld merkle_block %u levels %u root_hash %s digest %s",
+ (unsigned long) __entry->ino,
+ __entry->data_size,
+ __entry->tree_size,
+ __entry->merkle_block,
+ __entry->levels,
+ __print_hex_str(__get_dynamic_array(root_hash), __get_dynamic_array_len(root_hash)),
+ __print_hex_str(__get_dynamic_array(file_digest), __get_dynamic_array_len(file_digest)))
+);
+
+TRACE_EVENT(fsverity_verify_data_block,
+ TP_PROTO(const struct inode *inode,
+ const struct merkle_tree_params *params,
+ u64 data_pos),
+ TP_ARGS(inode, params, data_pos),
+ TP_STRUCT__entry(
+ __field(ino_t, ino)
+ __field(u64, data_pos)
+ __field(unsigned int, merkle_block)
+ ),
+ TP_fast_assign(
+ __entry->ino = inode->i_ino;
+ __entry->data_pos = data_pos;
+ __entry->merkle_block = params->block_size;
+ ),
+ TP_printk("ino %lu data_pos %llu merkle_block %u",
+ (unsigned long) __entry->ino,
+ __entry->data_pos,
+ __entry->merkle_block)
+);
+
+TRACE_EVENT(fsverity_merkle_hit,
+ TP_PROTO(const struct inode *inode, u64 data_pos,
+ unsigned long hblock_idx, unsigned int level,
+ unsigned int hidx),
+ TP_ARGS(inode, data_pos, hblock_idx, level, hidx),
+ TP_STRUCT__entry(
+ __field(ino_t, ino)
+ __field(u64, data_pos)
+ __field(unsigned long, hblock_idx)
+ __field(unsigned int, level)
+ __field(unsigned int, hidx)
+ ),
+ TP_fast_assign(
+ __entry->ino = inode->i_ino;
+ __entry->data_pos = data_pos;
+ __entry->hblock_idx = hblock_idx;
+ __entry->level = level;
+ __entry->hidx = hidx;
+ ),
+ TP_printk("ino %lu data_pos %llu hblock_idx %lu level %u hidx %u",
+ (unsigned long) __entry->ino,
+ __entry->data_pos,
+ __entry->hblock_idx,
+ __entry->level,
+ __entry->hidx)
+);
+
+TRACE_EVENT(fsverity_verify_merkle_block,
+ TP_PROTO(const struct inode *inode, unsigned long hblock_idx,
+ unsigned int level, unsigned int hidx),
+ TP_ARGS(inode, hblock_idx, level, hidx),
+ TP_STRUCT__entry(
+ __field(ino_t, ino)
+ __field(unsigned long, hblock_idx)
+ __field(unsigned int, level)
+ __field(unsigned int, hidx)
+ ),
+ TP_fast_assign(
+ __entry->ino = inode->i_ino;
+ __entry->hblock_idx = hblock_idx;
+ __entry->level = level;
+ __entry->hidx = hidx;
+ ),
+ TP_printk("ino %lu hblock_idx %lu level %u hidx %u",
+ (unsigned long) __entry->ino,
+ __entry->hblock_idx,
+ __entry->level,
+ __entry->hidx)
+);
+
+#endif /* _TRACE_FSVERITY_H */
+
+/* This part must be outside protection */
+#include <trace/define_trace.h>
diff --git a/include/trace/perf.h b/include/trace/perf.h
index a1754b73a8f5..348ad1d9b556 100644
--- a/include/trace/perf.h
+++ b/include/trace/perf.h
@@ -71,6 +71,7 @@ perf_trace_##call(void *__data, proto) \
u64 __count __attribute__((unused)); \
struct task_struct *__task __attribute__((unused)); \
\
+ guard(preempt_notrace)(); \
do_perf_trace_##call(__data, args); \
}
@@ -85,9 +86,8 @@ perf_trace_##call(void *__data, proto) \
struct task_struct *__task __attribute__((unused)); \
\
might_fault(); \
- preempt_disable_notrace(); \
+ guard(preempt_notrace)(); \
do_perf_trace_##call(__data, args); \
- preempt_enable_notrace(); \
}
/*
diff --git a/include/trace/stages/stage3_trace_output.h b/include/trace/stages/stage3_trace_output.h
index 1e7b0bef95f5..fce85ea2df1c 100644
--- a/include/trace/stages/stage3_trace_output.h
+++ b/include/trace/stages/stage3_trace_output.h
@@ -39,7 +39,7 @@
void *__bitmask = __get_dynamic_array(field); \
unsigned int __bitmask_size; \
__bitmask_size = __get_dynamic_array_len(field); \
- trace_print_bitmask_seq(p, __bitmask, __bitmask_size); \
+ trace_print_bitmask_seq(iter, __bitmask, __bitmask_size); \
})
#undef __get_cpumask
@@ -51,7 +51,7 @@
void *__bitmask = __get_rel_dynamic_array(field); \
unsigned int __bitmask_size; \
__bitmask_size = __get_rel_dynamic_array_len(field); \
- trace_print_bitmask_seq(p, __bitmask, __bitmask_size); \
+ trace_print_bitmask_seq(iter, __bitmask, __bitmask_size); \
})
#undef __get_rel_cpumask
diff --git a/include/trace/trace_events.h b/include/trace/trace_events.h
index 4f22136fd465..fbc07d353be6 100644
--- a/include/trace/trace_events.h
+++ b/include/trace/trace_events.h
@@ -436,6 +436,7 @@ __DECLARE_EVENT_CLASS(call, PARAMS(proto), PARAMS(args), PARAMS(tstruct), \
static notrace void \
trace_event_raw_event_##call(void *__data, proto) \
{ \
+ guard(preempt_notrace)(); \
do_trace_event_raw_event_##call(__data, args); \
}
@@ -447,9 +448,8 @@ static notrace void \
trace_event_raw_event_##call(void *__data, proto) \
{ \
might_fault(); \
- preempt_disable_notrace(); \
+ guard(preempt_notrace)(); \
do_trace_event_raw_event_##call(__data, args); \
- preempt_enable_notrace(); \
}
/*