drcov.c (da36afa2d8dc9c778292ff172083caba9558b4fa) | drcov.c (402587419993d86638f1f81fc4e55625a320ad2f) |
---|---|
1/* 2 * Copyright (C) 2021, Ivanov Arkady <arkadiy.ivanov@ispras.ru> 3 * 4 * Drcov - a DynamoRIO-based tool that collects coverage information 5 * from a binary. Primary goal this script is to have coverage log 6 * files that work in Lighthouse. 7 * 8 * License: GNU GPL, version 2 or later. --- 134 unchanged lines hidden (view full) --- 143 144} 145 146QEMU_PLUGIN_EXPORT 147int qemu_plugin_install(qemu_plugin_id_t id, const qemu_info_t *info, 148 int argc, char **argv) 149{ 150 for (int i = 0; i < argc; i++) { | 1/* 2 * Copyright (C) 2021, Ivanov Arkady <arkadiy.ivanov@ispras.ru> 3 * 4 * Drcov - a DynamoRIO-based tool that collects coverage information 5 * from a binary. Primary goal this script is to have coverage log 6 * files that work in Lighthouse. 7 * 8 * License: GNU GPL, version 2 or later. --- 134 unchanged lines hidden (view full) --- 143 144} 145 146QEMU_PLUGIN_EXPORT 147int qemu_plugin_install(qemu_plugin_id_t id, const qemu_info_t *info, 148 int argc, char **argv) 149{ 150 for (int i = 0; i < argc; i++) { |
151 g_autofree char **tokens = g_strsplit(argv[i], "=", 2); | 151 g_auto(GStrv) tokens = g_strsplit(argv[i], "=", 2); |
152 if (g_strcmp0(tokens[0], "filename") == 0) { 153 file_name = g_strdup(tokens[1]); 154 } 155 } 156 157 plugin_init(); 158 159 qemu_plugin_register_vcpu_tb_trans_cb(id, vcpu_tb_trans); 160 qemu_plugin_register_atexit_cb(id, plugin_exit, NULL); 161 162 return 0; 163} | 152 if (g_strcmp0(tokens[0], "filename") == 0) { 153 file_name = g_strdup(tokens[1]); 154 } 155 } 156 157 plugin_init(); 158 159 qemu_plugin_register_vcpu_tb_trans_cb(id, vcpu_tb_trans); 160 qemu_plugin_register_atexit_cb(id, plugin_exit, NULL); 161 162 return 0; 163} |