[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 02/12] util/log: make qemu_set_dfilter_ranges() take a GList
From: |
Sven Schnelle |
Subject: |
[PATCH v3 02/12] util/log: make qemu_set_dfilter_ranges() take a GList |
Date: |
Fri, 1 Mar 2024 18:45:59 +0100 |
In preparation of making qemu_set_dfilter_ranges() available
to other users, move the code to a new function range_list_from_string()
which takes an additional GList argument.
Signed-off-by: Sven Schnelle <svens@stackframe.org>
---
util/log.c | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/util/log.c b/util/log.c
index 779c0689a9..f183ea4e4d 100644
--- a/util/log.c
+++ b/util/log.c
@@ -382,15 +382,16 @@ bool qemu_log_in_addr_range(uint64_t addr)
return false;
}
-void qemu_set_dfilter_ranges(const char *filter_spec, Error **errp)
+static void range_list_from_string(GList **out_ranges, const char *filter_spec,
+ Error **errp)
{
gchar **ranges = g_strsplit(filter_spec, ",", 0);
struct Range *range = NULL;
int i;
- if (debug_regions) {
- g_list_free_full(debug_regions, g_free);
- debug_regions = NULL;
+ if (*out_ranges) {
+ g_list_free_full(*out_ranges, g_free);
+ *out_ranges = NULL;
}
for (i = 0; ranges[i]; i++) {
@@ -447,7 +448,7 @@ void qemu_set_dfilter_ranges(const char *filter_spec, Error
**errp)
goto out;
}
range_set_bounds(range, lob, upb);
- debug_regions = g_list_append(debug_regions, range);
+ *out_ranges = g_list_append(*out_ranges, range);
range = NULL;
}
out:
@@ -455,6 +456,11 @@ out:
g_strfreev(ranges);
}
+void qemu_set_dfilter_ranges(const char *filter_spec, Error **errp)
+{
+ range_list_from_string(&debug_regions, filter_spec, errp);
+}
+
const QEMULogItem qemu_log_items[] = {
{ CPU_LOG_TB_OUT_ASM, "out_asm",
"show generated host assembly code for each compiled TB" },
--
2.43.2
[PATCH v3 06/12] util/range: split up range_list_from_string(), Sven Schnelle, 2024/03/01
[PATCH v3 05/12] util/range: use append_new_range() in range_list_from_string(), Sven Schnelle, 2024/03/01
[PATCH v3 02/12] util/log: make qemu_set_dfilter_ranges() take a GList,
Sven Schnelle <=
[PATCH v3 03/12] util/range: move range_list_from_string() to range.c, Sven Schnelle, 2024/03/01
[PATCH v3 07/12] util/range: make range_list_from_string() accept a single number, Sven Schnelle, 2024/03/01
[PATCH v3 08/12] qemu/range: add range_list_contains() function, Sven Schnelle, 2024/03/01
[PATCH v3 04/12] util/range: add range_list_free(), Sven Schnelle, 2024/03/01
[PATCH v3 10/12] plugins: add range list API, Sven Schnelle, 2024/03/01
[PATCH v3 12/12] plugins/execlog: add data address match, Sven Schnelle, 2024/03/01
[PATCH v3 09/12] plugins: add API to print errors, Sven Schnelle, 2024/03/01
[PATCH v3 11/12] plugins/execlog: use range list api, Sven Schnelle, 2024/03/01