hwprofile.c (9c03aa87e52567f6c9a7bf456e5dd94dc84088de) | hwprofile.c (402587419993d86638f1f81fc4e55625a320ad2f) |
---|---|
1/* 2 * Copyright (C) 2020, Alex Bennée <alex.bennee@linaro.org> 3 * 4 * HW Profile - breakdown access patterns for IO to devices 5 * 6 * License: GNU GPL, version 2 or later. 7 * See the COPYING file in the top-level directory. 8 */ --- 249 unchanged lines hidden (view full) --- 258int qemu_plugin_install(qemu_plugin_id_t id, const qemu_info_t *info, 259 int argc, char **argv) 260{ 261 int i; 262 g_autoptr(GString) matches_raw = g_string_new(""); 263 264 for (i = 0; i < argc; i++) { 265 char *opt = argv[i]; | 1/* 2 * Copyright (C) 2020, Alex Bennée <alex.bennee@linaro.org> 3 * 4 * HW Profile - breakdown access patterns for IO to devices 5 * 6 * License: GNU GPL, version 2 or later. 7 * See the COPYING file in the top-level directory. 8 */ --- 249 unchanged lines hidden (view full) --- 258int qemu_plugin_install(qemu_plugin_id_t id, const qemu_info_t *info, 259 int argc, char **argv) 260{ 261 int i; 262 g_autoptr(GString) matches_raw = g_string_new(""); 263 264 for (i = 0; i < argc; i++) { 265 char *opt = argv[i]; |
266 g_autofree char **tokens = g_strsplit(opt, "=", 2); | 266 g_auto(GStrv) tokens = g_strsplit(opt, "=", 2); |
267 268 if (g_strcmp0(tokens[0], "track") == 0) { 269 if (g_strcmp0(tokens[1], "read") == 0) { 270 rw = QEMU_PLUGIN_MEM_R; 271 } else if (g_strcmp0(tokens[1], "write") == 0) { 272 rw = QEMU_PLUGIN_MEM_W; 273 } else { 274 fprintf(stderr, "invalid value for track: %s\n", tokens[1]); --- 46 unchanged lines hidden --- | 267 268 if (g_strcmp0(tokens[0], "track") == 0) { 269 if (g_strcmp0(tokens[1], "read") == 0) { 270 rw = QEMU_PLUGIN_MEM_R; 271 } else if (g_strcmp0(tokens[1], "write") == 0) { 272 rw = QEMU_PLUGIN_MEM_W; 273 } else { 274 fprintf(stderr, "invalid value for track: %s\n", tokens[1]); --- 46 unchanged lines hidden --- |