include/trace/events/writeback.h

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

File Facts

System
Linux kernel
Corpus path
include/trace/events/writeback.h
Extension
.h
Size
23240 bytes
Lines
887
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 writeback

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

#include <linux/tracepoint.h>
#include <linux/backing-dev.h>
#include <linux/writeback.h>

#define show_inode_state(state)					\
	__print_flags(state, "|",				\
		{I_DIRTY_SYNC,		"I_DIRTY_SYNC"},	\
		{I_DIRTY_DATASYNC,	"I_DIRTY_DATASYNC"},	\
		{I_DIRTY_PAGES,		"I_DIRTY_PAGES"},	\
		{I_NEW,			"I_NEW"},		\
		{I_WILL_FREE,		"I_WILL_FREE"},		\
		{I_FREEING,		"I_FREEING"},		\
		{I_CLEAR,		"I_CLEAR"},		\
		{I_SYNC,		"I_SYNC"},		\
		{I_DIRTY_TIME,		"I_DIRTY_TIME"},	\
		{I_REFERENCED,		"I_REFERENCED"},	\
		{I_LINKABLE,		"I_LINKABLE"},		\
		{I_WB_SWITCH,		"I_WB_SWITCH"},		\
		{I_OVL_INUSE,		"I_OVL_INUSE"},		\
		{I_CREATING,		"I_CREATING"},		\
		{I_DONTCACHE,		"I_DONTCACHE"},		\
		{I_SYNC_QUEUED,		"I_SYNC_QUEUED"},	\
		{I_PINNING_NETFS_WB,	"I_PINNING_NETFS_WB"},	\
		{I_LRU_ISOLATING,	"I_LRU_ISOLATING"}	\
	)

/* enums need to be exported to user space */
#undef EM
#undef EMe
#define EM(a,b) 	TRACE_DEFINE_ENUM(a);
#define EMe(a,b)	TRACE_DEFINE_ENUM(a);

#define WB_WORK_REASON							\
	EM( WB_REASON_BACKGROUND,		"background")		\
	EM( WB_REASON_VMSCAN,			"vmscan")		\
	EM( WB_REASON_SYNC,			"sync")			\
	EM( WB_REASON_PERIODIC,			"periodic")		\
	EM( WB_REASON_FS_FREE_SPACE,		"fs_free_space")	\
	EM( WB_REASON_FORKER_THREAD,		"forker_thread")	\
	EM( WB_REASON_FOREIGN_FLUSH,		"foreign_flush")	\
	EMe(WB_REASON_DONTCACHE,		"dontcache")

WB_WORK_REASON

/*
 * Now redefine the EM() and EMe() macros to map the enums to the strings
 * that will be printed in the output.
 */
#undef EM
#undef EMe
#define EM(a,b)		{ a, b },
#define EMe(a,b)	{ a, b }

struct wb_writeback_work;

DECLARE_EVENT_CLASS(writeback_folio_template,

	TP_PROTO(struct folio *folio, struct address_space *mapping),

	TP_ARGS(folio, mapping),

	TP_STRUCT__entry (
		__array(char, name, 32)
		__field(u64, ino)
		__field(pgoff_t, index)
	),

	TP_fast_assign(
		strscpy_pad(__entry->name,
			    bdi_dev_name(mapping ? inode_to_bdi(mapping->host) :
					 NULL), 32);
		__entry->ino = (mapping && mapping->host) ? mapping->host->i_ino : 0;
		__entry->index = folio->index;
	),

	TP_printk("bdi %s: ino=%llu index=%lu",
		__entry->name,
		__entry->ino,
		__entry->index
	)
);

DEFINE_EVENT(writeback_folio_template, writeback_dirty_folio,

Annotation

Implementation Notes