auto
     5ˆËÏ„NÿÊÂÌ 9    5/* SPDX-License-Identifier: GPL-2.0-or-later */
/* FS-Cache tracepoints
 *
 * Copyright (C) 2021 Red Hat, Inc. All Rights Reserved.
 * Written by David Howells (dhowells@redhat.com)
 */
#undef TRACE_SYSTEM
#define TRACE_SYSTEM fscache

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

#include <linux/fscache.h>
#include <linux/tracepoint.h>

/*
 * Define enums for tracing information.
 */
#ifndef __FSCACHE_DECLARE_TRACE_ENUMS_ONCE_ONLY
#define __FSCACHE_DECLARE_TRACE_ENUMS_ONCE_ONLY

enum fscache_cache_trace {
	fscache_cache_collision,
	fscache_cache_get_acquire,
	fscache_cache_new_acquire,
	fscache_cache_put_alloc_volume,
	fscache_cache_put_cache,
	fscache_cache_put_prep_failed,
	fscache_cache_put_relinquish,
	fscache_cache_put_volume,
};

enum fscache_volume_trace {
	fscache_volume_collision,
	fscache_volume_get_cookie,
	fscache_volume_get_create_work,
	fscache_volume_get_hash_collision,
	fscache_volume_get_withdraw,
	fscache_volume_free,
	fscache_volume_new_acquire,
	fscache_volume_put_cookie,
	fscache_volume_put_create_work,
	fscache_volume_put_hash_collision,
	fscache_volume_put_relinquish,
	fscache_volume_put_withdraw,
	fscache_volume_see_create_work,
	fscache_volume_see_hash_wake,
	fscache_volume_wait_create_work,
};

enum fscache_cookie_trace {
	fscache_cookie_collision,
	fscache_cookie_discard,
	fscache_cookie_failed,
	fscache_cookie_get_attach_object,
	fscache_cookie_get_end_access,
	fscache_cookie_get_hash_collision,
	fscache_cookie_get_inval_work,
	fscache_cookie_get_lru,
	fscache_cookie_get_use_work,
	fscache_cookie_new_acquire,
	fscache_cookie_put_hash_collision,
	fscache_cookie_put_lru,
	fscache_cookie_put_object,
	fscache_cookie_put_over_queued,
	fscache_cookie_put_relinquish,
	fscache_cookie_put_withdrawn,
	fscache_cookie_put_work,
	fscache_cookie_see_active,
	fscache_cookie_see_lru_discard,
	fscache_cookie_see_lru_discard_clear,
	fscache_cookie_see_lru_do_one,
	fscache_cookie_see_relinquish,
	fscache_cookie_see_withdraw,
	fscache_cookie_see_work,
};

enum fscache_active_trace {
	fscache_active_use,
	fscache_active_use_modify,
	fscache_active_unuse,
};

enum fscache_access_trace {
	fscache_access_acquire_volume,
	fscache_access_acquire_volume_end,
	fscache_access_cache_pin,
	fscache_access_cache_unpin,
	fscache_access_invalidate_cookie,
	fscache_access_invalidate_cookie_end,
	fscache_access_io_end,
	fscache_access_io_not_live,
	fscache_access_io_read,
	fscache_access_io_resize,
	fscache_access_io_wait,
	fscache_access_io_write,
	fscache_access_lookup_cookie,
	fscache_access_lookup_cookie_end,
	fscache_access_lookup_cookie_end_failed,
	fscache_access_relinquish_volume,
	fscache_access_relinquish_volume_end,
	fscache_access_unlive,
};

#endif

/*
 * Declare tracing information enums and their string mappings for display.
 */
#define fscache_cache_traces						\
	EM(fscache_cache_collision,		"*COLLIDE*")		\
	EM(fscache_cache_get_acquire,		"GET acq  ")		\
	EM(fscache_cache_new_acquire,		"NEW acq  ")		\
	EM(fscache_cache_put_alloc_volume,	"PUT alvol")		\
	EM(fscache_cache_put_cache,		"PUT cache")		\
	EM(fscache_cache_put_prep_failed,	"PUT pfail")		\
	EM(fscache_cache_put_relinquish,	"PUT relnq")		\
	E_(fscache_cache_put_volume,		"PUT vol  ")

#define fscache_volume_traces						\
	EM(fscache_volume_collision,		"*COLLIDE*")		\
	EM(fscache_volume_get_cookie,		"GET cook ")		\
	EM(fscache_volume_get_create_work,	"GET creat")		\
	EM(fscache_volume_get_hash_collision,	"GET hcoll")		\
	EM(fscache_volume_get_withdraw,		"GET withd")            \
	EM(fscache_volume_free,			"FREE     ")		\
	EM(fscache_volume_new_acquire,		"NEW acq  ")		\
	EM(fscache_volume_put_cookie,		"PUT cook ")		\
	EM(fscache_volume_put_create_work,	"PUT creat")		\
	EM(fscache_volume_put_hash_collision,	"PUT hcoll")		\
	EM(fscache_volume_put_relinquish,	"PUT relnq")		\
	EM(fscache_volume_put_withdraw,		"PUT withd")            \
	EM(fscache_volume_see_create_work,	"SEE creat")		\
	EM(fscache_volume_see_hash_wake,	"SEE hwake")		\
	E_(fscache_volume_wait_create_work,	"WAIT cre