hotpages.c (9c03aa87e52567f6c9a7bf456e5dd94dc84088de) hotpages.c (402587419993d86638f1f81fc4e55625a320ad2f)
1/*
2 * Copyright (C) 2019, Alex Bennée <alex.bennee@linaro.org>
3 *
4 * Hot Pages - show which pages saw the most memory accesses.
5 *
6 * License: GNU GPL, version 2 or later.
7 * See the COPYING file in the top-level directory.
8 */

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

164QEMU_PLUGIN_EXPORT
165int qemu_plugin_install(qemu_plugin_id_t id, const qemu_info_t *info,
166 int argc, char **argv)
167{
168 int i;
169
170 for (i = 0; i < argc; i++) {
171 char *opt = argv[i];
1/*
2 * Copyright (C) 2019, Alex Bennée <alex.bennee@linaro.org>
3 *
4 * Hot Pages - show which pages saw the most memory accesses.
5 *
6 * License: GNU GPL, version 2 or later.
7 * See the COPYING file in the top-level directory.
8 */

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

164QEMU_PLUGIN_EXPORT
165int qemu_plugin_install(qemu_plugin_id_t id, const qemu_info_t *info,
166 int argc, char **argv)
167{
168 int i;
169
170 for (i = 0; i < argc; i++) {
171 char *opt = argv[i];
172 g_autofree char **tokens = g_strsplit(opt, "=", -1);
172 g_auto(GStrv) tokens = g_strsplit(opt, "=", -1);
173
174 if (g_strcmp0(tokens[0], "sortby") == 0) {
175 if (g_strcmp0(tokens[1], "reads") == 0) {
176 sort_by = SORT_R;
177 } else if (g_strcmp0(tokens[1], "writes") == 0) {
178 sort_by = SORT_W;
179 } else if (g_strcmp0(tokens[1], "address") == 0) {
180 sort_by = SORT_A;

--- 23 unchanged lines hidden ---
173
174 if (g_strcmp0(tokens[0], "sortby") == 0) {
175 if (g_strcmp0(tokens[1], "reads") == 0) {
176 sort_by = SORT_R;
177 } else if (g_strcmp0(tokens[1], "writes") == 0) {
178 sort_by = SORT_W;
179 } else if (g_strcmp0(tokens[1], "address") == 0) {
180 sort_by = SORT_A;

--- 23 unchanged lines hidden ---