summaryrefslogtreecommitdiffstats
path: root/fs/tracefs/internal.h
diff options
context:
space:
mode:
authorSven Schnelle <svens@linux.ibm.com>2026-09-09 11:29:53 +0200
committerMasami Hiramatsu (Google) <mhiramat@kernel.org>2026-09-10 08:43:35 +0900
commitd22c3e0088e85be8131f7a9283f759cdbb20726d (patch)
tree9668df2aa27b26f850d3ba5ba1287e443803675c /fs/tracefs/internal.h
downloadlinux-stable-d22c3e0088e85be8131f7a9283f759cdbb20726d.tar.gz
linux-stable-d22c3e0088e85be8131f7a9283f759cdbb20726d.zip
selftests/ftrace: Fix unique symbol check in kprobe_non_uniq_symbol.tcgrafted
The current regex also matches symbols in modules, which makes the test fail on s390 where name_show is present only once in the kernel, but also multiple times in modules: 000001b1401cdc20 t name_show 000001b0c05e6c40 t name_show [mdev] 000001b0c0495f30 t name_show [i2c_core] Fix this by changing the regular expression to only match the function name. Link: https://lore.kernel.org/all/20260909092954.2200558-1-svens@linux.ibm.com/ Fixes: 03b80ff8023a ("selftests/ftrace: Add new test case which checks non unique symbol") Signed-off-by: Sven Schnelle <svens@linux.ibm.com> Reviewed-by: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Diffstat (limited to 'fs/tracefs/internal.h')
-rw-r--r--fs/tracefs/internal.h82
1 files changed, 82 insertions, 0 deletions
diff --git a/fs/tracefs/internal.h b/fs/tracefs/internal.h
new file mode 100644
index 000000000..c61481d04
--- /dev/null
+++ b/fs/tracefs/internal.h
@@ -0,0 +1,82 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef _TRACEFS_INTERNAL_H
+#define _TRACEFS_INTERNAL_H
+
+enum {
+ TRACEFS_EVENT_INODE = BIT(1),
+ TRACEFS_GID_PERM_SET = BIT(2),
+ TRACEFS_UID_PERM_SET = BIT(3),
+ TRACEFS_INSTANCE_INODE = BIT(4),
+};
+
+struct tracefs_inode {
+ struct inode vfs_inode;
+ /* The below gets initialized with memset_after(ti, 0, vfs_inode) */
+ struct list_head list;
+ unsigned long flags;
+ void *private;
+};
+
+/*
+ * struct eventfs_attr - cache the mode and ownership of a eventfs entry
+ * @mode: saved mode plus flags of what is saved
+ * @uid: saved uid if changed
+ * @gid: saved gid if changed
+ */
+struct eventfs_attr {
+ int mode;
+ kuid_t uid;
+ kgid_t gid;
+};
+
+/*
+ * struct eventfs_inode - hold the properties of the eventfs directories.
+ * @list: link list into the parent directory
+ * @rcu: Union with @list for freeing
+ * @children: link list into the child eventfs_inode
+ * @entries: the array of entries representing the files in the directory
+ * @name: the name of the directory to create
+ * @entry_attrs: Saved mode and ownership of the @d_children
+ * @data: The private data to pass to the callbacks
+ * @attr: Saved mode and ownership of eventfs_inode itself
+ * @is_freed: Flag set if the eventfs is on its way to be freed
+ * Note if is_freed is set, then dentry is corrupted.
+ * @is_events: Flag set for only the top level "events" directory
+ * @nr_entries: The number of items in @entries
+ * @ino: The saved inode number
+ */
+struct eventfs_inode {
+ struct list_head list;
+ union {
+ struct list_head children;
+ struct rcu_head rcu;
+ };
+ const struct eventfs_entry *entries;
+ const char *name;
+ struct eventfs_attr *entry_attrs;
+ void *data;
+ struct eventfs_attr attr;
+ struct kref kref;
+ unsigned int is_freed:1;
+ unsigned int is_events:1;
+ unsigned int nr_entries:30;
+ unsigned int ino;
+};
+
+static inline struct tracefs_inode *get_tracefs(const struct inode *inode)
+{
+ return container_of(inode, struct tracefs_inode, vfs_inode);
+}
+
+struct dentry *tracefs_start_creating(const char *name, struct dentry *parent);
+struct dentry *tracefs_end_creating(struct dentry *dentry);
+struct dentry *tracefs_failed_creating(struct dentry *dentry);
+struct inode *tracefs_get_inode(struct super_block *sb);
+
+void eventfs_remount(struct tracefs_inode *ti, bool update_uid, bool update_gid);
+void eventfs_d_release(struct dentry *dentry);
+
+int eventfs_remount_lock(void);
+void eventfs_remount_unlock(int srcu_idx);
+
+#endif /* _TRACEFS_INTERNAL_H */