50
  *   ˆl–Ü4ý( ©³( 	Å€fàB¦-ÿÁƒ^{_†I|¥�+ÁÀ Œ    /* SPDX-License-Identifier: GPL-2.0 */
#undef TRACE_SYSTEM
#define TRACE_SYSTEM nbd

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

#include <linux/tracepoint.h>

DECLARE_EVENT_CLASS(nbd_transport_event,

	TP_PROTO(struct request *req, u64 handle),

	TP_ARGS(req, handle),

	TP_STRUCT__entry(
		__field(struct request *, req)
		__field(u64, handle)
	),

	TP_fast_assign(
		__entry->req = req;
		__entry->handle = handle;
	),

	TP_printk(
		"nbd transport event: request %p, handle 0x%016llx",
		__entry->req,
		__entry->handle
	)
);

DEFINE_EVENT(nbd_transport_event, nbd_header_sent,

	TP_PROTO(struct request *req, u64 handle),

	TP_ARGS(req, handle)
);

DEFINE_EVENT(nbd_transport_event, nbd_payload_sent,

	TP_PROTO(struct request *req, u64 handle),

	TP_ARGS(req, handle)
);

DEFINE_EVENT(nbd_transport_event, nbd_header_received,

	TP_PROTO(struct request *req, u64 handle),

	TP_ARGS(req, handle)
);

DEFINE_EVENT(nbd_transport_event, nbd_payload_received,

	TP_PROTO(struct request *req, u64 handle),

	TP_ARGS(req, handle)
);

DECLARE_EVENT_CLASS(nbd_send_request,

	TP_PROTO(struct nbd_request *nbd_request, int index,
		 struct request *rq),

	TP_ARGS(nbd_request, index, rq),

	TP_STRUCT__entry(
		__field(struct nbd_request *, nbd_request)
		__field(u64, dev_index)
		__field(struct request *, request)
	),

	TP_fast_assign(
		__entry->nbd_request = NULL;
		__entry->dev_index = index;
		__entry->request = rq;
	),

	TP_printk("nbd%lld: request %p", __entry->dev_index, __entry->request)
);

#ifdef DEFINE_EVENT_WRITABLE
#undef NBD_DEFINE_EVENT
#define NBD_DEFINE_EVENT(template, call, proto, args, size)		\
	DEFINE_EVENT_WRITABLE(template, call, PARAMS(proto),		\
			      PARAMS(args), size)
#else
#undef NBD_DEFINE_EVENT
#define NBD_DEFINE_EVENT(template, call, proto, args, size)		\
	DEFINE_EVENT(template, call, PARAMS(proto), PARAMS(args))
#endif

NBD_DEFINE_EVENT(nbd_send_request, nbd_send_request,

	TP_PROTO(struct nbd_request *nbd_request, int index,
		 struct request *rq),

	TP_ARGS(nbd_request, index, rq),

	sizeof(struct nbd_request)
);

#endif

/* This part must be outside protection */
#include <trace/define_trace.h>
     �_’I|¥‰ÓMjqØ‚¦ð¬÷ÂÁ      File not found.
     ˆÀÃƒh.·¿ÂÁ O    // SPDX-License-Identifier: GPL-2.0-or-later
/*
 * Copyright (C) 2015 Josh Poimboeuf <jpoimboe@redhat.com>
 */

/*
 * This file reads all the special sections which have alternate instructions
 * which can be patched in or redirected to at runtime.
 */

#include <stdlib.h>
#include <string.h>

#include <arch/special.h>
#include <objtool/builtin.h>
#include <objtool/special.h>
#include <objtool/warn.h>
#include <objtool/endianness.h>

struct special_entry {
	const char *sec;
	bool group, jump_or_nop;
	unsigned char size, orig, new;
	unsigned char orig_len, new_len; /* group only */
	unsigned char feature; /* ALTERNATIVE macro CPU feature */
	unsigned char key; /* jump_label key */
};

static const struct special_entry entries[] = {
	{
		.sec = ".altinstructions",
		.group = true,
		.size = ALT_ENTRY_SIZE,
		.orig = ALT_ORIG_OFFSET,
		.orig_len = ALT_ORIG_LEN_OFFSET,
		.new = ALT_NEW_OFFSET,
		.new_len = ALT_NEW_LEN_OFFSET,
		.feature = ALT_FEATURE_OFFSET,
	},
	{
		.sec = "__jump_table",
		.jump_or_nop = true,
		.size = JUMP_ENTRY_SIZE,
		.orig = JUMP_ORIG_OFFSET,
		.new = JUMP_NEW_OFFSET,
		.key = JUMP_KEY_OFFSET,
	},
	{
		.sec = "__ex_table",
		.size = EX_ENTRY_SIZE,
		.orig = EX_ORIG_OFFSET,
		.new = EX_NEW_OFFSET,
	},
	{},
};

void __weak arch_handle_alternative(unsigned short feature, struct special_alt *alt)
{
}

static void reloc_to_sec_off(struct reloc *reloc, struct section **sec,
			     unsigned long *off)
{
	*sec = reloc->sym->sec;
	*off = reloc->sym->offset + reloc_addend(reloc);
}

static int get_alt_entry(struct elf *elf, const struct special_entry *entry,
			 struct section *sec, int idx,
			 struct special_alt *alt)
{
	struct reloc *orig_reloc, *new_reloc;
	unsigned long offset;

	offset = idx * entry->size;

	alt