include/trace/events/filelock.h

Source file repositories/reference/linux-study-clean/include/trace/events/filelock.h

File Facts

System
Linux kernel
Corpus path
include/trace/events/filelock.h
Extension
.h
Size
8513 bytes
Lines
282
Domain
Repository Root And Misc
Bucket
include
Inferred role
Repository Root And Misc: implementation source
Status
source implementation candidate

Why This File Exists

Top-level or miscellaneous repository surface. Use this as map coverage unless a later manual pass promotes the file into a deeper subsystem dossier.

Dependency Surface

Detected Declarations

Annotated Snippet

#undef TRACE_SYSTEM
#define TRACE_SYSTEM filelock

#if !defined(_TRACE_FILELOCK_H) || defined(TRACE_HEADER_MULTI_READ)
#define _TRACE_FILELOCK_H

#include <linux/tracepoint.h>
#include <linux/fs.h>
#include <linux/device.h>
#include <linux/kdev_t.h>

#define show_fl_flags(val)						\
	__print_flags(val, "|", 					\
		{ FL_POSIX,		"FL_POSIX" },			\
		{ FL_FLOCK,		"FL_FLOCK" },			\
		{ FL_DELEG,		"FL_DELEG" },			\
		{ FL_ACCESS,		"FL_ACCESS" },			\
		{ FL_EXISTS,		"FL_EXISTS" },			\
		{ FL_LEASE,		"FL_LEASE" },			\
		{ FL_CLOSE,		"FL_CLOSE" },			\
		{ FL_SLEEP,		"FL_SLEEP" },			\
		{ FL_DOWNGRADE_PENDING,	"FL_DOWNGRADE_PENDING" },	\
		{ FL_UNLOCK_PENDING,	"FL_UNLOCK_PENDING" },		\
		{ FL_OFDLCK,		"FL_OFDLCK" },			\
		{ FL_RECLAIM,		"FL_RECLAIM" },			\
		{ FL_IGN_DIR_CREATE,	"FL_IGN_DIR_CREATE" },		\
		{ FL_IGN_DIR_DELETE,	"FL_IGN_DIR_DELETE" },		\
		{ FL_IGN_DIR_RENAME,	"FL_IGN_DIR_RENAME" })

#define show_fl_type(val)				\
	__print_symbolic(val,				\
			{ F_RDLCK, "F_RDLCK" },		\
			{ F_WRLCK, "F_WRLCK" },		\
			{ F_UNLCK, "F_UNLCK" })

TRACE_EVENT(locks_get_lock_context,
	TP_PROTO(struct inode *inode, int type, struct file_lock_context *ctx),

	TP_ARGS(inode, type, ctx),

	TP_STRUCT__entry(
		__field(u64, i_ino)
		__field(struct file_lock_context *, ctx)
		__field(dev_t, s_dev)
		__field(unsigned char, type)
	),

	TP_fast_assign(
		__entry->s_dev = inode->i_sb->s_dev;
		__entry->i_ino = inode->i_ino;
		__entry->type = type;
		__entry->ctx = ctx;
	),

	TP_printk("dev=0x%x:0x%x ino=0x%llx type=%s ctx=%p",
		  MAJOR(__entry->s_dev), MINOR(__entry->s_dev),
		  __entry->i_ino, show_fl_type(__entry->type), __entry->ctx)
);

DECLARE_EVENT_CLASS(filelock_lock,
	TP_PROTO(struct inode *inode, struct file_lock *fl, int ret),

	TP_ARGS(inode, fl, ret),

	TP_STRUCT__entry(
		__field(u64, i_ino)
		__field(loff_t, fl_start)
		__field(loff_t, fl_end)
		__field(struct file_lock *, fl)
		__field(struct file_lock_core *, blocker)
		__field(fl_owner_t, owner)
		__field(dev_t, s_dev)
		__field(unsigned int, pid)
		__field(unsigned int, flags)
		__field(unsigned char, type)
		__field(int, ret)
	),

	TP_fast_assign(
		__entry->fl = fl ? fl : NULL;
		__entry->s_dev = inode->i_sb->s_dev;
		__entry->i_ino = inode->i_ino;
		__entry->blocker = fl ? fl->c.flc_blocker : NULL;
		__entry->owner = fl ? fl->c.flc_owner : NULL;
		__entry->pid = fl ? fl->c.flc_pid : 0;
		__entry->flags = fl ? fl->c.flc_flags : 0;
		__entry->type = fl ? fl->c.flc_type : 0;
		__entry->fl_start = fl ? fl->fl_start : 0;
		__entry->fl_end = fl ? fl->fl_end : 0;
		__entry->ret = ret;

Annotation

Implementation Notes