execlog.c (0d37413c639d8f467fc92c86a1ed54ecdba5220d) execlog.c (402587419993d86638f1f81fc4e55625a320ad2f)
1/*
2 * Copyright (C) 2021, Alexandre Iooss <erdnaxe@crans.org>
3 *
4 * Log instruction execution with memory access.
5 *
6 * License: GNU GPL, version 2 or later.
7 * See the COPYING file in the top-level directory.
8 */

--- 213 unchanged lines hidden (view full) ---

222 if (info->system_emulation) {
223 last_exec = g_ptr_array_sized_new(info->system.max_vcpus);
224 } else {
225 last_exec = g_ptr_array_new();
226 }
227
228 for (int i = 0; i < argc; i++) {
229 char *opt = argv[i];
1/*
2 * Copyright (C) 2021, Alexandre Iooss <erdnaxe@crans.org>
3 *
4 * Log instruction execution with memory access.
5 *
6 * License: GNU GPL, version 2 or later.
7 * See the COPYING file in the top-level directory.
8 */

--- 213 unchanged lines hidden (view full) ---

222 if (info->system_emulation) {
223 last_exec = g_ptr_array_sized_new(info->system.max_vcpus);
224 } else {
225 last_exec = g_ptr_array_new();
226 }
227
228 for (int i = 0; i < argc; i++) {
229 char *opt = argv[i];
230 g_autofree char **tokens = g_strsplit(opt, "=", 2);
230 g_auto(GStrv) tokens = g_strsplit(opt, "=", 2);
231 if (g_strcmp0(tokens[0], "ifilter") == 0) {
232 parse_insn_match(tokens[1]);
233 } else if (g_strcmp0(tokens[0], "afilter") == 0) {
234 parse_vaddr_match(tokens[1]);
235 } else {
236 fprintf(stderr, "option parsing failed: %s\n", opt);
237 return -1;
238 }
239 }
240
241 /* Register translation block and exit callbacks */
242 qemu_plugin_register_vcpu_tb_trans_cb(id, vcpu_tb_trans);
243 qemu_plugin_register_atexit_cb(id, plugin_exit, NULL);
244
245 return 0;
246}
231 if (g_strcmp0(tokens[0], "ifilter") == 0) {
232 parse_insn_match(tokens[1]);
233 } else if (g_strcmp0(tokens[0], "afilter") == 0) {
234 parse_vaddr_match(tokens[1]);
235 } else {
236 fprintf(stderr, "option parsing failed: %s\n", opt);
237 return -1;
238 }
239 }
240
241 /* Register translation block and exit callbacks */
242 qemu_plugin_register_vcpu_tb_trans_cb(id, vcpu_tb_trans);
243 qemu_plugin_register_atexit_cb(id, plugin_exit, NULL);
244
245 return 0;
246}