From: Anthony Harivel <aharivel@redhat.com>
To: pbonzini@redhat.com, berrange@redhat.com
Cc: qemu-devel@nongnu.org, Anthony Harivel <aharivel@redhat.com>
Subject: [PATCH 2/2] target/i386/kvm: Change error_report() to tracepoint in vmsr_read_thread_stat()
Date: Thu, 13 Mar 2025 11:19:02 +0100 [thread overview]
Message-ID: <20250313101902.835556-3-aharivel@redhat.com> (raw)
In-Reply-To: <20250313101902.835556-1-aharivel@redhat.com>
Threads in QEMU are frequently created and destroyed, leading to
non-critical errors. Replace `error_report()` with a tracepoint to
prevent flooding the serial terminal with non-essential error messages.
Signed-off-by: Anthony Harivel <aharivel@redhat.com>
---
target/i386/kvm/trace-events | 3 +++
target/i386/kvm/vmsr_energy.c | 3 ++-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/target/i386/kvm/trace-events b/target/i386/kvm/trace-events
index 74a6234ff7f5..527750e3b23d 100644
--- a/target/i386/kvm/trace-events
+++ b/target/i386/kvm/trace-events
@@ -13,3 +13,6 @@ kvm_xen_soft_reset(void) ""
kvm_xen_set_shared_info(uint64_t gfn) "shared info at gfn 0x%" PRIx64
kvm_xen_set_vcpu_attr(int cpu, int type, uint64_t gpa) "vcpu attr cpu %d type %d gpa 0x%" PRIx64
kvm_xen_set_vcpu_callback(int cpu, int vector) "callback vcpu %d vector %d"
+
+# vmsr_energy.c
+vmsr_read_thread_stat(const char *path) "Error opening path %s"
diff --git a/target/i386/kvm/vmsr_energy.c b/target/i386/kvm/vmsr_energy.c
index f3861d0607bb..f99aa9cfeb94 100644
--- a/target/i386/kvm/vmsr_energy.c
+++ b/target/i386/kvm/vmsr_energy.c
@@ -19,6 +19,7 @@
#include "hw/boards.h"
#include "cpu.h"
#include "host-cpu.h"
+#include "trace.h"
char *vmsr_compute_default_paths(void)
{
@@ -280,7 +281,7 @@ void vmsr_read_thread_stat(pid_t pid,
FILE *file = fopen(path, "r");
if (file == NULL) {
- error_report("Error opening %s", path_name);
+ trace_vmsr_read_thread_stat(path_name);
return;
}
--
2.48.1
prev parent reply other threads:[~2025-03-13 10:21 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-13 10:19 [PATCH 0/2] Add AMD CPU for RAPL MSR support Anthony Harivel
2025-03-13 10:19 ` [PATCH 1/2] target/i386/kvm: add AMD support for RAPL MSR Anthony Harivel
2025-03-13 10:19 ` Anthony Harivel [this message]
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=20250313101902.835556-3-aharivel@redhat.com \
--to=aharivel@redhat.com \
--cc=berrange@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
/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;
as well as URLs for NNTP newsgroup(s).