From: Bibo Mao <maobibo@loongson.cn>
To: Steven Rostedt <rostedt@goodmis.org>,
LKML <linux-kernel@vger.kernel.org>,
Linux Trace Kernel <linux-trace-kernel@vger.kernel.org>,
kvm@vger.kernel.org, loongarch@lists.linux.dev
Cc: Tianrui Zhao <zhaotianrui@loongson.cn>,
Huacai Chen <chenhuacai@kernel.org>,
Paolo Bonzini <pbonzini@redhat.com>,
Masami Hiramatsu <mhiramat@kernel.org>,
Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Subject: Re: [PATCH] LoongArch: KVM: Move kvm_iocsr tracepoint out of generic code
Date: Thu, 24 Jul 2025 09:39:40 +0800 [thread overview]
Message-ID: <2c2f5036-c3ae-3904-e940-8a8b71a65957@loongson.cn> (raw)
In-Reply-To: <20250722094734.4920545b@gandalf.local.home>
On 2025/7/22 下午9:47, Steven Rostedt wrote:
> From: Steven Rostedt <rostedt@goodmis.org>
>
> The tracepoint kvm_iocsr is only used by the loongarch architecture. As
> trace events can take up to 5K of memory, move this tracepoint into the
> loongarch specific tracing file so that it doesn't waste memory for all
> other architectures.
>
> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
> ---
> arch/loongarch/kvm/trace.h | 35 +++++++++++++++++++++++++++++++++++
> include/trace/events/kvm.h | 35 -----------------------------------
> 2 files changed, 35 insertions(+), 35 deletions(-)
>
> diff --git a/arch/loongarch/kvm/trace.h b/arch/loongarch/kvm/trace.h
> index 145514dab6d5..d73dea8afb74 100644
> --- a/arch/loongarch/kvm/trace.h
> +++ b/arch/loongarch/kvm/trace.h
> @@ -115,6 +115,41 @@ TRACE_EVENT(kvm_exit_gspr,
> __entry->inst_word)
> );
>
> +#define KVM_TRACE_IOCSR_READ_UNSATISFIED 0
> +#define KVM_TRACE_IOCSR_READ 1
> +#define KVM_TRACE_IOCSR_WRITE 2
> +
> +#define kvm_trace_symbol_iocsr \
> + { KVM_TRACE_IOCSR_READ_UNSATISFIED, "unsatisfied-read" }, \
> + { KVM_TRACE_IOCSR_READ, "read" }, \
> + { KVM_TRACE_IOCSR_WRITE, "write" }
> +
> +TRACE_EVENT(kvm_iocsr,
> + TP_PROTO(int type, int len, u64 gpa, void *val),
> + TP_ARGS(type, len, gpa, val),
> +
> + TP_STRUCT__entry(
> + __field( u32, type )
> + __field( u32, len )
> + __field( u64, gpa )
> + __field( u64, val )
> + ),
> +
> + TP_fast_assign(
> + __entry->type = type;
> + __entry->len = len;
> + __entry->gpa = gpa;
> + __entry->val = 0;
> + if (val)
> + memcpy(&__entry->val, val,
> + min_t(u32, sizeof(__entry->val), len));
> + ),
> +
> + TP_printk("iocsr %s len %u gpa 0x%llx val 0x%llx",
> + __print_symbolic(__entry->type, kvm_trace_symbol_iocsr),
> + __entry->len, __entry->gpa, __entry->val)
> +);
> +
> #define KVM_TRACE_AUX_SAVE 0
> #define KVM_TRACE_AUX_RESTORE 1
> #define KVM_TRACE_AUX_ENABLE 2
> diff --git a/include/trace/events/kvm.h b/include/trace/events/kvm.h
> index 8b7252b8d751..b282e3a86769 100644
> --- a/include/trace/events/kvm.h
> +++ b/include/trace/events/kvm.h
> @@ -156,41 +156,6 @@ TRACE_EVENT(kvm_mmio,
> __entry->len, __entry->gpa, __entry->val)
> );
>
> -#define KVM_TRACE_IOCSR_READ_UNSATISFIED 0
> -#define KVM_TRACE_IOCSR_READ 1
> -#define KVM_TRACE_IOCSR_WRITE 2
> -
> -#define kvm_trace_symbol_iocsr \
> - { KVM_TRACE_IOCSR_READ_UNSATISFIED, "unsatisfied-read" }, \
> - { KVM_TRACE_IOCSR_READ, "read" }, \
> - { KVM_TRACE_IOCSR_WRITE, "write" }
> -
> -TRACE_EVENT(kvm_iocsr,
> - TP_PROTO(int type, int len, u64 gpa, void *val),
> - TP_ARGS(type, len, gpa, val),
> -
> - TP_STRUCT__entry(
> - __field( u32, type )
> - __field( u32, len )
> - __field( u64, gpa )
> - __field( u64, val )
> - ),
> -
> - TP_fast_assign(
> - __entry->type = type;
> - __entry->len = len;
> - __entry->gpa = gpa;
> - __entry->val = 0;
> - if (val)
> - memcpy(&__entry->val, val,
> - min_t(u32, sizeof(__entry->val), len));
> - ),
> -
> - TP_printk("iocsr %s len %u gpa 0x%llx val 0x%llx",
> - __print_symbolic(__entry->type, kvm_trace_symbol_iocsr),
> - __entry->len, __entry->gpa, __entry->val)
> -);
> -
> #define kvm_fpu_load_symbol \
> {0, "unload"}, \
> {1, "load"}
>
Reviewed-by: Bibo Mao <maobibo@loongson.cn>
next prev parent reply other threads:[~2025-07-24 1:41 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-22 13:47 Steven Rostedt
2025-07-24 1:39 ` Bibo Mao [this message]
2025-07-24 1:46 ` Steven Rostedt
2025-07-24 1:49 ` Bibo Mao
2025-07-24 11:56 ` Huacai Chen
2025-07-24 13:24 ` Steven Rostedt
2025-08-20 0:27 ` Steven Rostedt
2025-08-20 3:03 ` Huacai Chen
2025-08-20 13:35 ` Steven Rostedt
2025-08-29 10:14 ` Huacai Chen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2c2f5036-c3ae-3904-e940-8a8b71a65957@loongson.cn \
--to=maobibo@loongson.cn \
--cc=chenhuacai@kernel.org \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=loongarch@lists.linux.dev \
--cc=mathieu.desnoyers@efficios.com \
--cc=mhiramat@kernel.org \
--cc=pbonzini@redhat.com \
--cc=rostedt@goodmis.org \
--cc=zhaotianrui@loongson.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®