mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-16 06:41:39 -04:00
mshv: Introduce tracing support
Introduces various trace events and use them in the corresponding places in the driver. Signed-off-by: Stanislav Kinsburskii <skinsburskii@linux.microsoft.com> Signed-off-by: Wei Liu <wei.liu@kernel.org>
This commit is contained in:
committed by
Wei Liu
parent
1c80dd81ca
commit
80acc80ea2
@@ -16,6 +16,7 @@ hv_utils-y := hv_util.o hv_kvp.o hv_snapshot.o hv_utils_transport.o
|
||||
mshv_root-y := mshv_root_main.o mshv_synic.o mshv_eventfd.o mshv_irq.o \
|
||||
mshv_root_hv_call.o mshv_portid_table.o mshv_regions.o
|
||||
mshv_root-$(CONFIG_DEBUG_FS) += mshv_debugfs.o
|
||||
mshv_root-$(CONFIG_TRACEPOINTS) += mshv_trace.o
|
||||
mshv_vtl-y := mshv_vtl_main.o
|
||||
|
||||
# Code that must be built-in
|
||||
|
||||
@@ -733,6 +733,14 @@ static int mshv_assign_ioeventfd(struct mshv_partition *pt,
|
||||
ret = mshv_register_doorbell(pt->pt_id, ioeventfd_mmio_write,
|
||||
(void *)pt, p->iovntfd_addr,
|
||||
p->iovntfd_datamatch, doorbell_flags);
|
||||
|
||||
trace_mshv_assign_ioeventfd(pt->pt_id, p->iovntfd_addr,
|
||||
p->iovntfd_length,
|
||||
p->iovntfd_datamatch,
|
||||
p->iovntfd_wildcard,
|
||||
p->iovntfd_eventfd,
|
||||
ret);
|
||||
|
||||
if (ret < 0)
|
||||
goto unlock_fail;
|
||||
|
||||
@@ -780,6 +788,12 @@ static int mshv_deassign_ioeventfd(struct mshv_partition *pt,
|
||||
p->iovntfd_datamatch != args->datamatch)
|
||||
continue;
|
||||
|
||||
trace_mshv_deassign_ioeventfd(pt->pt_id, p->iovntfd_addr,
|
||||
p->iovntfd_length,
|
||||
p->iovntfd_datamatch,
|
||||
p->iovntfd_wildcard,
|
||||
p->iovntfd_eventfd);
|
||||
|
||||
hlist_del_rcu(&p->iovntfd_hnode);
|
||||
synchronize_rcu();
|
||||
ioeventfd_release(p, pt->pt_id);
|
||||
|
||||
@@ -71,6 +71,10 @@ int mshv_update_routing_table(struct mshv_partition *partition,
|
||||
mutex_unlock(&partition->pt_irq_lock);
|
||||
|
||||
synchronize_srcu_expedited(&partition->pt_irq_srcu);
|
||||
|
||||
trace_mshv_update_routing_table(partition->pt_id,
|
||||
old, new, numents);
|
||||
|
||||
new = old;
|
||||
|
||||
out:
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
#include <linux/build_bug.h>
|
||||
#include <linux/mmu_notifier.h>
|
||||
#include <uapi/linux/mshv.h>
|
||||
#include "mshv_trace.h"
|
||||
|
||||
/*
|
||||
* Hypervisor must be between these version numbers (inclusive)
|
||||
|
||||
@@ -45,8 +45,7 @@ int hv_call_withdraw_memory(u64 count, int node, u64 partition_id)
|
||||
struct hv_output_withdraw_memory *output_page;
|
||||
struct page *page;
|
||||
u16 completed;
|
||||
unsigned long remaining = count;
|
||||
u64 status;
|
||||
u64 status, withdrawn = 0;
|
||||
int i;
|
||||
unsigned long flags;
|
||||
|
||||
@@ -55,7 +54,7 @@ int hv_call_withdraw_memory(u64 count, int node, u64 partition_id)
|
||||
return -ENOMEM;
|
||||
output_page = page_address(page);
|
||||
|
||||
while (remaining) {
|
||||
while (withdrawn < count) {
|
||||
local_irq_save(flags);
|
||||
|
||||
input_page = *this_cpu_ptr(hyperv_pcpu_input_arg);
|
||||
@@ -63,7 +62,7 @@ int hv_call_withdraw_memory(u64 count, int node, u64 partition_id)
|
||||
memset(input_page, 0, sizeof(*input_page));
|
||||
input_page->partition_id = partition_id;
|
||||
status = hv_do_rep_hypercall(HVCALL_WITHDRAW_MEMORY,
|
||||
min(remaining, HV_WITHDRAW_BATCH_SIZE),
|
||||
min(count - withdrawn, HV_WITHDRAW_BATCH_SIZE),
|
||||
0, input_page, output_page);
|
||||
|
||||
local_irq_restore(flags);
|
||||
@@ -79,10 +78,12 @@ int hv_call_withdraw_memory(u64 count, int node, u64 partition_id)
|
||||
break;
|
||||
}
|
||||
|
||||
remaining -= completed;
|
||||
withdrawn += completed;
|
||||
}
|
||||
free_page((unsigned long)output_page);
|
||||
|
||||
trace_mshv_hvcall_withdraw_memory(partition_id, withdrawn, status);
|
||||
|
||||
return hv_result_to_errno(status);
|
||||
}
|
||||
|
||||
@@ -126,6 +127,8 @@ int hv_call_create_partition(u64 flags,
|
||||
ret = hv_deposit_memory(hv_current_partition_id, status);
|
||||
} while (!ret);
|
||||
|
||||
trace_mshv_hvcall_create_partition(flags, ret ? ret : *partition_id);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -153,6 +156,8 @@ int hv_call_initialize_partition(u64 partition_id)
|
||||
ret = hv_deposit_memory(partition_id, status);
|
||||
} while (!ret);
|
||||
|
||||
trace_mshv_hvcall_initialize_partition(partition_id, status);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -165,6 +170,8 @@ int hv_call_finalize_partition(u64 partition_id)
|
||||
status = hv_do_fast_hypercall8(HVCALL_FINALIZE_PARTITION,
|
||||
*(u64 *)&input);
|
||||
|
||||
trace_mshv_hvcall_finalize_partition(partition_id, status);
|
||||
|
||||
return hv_result_to_errno(status);
|
||||
}
|
||||
|
||||
@@ -176,6 +183,8 @@ int hv_call_delete_partition(u64 partition_id)
|
||||
input.partition_id = partition_id;
|
||||
status = hv_do_fast_hypercall8(HVCALL_DELETE_PARTITION, *(u64 *)&input);
|
||||
|
||||
trace_mshv_hvcall_delete_partition(partition_id, status);
|
||||
|
||||
return hv_result_to_errno(status);
|
||||
}
|
||||
|
||||
@@ -573,6 +582,9 @@ static int hv_call_map_vp_state_page(u64 partition_id, u32 vp_index, u32 type,
|
||||
ret = hv_deposit_memory(partition_id, status);
|
||||
} while (!ret);
|
||||
|
||||
trace_mshv_hvcall_map_vp_state_page(partition_id, vp_index,
|
||||
type, status);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@@ -429,6 +429,17 @@ mshv_vp_dispatch(struct mshv_vp *vp, u32 flags,
|
||||
status = hv_do_hypercall(HVCALL_DISPATCH_VP, input, output);
|
||||
vp->run.flags.root_sched_dispatched = 0;
|
||||
|
||||
trace_mshv_hvcall_dispatch_vp(vp->vp_partition->pt_id,
|
||||
vp->vp_index, flags,
|
||||
output->dispatch_state,
|
||||
output->dispatch_event,
|
||||
#if defined(CONFIG_X86_64)
|
||||
vp->vp_register_page->interrupt_vectors.as_uint64,
|
||||
#else
|
||||
0,
|
||||
#endif
|
||||
status);
|
||||
|
||||
*res = *output;
|
||||
preempt_enable();
|
||||
|
||||
@@ -451,6 +462,9 @@ mshv_vp_clear_explicit_suspend(struct mshv_vp *vp)
|
||||
ret = mshv_set_vp_registers(vp->vp_index, vp->vp_partition->pt_id,
|
||||
1, &explicit_suspend);
|
||||
|
||||
trace_mshv_vp_clear_explicit_suspend(vp->vp_partition->pt_id,
|
||||
vp->vp_index, ret);
|
||||
|
||||
if (ret)
|
||||
vp_err(vp, "Failed to unsuspend\n");
|
||||
|
||||
@@ -493,6 +507,12 @@ mshv_vp_wait_for_hv_kick(struct mshv_vp *vp)
|
||||
if (ret)
|
||||
return -EINTR;
|
||||
|
||||
trace_mshv_vp_wait_for_hv_kick(vp->vp_partition->pt_id,
|
||||
vp->vp_index,
|
||||
vp->run.kicked_by_hv,
|
||||
mshv_vp_dispatch_thread_blocked(vp),
|
||||
mshv_vp_interrupt_pending(vp));
|
||||
|
||||
vp->run.flags.root_sched_blocked = 0;
|
||||
vp->run.kicked_by_hv = 0;
|
||||
|
||||
@@ -521,6 +541,12 @@ static long mshv_run_vp_with_root_scheduler(struct mshv_vp *vp)
|
||||
|
||||
if (__xfer_to_guest_mode_work_pending()) {
|
||||
ret = xfer_to_guest_mode_handle_work();
|
||||
|
||||
trace_mshv_xfer_to_guest_mode_work(vp->vp_partition->pt_id,
|
||||
vp->vp_index,
|
||||
read_thread_flags(),
|
||||
ret);
|
||||
|
||||
if (ret)
|
||||
break;
|
||||
}
|
||||
@@ -681,6 +707,8 @@ static long mshv_vp_ioctl_run_vp(struct mshv_vp *vp, void __user *ret_msg)
|
||||
{
|
||||
long rc;
|
||||
|
||||
trace_mshv_run_vp_entry(vp->vp_partition->pt_id, vp->vp_index);
|
||||
|
||||
do {
|
||||
if (hv_scheduler_type == HV_SCHEDULER_TYPE_ROOT)
|
||||
rc = mshv_run_vp_with_root_scheduler(vp);
|
||||
@@ -688,6 +716,10 @@ static long mshv_vp_ioctl_run_vp(struct mshv_vp *vp, void __user *ret_msg)
|
||||
rc = mshv_run_vp_with_hyp_scheduler(vp);
|
||||
} while (rc == 0 && mshv_vp_handle_intercept(vp));
|
||||
|
||||
trace_mshv_run_vp_exit(vp->vp_partition->pt_id, vp->vp_index,
|
||||
vp->vp_intercept_msg_page->header.message_type,
|
||||
rc);
|
||||
|
||||
if (rc)
|
||||
return rc;
|
||||
|
||||
@@ -949,6 +981,8 @@ mshv_vp_release(struct inode *inode, struct file *filp)
|
||||
{
|
||||
struct mshv_vp *vp = filp->private_data;
|
||||
|
||||
trace_mshv_vp_release(vp->vp_partition->pt_id, vp->vp_index);
|
||||
|
||||
/* Rest of VP cleanup happens in destroy_partition() */
|
||||
mshv_partition_put(vp->vp_partition);
|
||||
return 0;
|
||||
@@ -1121,7 +1155,7 @@ mshv_partition_ioctl_create_vp(struct mshv_partition *partition,
|
||||
partition->pt_vp_count++;
|
||||
partition->pt_vp_array[args.vp_index] = vp;
|
||||
|
||||
return ret;
|
||||
goto out;
|
||||
|
||||
remove_debugfs_vp:
|
||||
mshv_debugfs_vp_remove(vp);
|
||||
@@ -1147,6 +1181,8 @@ mshv_partition_ioctl_create_vp(struct mshv_partition *partition,
|
||||
intercept_msg_page, input_vtl_zero);
|
||||
destroy_vp:
|
||||
hv_call_delete_vp(partition->pt_id, args.vp_index);
|
||||
out:
|
||||
trace_mshv_create_vp(partition->pt_id, args.vp_index, ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -1346,6 +1382,10 @@ mshv_map_user_memory(struct mshv_partition *partition,
|
||||
break;
|
||||
}
|
||||
|
||||
trace_mshv_map_user_memory(partition->pt_id, region->start_uaddr,
|
||||
region->start_gfn, region->nr_pages,
|
||||
region->hv_map_flags, ret);
|
||||
|
||||
if (ret)
|
||||
goto errout;
|
||||
|
||||
@@ -1641,6 +1681,9 @@ disable_vp_dispatch(struct mshv_vp *vp)
|
||||
if (ret)
|
||||
vp_err(vp, "failed to suspend\n");
|
||||
|
||||
trace_mshv_disable_vp_dispatch(vp->vp_partition->pt_id,
|
||||
vp->vp_index, ret);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -1689,6 +1732,8 @@ drain_vp_signals(struct mshv_vp *vp)
|
||||
vp->run.kicked_by_hv = 0;
|
||||
vp_signal_count = atomic64_read(&vp->run.vp_signaled_count);
|
||||
}
|
||||
|
||||
trace_mshv_drain_vp_signals(vp->vp_partition->pt_id, vp->vp_index);
|
||||
}
|
||||
|
||||
static void drain_all_vps(const struct mshv_partition *partition)
|
||||
@@ -1742,6 +1787,8 @@ static void destroy_partition(struct mshv_partition *partition)
|
||||
return;
|
||||
}
|
||||
|
||||
trace_mshv_destroy_partition(partition->pt_id);
|
||||
|
||||
if (partition->pt_initialized) {
|
||||
/*
|
||||
* We only need to drain signals for root scheduler. This should be
|
||||
@@ -1848,6 +1895,8 @@ mshv_partition_release(struct inode *inode, struct file *filp)
|
||||
{
|
||||
struct mshv_partition *partition = filp->private_data;
|
||||
|
||||
trace_mshv_partition_release(partition->pt_id);
|
||||
|
||||
mshv_eventfd_release(partition);
|
||||
|
||||
cleanup_srcu_struct(&partition->pt_irq_srcu);
|
||||
@@ -1977,6 +2026,7 @@ mshv_ioctl_create_partition(void __user *user_arg, struct device *module_dev)
|
||||
struct hv_partition_creation_properties creation_properties;
|
||||
union hv_partition_isolation_properties isolation_properties;
|
||||
struct mshv_partition *partition;
|
||||
u64 pt_id = -1;
|
||||
long ret;
|
||||
|
||||
ret = mshv_ioctl_process_pt_flags(user_arg, &creation_flags,
|
||||
@@ -2016,22 +2066,29 @@ mshv_ioctl_create_partition(void __user *user_arg, struct device *module_dev)
|
||||
ret = hv_call_create_partition(creation_flags,
|
||||
creation_properties,
|
||||
isolation_properties,
|
||||
&partition->pt_id);
|
||||
&pt_id);
|
||||
if (ret)
|
||||
goto cleanup_irq_srcu;
|
||||
|
||||
partition->pt_id = pt_id;
|
||||
|
||||
ret = add_partition(partition);
|
||||
if (ret)
|
||||
goto delete_partition;
|
||||
|
||||
ret = mshv_init_async_handler(partition);
|
||||
if (!ret) {
|
||||
ret = FD_ADD(O_CLOEXEC, anon_inode_getfile("mshv_partition",
|
||||
&mshv_partition_fops,
|
||||
partition, O_RDWR));
|
||||
if (ret >= 0)
|
||||
return ret;
|
||||
}
|
||||
if (ret)
|
||||
goto remove_partition;
|
||||
|
||||
ret = FD_ADD(O_CLOEXEC, anon_inode_getfile("mshv_partition",
|
||||
&mshv_partition_fops,
|
||||
partition, O_RDWR));
|
||||
if (ret < 0)
|
||||
goto remove_partition;
|
||||
|
||||
goto out;
|
||||
|
||||
remove_partition:
|
||||
remove_partition(partition);
|
||||
delete_partition:
|
||||
hv_call_delete_partition(partition->pt_id);
|
||||
@@ -2039,7 +2096,8 @@ mshv_ioctl_create_partition(void __user *user_arg, struct device *module_dev)
|
||||
cleanup_srcu_struct(&partition->pt_irq_srcu);
|
||||
free_partition:
|
||||
kfree(partition);
|
||||
|
||||
out:
|
||||
trace_mshv_create_partition(pt_id, ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
9
drivers/hv/mshv_trace.c
Normal file
9
drivers/hv/mshv_trace.c
Normal file
@@ -0,0 +1,9 @@
|
||||
// SPDX-License-Identifier: GPL-2.0
|
||||
/*
|
||||
* Copyright (c) 2026, Microsoft Corporation.
|
||||
*
|
||||
* Tracepoint definitions for mshv driver.
|
||||
*/
|
||||
|
||||
#define CREATE_TRACE_POINTS
|
||||
#include "mshv_trace.h"
|
||||
515
drivers/hv/mshv_trace.h
Normal file
515
drivers/hv/mshv_trace.h
Normal file
@@ -0,0 +1,515 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
/*
|
||||
* Copyright (c) 2026, Microsoft Corporation.
|
||||
*
|
||||
* Tracepoint declarations for mshv driver.
|
||||
*/
|
||||
|
||||
#undef TRACE_SYSTEM
|
||||
#define TRACE_SYSTEM mshv
|
||||
|
||||
#if !defined(__MSHV_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
|
||||
#define _MSHV_TRACE_H_
|
||||
|
||||
#include <linux/tracepoint.h>
|
||||
|
||||
#undef TRACE_INCLUDE_PATH
|
||||
#define TRACE_INCLUDE_PATH ../../drivers/hv
|
||||
|
||||
#undef TRACE_INCLUDE_FILE
|
||||
#define TRACE_INCLUDE_FILE mshv_trace
|
||||
|
||||
TRACE_EVENT(mshv_create_partition,
|
||||
TP_PROTO(u64 partition_id, int vm_fd),
|
||||
TP_ARGS(partition_id, vm_fd),
|
||||
TP_STRUCT__entry(
|
||||
__field(u64, partition_id)
|
||||
__field(int, vm_fd)
|
||||
),
|
||||
TP_fast_assign(
|
||||
__entry->partition_id = partition_id;
|
||||
__entry->vm_fd = vm_fd;
|
||||
),
|
||||
TP_printk("partition_id=%llu vm_fd=%d",
|
||||
__entry->partition_id,
|
||||
__entry->vm_fd
|
||||
)
|
||||
);
|
||||
|
||||
TRACE_EVENT(mshv_hvcall_create_partition,
|
||||
TP_PROTO(u64 flags, s64 partition_id),
|
||||
TP_ARGS(flags, partition_id),
|
||||
TP_STRUCT__entry(
|
||||
__field(u64, flags)
|
||||
__field(s64, partition_id)
|
||||
),
|
||||
TP_fast_assign(
|
||||
__entry->flags = flags;
|
||||
__entry->partition_id = partition_id;
|
||||
),
|
||||
TP_printk("flags=%#llx partition_id=%lld",
|
||||
__entry->flags,
|
||||
__entry->partition_id
|
||||
)
|
||||
);
|
||||
|
||||
TRACE_EVENT(mshv_hvcall_initialize_partition,
|
||||
TP_PROTO(u64 partition_id, u64 status),
|
||||
TP_ARGS(partition_id, status),
|
||||
TP_STRUCT__entry(
|
||||
__field(u64, partition_id)
|
||||
__field(u64, status)
|
||||
),
|
||||
TP_fast_assign(
|
||||
__entry->partition_id = partition_id;
|
||||
__entry->status = status;
|
||||
),
|
||||
TP_printk("partition_id=%llu status=%#llx",
|
||||
__entry->partition_id,
|
||||
__entry->status
|
||||
)
|
||||
);
|
||||
|
||||
TRACE_EVENT(mshv_partition_release,
|
||||
TP_PROTO(u64 partition_id),
|
||||
TP_ARGS(partition_id),
|
||||
TP_STRUCT__entry(
|
||||
__field(u64, partition_id)
|
||||
),
|
||||
TP_fast_assign(
|
||||
__entry->partition_id = partition_id;
|
||||
),
|
||||
TP_printk("partition_id=%llu",
|
||||
__entry->partition_id
|
||||
)
|
||||
);
|
||||
|
||||
TRACE_EVENT(mshv_destroy_partition,
|
||||
TP_PROTO(u64 partition_id),
|
||||
TP_ARGS(partition_id),
|
||||
TP_STRUCT__entry(
|
||||
__field(u64, partition_id)
|
||||
),
|
||||
TP_fast_assign(
|
||||
__entry->partition_id = partition_id;
|
||||
),
|
||||
TP_printk("partition_id=%llu",
|
||||
__entry->partition_id
|
||||
)
|
||||
);
|
||||
|
||||
TRACE_EVENT(mshv_hvcall_finalize_partition,
|
||||
TP_PROTO(u64 partition_id, u64 status),
|
||||
TP_ARGS(partition_id, status),
|
||||
TP_STRUCT__entry(
|
||||
__field(u64, partition_id)
|
||||
__field(u64, status)
|
||||
),
|
||||
TP_fast_assign(
|
||||
__entry->partition_id = partition_id;
|
||||
__entry->status = status;
|
||||
),
|
||||
TP_printk("partition_id=%llu status=%#llx ",
|
||||
__entry->partition_id,
|
||||
__entry->status
|
||||
)
|
||||
);
|
||||
|
||||
TRACE_EVENT(mshv_hvcall_withdraw_memory,
|
||||
TP_PROTO(u64 partition_id, u64 withdrawn, u64 status),
|
||||
TP_ARGS(partition_id, withdrawn, status),
|
||||
TP_STRUCT__entry(
|
||||
__field(u64, partition_id)
|
||||
__field(u64, withdrawn)
|
||||
__field(u64, status)
|
||||
),
|
||||
TP_fast_assign(
|
||||
__entry->partition_id = partition_id;
|
||||
__entry->withdrawn = withdrawn;
|
||||
__entry->status = status;
|
||||
),
|
||||
TP_printk("partition_id=%llu withdrawn=%llu status=%#llx",
|
||||
__entry->partition_id,
|
||||
__entry->withdrawn,
|
||||
__entry->status
|
||||
)
|
||||
);
|
||||
|
||||
TRACE_EVENT(mshv_hvcall_delete_partition,
|
||||
TP_PROTO(u64 partition_id, u64 status),
|
||||
TP_ARGS(partition_id, status),
|
||||
TP_STRUCT__entry(
|
||||
__field(u64, partition_id)
|
||||
__field(u64, status)
|
||||
),
|
||||
TP_fast_assign(
|
||||
__entry->partition_id = partition_id;
|
||||
__entry->status = status;
|
||||
),
|
||||
TP_printk("partition_id=%llu status=%#llx",
|
||||
__entry->partition_id,
|
||||
__entry->status
|
||||
)
|
||||
);
|
||||
|
||||
TRACE_EVENT(mshv_create_vp,
|
||||
TP_PROTO(u64 partition_id, u32 vp_index, long vp_fd),
|
||||
TP_ARGS(partition_id, vp_index, vp_fd),
|
||||
TP_STRUCT__entry(
|
||||
__field(u64, partition_id)
|
||||
__field(u32, vp_index)
|
||||
__field(long, vp_fd)
|
||||
),
|
||||
TP_fast_assign(
|
||||
__entry->partition_id = partition_id;
|
||||
__entry->vp_index = vp_index;
|
||||
__entry->vp_fd = vp_fd;
|
||||
),
|
||||
TP_printk("partition_id=%llu vp_index=%u vp_fd=%ld",
|
||||
__entry->partition_id,
|
||||
__entry->vp_index,
|
||||
__entry->vp_fd
|
||||
)
|
||||
);
|
||||
|
||||
TRACE_EVENT(mshv_hvcall_map_vp_state_page,
|
||||
TP_PROTO(u64 partition_id, u32 vp_index, u32 page_type, u64 status),
|
||||
TP_ARGS(partition_id, vp_index, page_type, status),
|
||||
TP_STRUCT__entry(
|
||||
__field(u64, partition_id)
|
||||
__field(u32, vp_index)
|
||||
__field(u32, page_type)
|
||||
__field(u64, status)
|
||||
),
|
||||
TP_fast_assign(
|
||||
__entry->partition_id = partition_id;
|
||||
__entry->vp_index = vp_index;
|
||||
__entry->page_type = page_type;
|
||||
__entry->status = status;
|
||||
),
|
||||
TP_printk("partition_id=%llu vp_index=%u page_type=%u status=%#llx",
|
||||
__entry->partition_id,
|
||||
__entry->vp_index,
|
||||
__entry->page_type,
|
||||
__entry->status
|
||||
)
|
||||
);
|
||||
|
||||
TRACE_EVENT(mshv_drain_vp_signals,
|
||||
TP_PROTO(u64 partition_id, u32 vp_index),
|
||||
TP_ARGS(partition_id, vp_index),
|
||||
TP_STRUCT__entry(
|
||||
__field(u64, partition_id)
|
||||
__field(u32, vp_index)
|
||||
),
|
||||
TP_fast_assign(
|
||||
__entry->partition_id = partition_id;
|
||||
__entry->vp_index = vp_index;
|
||||
),
|
||||
TP_printk("partition_id=%llu vp_index=%u",
|
||||
__entry->partition_id,
|
||||
__entry->vp_index
|
||||
)
|
||||
);
|
||||
|
||||
TRACE_EVENT(mshv_disable_vp_dispatch,
|
||||
TP_PROTO(u64 partition_id, u32 vp_index, int ret),
|
||||
TP_ARGS(partition_id, vp_index, ret),
|
||||
TP_STRUCT__entry(
|
||||
__field(u64, partition_id)
|
||||
__field(u32, vp_index)
|
||||
__field(int, ret)
|
||||
),
|
||||
TP_fast_assign(
|
||||
__entry->partition_id = partition_id;
|
||||
__entry->vp_index = vp_index;
|
||||
__entry->ret = ret;
|
||||
),
|
||||
TP_printk("partition_id=%llu vp_index=%u ret=%d",
|
||||
__entry->partition_id,
|
||||
__entry->vp_index,
|
||||
__entry->ret
|
||||
)
|
||||
);
|
||||
|
||||
TRACE_EVENT(mshv_vp_release,
|
||||
TP_PROTO(u64 partition_id, u32 vp_index),
|
||||
TP_ARGS(partition_id, vp_index),
|
||||
TP_STRUCT__entry(
|
||||
__field(u64, partition_id)
|
||||
__field(u32, vp_index)
|
||||
),
|
||||
TP_fast_assign(
|
||||
__entry->partition_id = partition_id;
|
||||
__entry->vp_index = vp_index;
|
||||
),
|
||||
TP_printk("partition_id=%llu vp_index=%u",
|
||||
__entry->partition_id,
|
||||
__entry->vp_index
|
||||
)
|
||||
);
|
||||
|
||||
TRACE_EVENT(mshv_run_vp_entry,
|
||||
TP_PROTO(u64 partition_id, u32 vp_index),
|
||||
TP_ARGS(partition_id, vp_index),
|
||||
TP_STRUCT__entry(
|
||||
__field(u64, partition_id)
|
||||
__field(u32, vp_index)
|
||||
),
|
||||
TP_fast_assign(
|
||||
__entry->partition_id = partition_id;
|
||||
__entry->vp_index = vp_index;
|
||||
),
|
||||
TP_printk("partition_id=%llu vp_index=%u",
|
||||
__entry->partition_id,
|
||||
__entry->vp_index
|
||||
)
|
||||
);
|
||||
|
||||
TRACE_EVENT(mshv_run_vp_exit,
|
||||
TP_PROTO(u64 partition_id, u32 vp_index, u64 hv_message_type, long ret),
|
||||
TP_ARGS(partition_id, vp_index, hv_message_type, ret),
|
||||
TP_STRUCT__entry(
|
||||
__field(u64, partition_id)
|
||||
__field(u32, vp_index)
|
||||
__field(u64, hv_message_type)
|
||||
__field(long, ret)
|
||||
),
|
||||
TP_fast_assign(
|
||||
__entry->partition_id = partition_id;
|
||||
__entry->vp_index = vp_index;
|
||||
__entry->hv_message_type = hv_message_type;
|
||||
__entry->ret = ret;
|
||||
),
|
||||
TP_printk("partition_id=%llu vp_index=%u hv_message_type=%#llx ret=%ld",
|
||||
__entry->partition_id,
|
||||
__entry->vp_index,
|
||||
__entry->hv_message_type,
|
||||
__entry->ret
|
||||
)
|
||||
);
|
||||
|
||||
TRACE_EVENT(mshv_vp_clear_explicit_suspend,
|
||||
TP_PROTO(u64 partition_id, u32 vp_index, int ret),
|
||||
TP_ARGS(partition_id, vp_index, ret),
|
||||
TP_STRUCT__entry(
|
||||
__field(u64, partition_id)
|
||||
__field(u32, vp_index)
|
||||
__field(int, ret)
|
||||
),
|
||||
TP_fast_assign(
|
||||
__entry->partition_id = partition_id;
|
||||
__entry->vp_index = vp_index;
|
||||
__entry->ret = ret;
|
||||
),
|
||||
TP_printk("partition_id=%llu vp_index=%u ret=%d",
|
||||
__entry->partition_id,
|
||||
__entry->vp_index,
|
||||
__entry->ret
|
||||
)
|
||||
);
|
||||
|
||||
TRACE_EVENT(mshv_xfer_to_guest_mode_work,
|
||||
TP_PROTO(u64 partition_id, u32 vp_index, unsigned long thread_info_flag, long ret),
|
||||
TP_ARGS(partition_id, vp_index, thread_info_flag, ret),
|
||||
TP_STRUCT__entry(
|
||||
__field(u64, partition_id)
|
||||
__field(u32, vp_index)
|
||||
__field(unsigned long, thread_info_flag)
|
||||
__field(long, ret)
|
||||
),
|
||||
TP_fast_assign(
|
||||
__entry->partition_id = partition_id;
|
||||
__entry->vp_index = vp_index;
|
||||
__entry->thread_info_flag = thread_info_flag;
|
||||
__entry->ret = ret;
|
||||
),
|
||||
TP_printk("partition_id=%llu vp_index=%u thread_info_flag=%#lx ret=%ld",
|
||||
__entry->partition_id,
|
||||
__entry->vp_index,
|
||||
__entry->thread_info_flag,
|
||||
__entry->ret
|
||||
)
|
||||
);
|
||||
|
||||
TRACE_EVENT(mshv_hvcall_dispatch_vp,
|
||||
TP_PROTO(u64 partition_id, u32 vp_index, u32 flags,
|
||||
u32 dispatch_state, u32 dispatch_event, u64 irq_vectors, u64 status),
|
||||
TP_ARGS(partition_id, vp_index, flags, dispatch_state, dispatch_event, irq_vectors,
|
||||
status),
|
||||
TP_STRUCT__entry(
|
||||
__field(u64, partition_id)
|
||||
__field(u32, vp_index)
|
||||
__field(u32, flags)
|
||||
__field(u32, dispatch_state)
|
||||
__field(u32, dispatch_event)
|
||||
__field(u64, irq_vectors)
|
||||
__field(u64, status)
|
||||
),
|
||||
TP_fast_assign(
|
||||
__entry->partition_id = partition_id;
|
||||
__entry->vp_index = vp_index;
|
||||
__entry->flags = flags;
|
||||
__entry->dispatch_state = dispatch_state;
|
||||
__entry->dispatch_event = dispatch_event;
|
||||
__entry->irq_vectors = irq_vectors;
|
||||
__entry->status = status;
|
||||
),
|
||||
TP_printk("partition_id=%llu vp_index=%u flags=%#x dispatch_state=%#x dispatch_event=%#x irq_vectors=%#016llx status=%#llx",
|
||||
__entry->partition_id,
|
||||
__entry->vp_index,
|
||||
__entry->flags,
|
||||
__entry->dispatch_state,
|
||||
__entry->dispatch_event,
|
||||
__entry->irq_vectors,
|
||||
__entry->status
|
||||
)
|
||||
);
|
||||
|
||||
TRACE_EVENT(mshv_update_routing_table,
|
||||
TP_PROTO(u64 partition_id, void *old, void *new, u32 numents),
|
||||
TP_ARGS(partition_id, old, new, numents),
|
||||
TP_STRUCT__entry(
|
||||
__field(u64, partition_id)
|
||||
__field(struct mshv_girq_routing_table *, old)
|
||||
__field(struct mshv_girq_routing_table *, new)
|
||||
__field(u32, numents)
|
||||
),
|
||||
TP_fast_assign(
|
||||
__entry->partition_id = partition_id;
|
||||
__entry->old = old;
|
||||
__entry->new = new;
|
||||
__entry->numents = numents;
|
||||
),
|
||||
TP_printk("partition_id=%llu old=%p new=%p numents=%u",
|
||||
__entry->partition_id,
|
||||
__entry->old,
|
||||
__entry->new,
|
||||
__entry->numents
|
||||
)
|
||||
);
|
||||
|
||||
TRACE_EVENT(mshv_map_user_memory,
|
||||
TP_PROTO(u64 partition_id, u64 start_uaddr, u64 start_gfn, u64 nr_pages, u32 map_flags,
|
||||
long ret),
|
||||
TP_ARGS(partition_id, start_uaddr, start_gfn, nr_pages, map_flags, ret),
|
||||
TP_STRUCT__entry(
|
||||
__field(u64, partition_id)
|
||||
__field(u64, start_uaddr)
|
||||
__field(u64, start_gfn)
|
||||
__field(u64, nr_pages)
|
||||
__field(u32, map_flags)
|
||||
__field(long, ret)
|
||||
),
|
||||
TP_fast_assign(
|
||||
__entry->partition_id = partition_id;
|
||||
__entry->start_uaddr = start_uaddr;
|
||||
__entry->start_gfn = start_gfn;
|
||||
__entry->nr_pages = nr_pages;
|
||||
__entry->map_flags = map_flags;
|
||||
__entry->ret = ret;
|
||||
),
|
||||
TP_printk("partition_id=%llu start_uaddr=%#llx start_gfn=%#llx nr_pages=%llu map_flags=%#x ret=%ld",
|
||||
__entry->partition_id,
|
||||
__entry->start_uaddr,
|
||||
__entry->start_gfn,
|
||||
__entry->nr_pages,
|
||||
__entry->map_flags,
|
||||
__entry->ret
|
||||
)
|
||||
);
|
||||
|
||||
TRACE_EVENT(mshv_assign_ioeventfd,
|
||||
TP_PROTO(u64 partition_id, u64 addr, u64 length, u64 datamatch, bool wildcard,
|
||||
void *eventfd, int ret),
|
||||
TP_ARGS(partition_id, addr, length, datamatch, wildcard, eventfd, ret),
|
||||
TP_STRUCT__entry(
|
||||
__field(u64, partition_id)
|
||||
__field(u64, addr)
|
||||
__field(u64, length)
|
||||
__field(u64, datamatch)
|
||||
__field(bool, wildcard)
|
||||
__field(struct eventfd_ctx *, eventfd)
|
||||
__field(int, ret)
|
||||
),
|
||||
TP_fast_assign(
|
||||
__entry->partition_id = partition_id;
|
||||
__entry->addr = addr;
|
||||
__entry->length = length;
|
||||
__entry->datamatch = datamatch;
|
||||
__entry->wildcard = wildcard;
|
||||
__entry->eventfd = eventfd;
|
||||
__entry->ret = ret;
|
||||
),
|
||||
TP_printk("partition_id=%llu addr=%#016llx length=%#llx datamatch=%#llx wildcard=%d eventfd=%p ret=%d",
|
||||
__entry->partition_id,
|
||||
__entry->addr,
|
||||
__entry->length,
|
||||
__entry->datamatch,
|
||||
__entry->wildcard,
|
||||
__entry->eventfd,
|
||||
__entry->ret
|
||||
)
|
||||
);
|
||||
|
||||
TRACE_EVENT(mshv_deassign_ioeventfd,
|
||||
TP_PROTO(u64 partition_id, u64 addr, u64 length, u64 datamatch, bool wildcard,
|
||||
void *eventfd),
|
||||
TP_ARGS(partition_id, addr, length, datamatch, wildcard, eventfd),
|
||||
TP_STRUCT__entry(
|
||||
__field(u64, partition_id)
|
||||
__field(u64, addr)
|
||||
__field(u64, length)
|
||||
__field(u64, datamatch)
|
||||
__field(bool, wildcard)
|
||||
__field(struct eventfd_ctx *, eventfd)
|
||||
),
|
||||
TP_fast_assign(
|
||||
__entry->partition_id = partition_id;
|
||||
__entry->addr = addr;
|
||||
__entry->length = length;
|
||||
__entry->datamatch = datamatch;
|
||||
__entry->wildcard = wildcard;
|
||||
__entry->eventfd = eventfd;
|
||||
),
|
||||
TP_printk("partition_id=%llu addr=%#016llx length=%#llx datamatch=%#llx wildcard=%d eventfd=%p",
|
||||
__entry->partition_id,
|
||||
__entry->addr,
|
||||
__entry->length,
|
||||
__entry->datamatch,
|
||||
__entry->wildcard,
|
||||
__entry->eventfd
|
||||
)
|
||||
);
|
||||
|
||||
TRACE_EVENT(mshv_vp_wait_for_hv_kick,
|
||||
TP_PROTO(u64 partition_id, u32 vp_index, bool kicked_by_hv, bool blocked,
|
||||
bool irq_pending),
|
||||
TP_ARGS(partition_id, vp_index, kicked_by_hv, blocked, irq_pending),
|
||||
TP_STRUCT__entry(
|
||||
__field(u64, partition_id)
|
||||
__field(u32, vp_index)
|
||||
__field(bool, kicked_by_hv)
|
||||
__field(bool, blocked)
|
||||
__field(bool, irq_pending)
|
||||
),
|
||||
TP_fast_assign(
|
||||
__entry->partition_id = partition_id;
|
||||
__entry->vp_index = vp_index;
|
||||
__entry->kicked_by_hv = kicked_by_hv;
|
||||
__entry->blocked = blocked;
|
||||
__entry->irq_pending = irq_pending;
|
||||
),
|
||||
TP_printk("partition_id=%llu vp_index=%u kicked_by_hv=%d blocked=%d irq_pending=%d",
|
||||
__entry->partition_id,
|
||||
__entry->vp_index,
|
||||
__entry->kicked_by_hv,
|
||||
__entry->blocked,
|
||||
__entry->irq_pending
|
||||
)
|
||||
);
|
||||
|
||||
#endif /* _MSHV_TRACE_H_ */
|
||||
|
||||
/* This part must be outside protection */
|
||||
#include <trace/define_trace.h>
|
||||
Reference in New Issue
Block a user