From nobody Sun May 12 00:34:05 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1626516721166164.8811892316984; Sat, 17 Jul 2021 03:12:01 -0700 (PDT) Received: from localhost ([::1]:32878 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m4hIe-00027n-5G for importer@patchew.org; Sat, 17 Jul 2021 06:12:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35650) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m4hH2-0007hZ-2U for qemu-devel@nongnu.org; Sat, 17 Jul 2021 06:10:20 -0400 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]:37428) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m4hGv-0007RD-Kf for qemu-devel@nongnu.org; Sat, 17 Jul 2021 06:10:19 -0400 Received: by mail-wm1-x32c.google.com with SMTP id y21-20020a7bc1950000b02902161fccabf1so9682274wmi.2 for ; Sat, 17 Jul 2021 03:10:11 -0700 (PDT) Received: from localhost.localdomain ([41.34.125.69]) by smtp.gmail.com with ESMTPSA id 11sm13846923wmo.10.2021.07.17.03.10.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Jul 2021 03:10:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=/ZfUY8t6QSU0kfRmcUlho99+o9wSl9O3sA2ot3i6FlQ=; b=BDC75xFqVLbm1ZNS0yXOtjaAD6cX5yLccljd0WtXAKKoy+NQgKJdlhZsI219WuQddw 3GT4ghCjBew74dlaS+PmgrV8n7GMShngX1vzU+ARU3oMg2x8SErPgpHP8nFl5tRv9EeF +xWCAnqVndns08h0nVG3s8VPR/9Kalb0DVbnCMDz9qVE1GwjnGz0jnpu9aq1HVozdhZW Y7JRUZsOvF/2kggHmF0UoVbAgdNGwYMaYUAmwGmL0DPdU9TC2U5q/e1jsC54sc5fk2jz wSMrXC70gW4V+A0HEqCNwB1QVLWZIVTjFztQ8mvB75vAPlhK3hU7lZaO8qQ1eoZbSHZr jkJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=/ZfUY8t6QSU0kfRmcUlho99+o9wSl9O3sA2ot3i6FlQ=; b=RNI3hvoeDnBlCjFtCOMK3Oj4tndePaHTXbwLnDIWLca3N1OdK8SOPSzg1AvWFEBJf9 XzngASAP9+WJzsMUUU13ZMJ4D+RS08xVKPESgNRI668Yyr6bq98jKHaCYa30QZizxwXS JE8JuS7aRBaB41at3hyKuhH49zevkWZrmpeh//4G3iS7npASTFTAVL9aRZ26QeITD8JX qm31ljRkL0T585VzCVkriKLWXLSiTq1gQdQIBLqguPYsWFZqDHfSJu6nZfaNxGjjPOJa JAsCVwRrH71L8f5lmnBE3f8DcsLlEEr6smsy/gTmpLmjK4nqpx+VzcMnZ/8Ce3Gn0jwS vaaA== X-Gm-Message-State: AOAM532/87H7FizeMJEtGWLwe4AzUrlLAeHbBkpaXhdHIdpar235W3FH AxB6BJ7C+X92LieEi/A4WIXKy2IJoGA= X-Google-Smtp-Source: ABdhPJzWmAqyjlQzMukTfKEhnSUO5KEVZ4YPngPpVUScz59fCbga+sAyJdau/FT88sASqNnoOCePoA== X-Received: by 2002:a05:600c:b47:: with SMTP id k7mr16017437wmr.155.1626516610362; Sat, 17 Jul 2021 03:10:10 -0700 (PDT) From: Mahmoud Mandour To: qemu-devel@nongnu.org Subject: [PATCH 01/13] plugins: allow plugin arguments to be passed directly Date: Sat, 17 Jul 2021 12:09:08 +0200 Message-Id: <20210717100920.240793-2-ma.mandourr@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210717100920.240793-1-ma.mandourr@gmail.com> References: <20210717100920.240793-1-ma.mandourr@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=ma.mandourr@gmail.com; helo=mail-wm1-x32c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mahmoud Mandour , cota@braap.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Laurent Vivier Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1626516722225100005 Content-Type: text/plain; charset="utf-8" Passing arguments to plugins had to be done through "arg=3D". This is redundant and introduces confusion especially when the argument has a name and value (e.g. `-plugin plugin_name,arg=3D"argname=3Dargvalue"`= ). This allows passing plugin arguments directly e.g: `-plugin plugin_name,argname=3Dargvalue` For now, passing arguments through "arg=3D" is still supports but outputs a deprecation warning. Also, this commit makes boolean arguments passed to plugins in the `argname=3Don|off` form instead of the deprecated short-boolean form. Signed-off-by: Mahmoud Mandour Reviewed-by: Alex Benn=C3=A9e Tested-by: Alex Benn=C3=A9e --- linux-user/main.c | 2 +- plugins/loader.c | 24 ++++++++++++++++++++---- qemu-options.hx | 9 ++++----- 3 files changed, 25 insertions(+), 10 deletions(-) diff --git a/linux-user/main.c b/linux-user/main.c index 4dfc47ad3b..d47f78132c 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -462,7 +462,7 @@ static const struct qemu_argument arg_table[] =3D { "", "[[enable=3D]][,events=3D][,file=3D]"}, #ifdef CONFIG_PLUGIN {"plugin", "QEMU_PLUGIN", true, handle_arg_plugin, - "", "[file=3D][,arg=3D]"}, + "", "[file=3D][,=3D]"}, #endif {"version", "QEMU_VERSION", false, handle_arg_version, "", "display version information and exit"}, diff --git a/plugins/loader.c b/plugins/loader.c index 05df40398d..a4ec281692 100644 --- a/plugins/loader.c +++ b/plugins/loader.c @@ -94,6 +94,8 @@ static int plugin_add(void *opaque, const char *name, con= st char *value, { struct qemu_plugin_parse_arg *arg =3D opaque; struct qemu_plugin_desc *p; + bool is_on; + char *fullarg; =20 if (strcmp(name, "file") =3D=3D 0) { if (strcmp(value, "") =3D=3D 0) { @@ -107,18 +109,32 @@ static int plugin_add(void *opaque, const char *name,= const char *value, QTAILQ_INSERT_TAIL(arg->head, p, entry); } arg->curr =3D p; - } else if (strcmp(name, "arg") =3D=3D 0) { + } else { if (arg->curr =3D=3D NULL) { error_setg(errp, "missing earlier '-plugin file=3D' option"); return 1; } + + if (g_strcmp0(name, "arg") =3D=3D 0 && + !qapi_bool_parse(name, value, &is_on, NULL)) { + if (strchr(value, '=3D') =3D=3D NULL) { + /* Will treat arg=3D"argname" as "argname=3Don" */ + fullarg =3D g_strdup_printf("%s=3D%s", value, "on"); + } else { + fullarg =3D g_strdup_printf("%s", value); + } + warn_report("using 'arg=3D%s' is deprecated", value); + error_printf("Please use '%s' directly\n", fullarg); + } else { + fullarg =3D g_strdup_printf("%s=3D%s", name, value); + } + p =3D arg->curr; p->argc++; p->argv =3D g_realloc_n(p->argv, p->argc, sizeof(char *)); - p->argv[p->argc - 1] =3D g_strdup(value); - } else { - error_setg(errp, "-plugin: unexpected parameter '%s'; ignored", na= me); + p->argv[p->argc - 1] =3D fullarg; } + return 0; } =20 diff --git a/qemu-options.hx b/qemu-options.hx index 14258784b3..36b6cb9a2f 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -4459,19 +4459,18 @@ SRST =20 ERST DEF("plugin", HAS_ARG, QEMU_OPTION_plugin, - "-plugin [file=3D][,arg=3D]\n" + "-plugin [file=3D][,=3D]\n" " load a plugin\n", QEMU_ARCH_ALL) SRST -``-plugin file=3Dfile[,arg=3Dstring]`` +``-plugin file=3Dfile[,argname=3Dargvalue]`` Load a plugin. =20 ``file=3Dfile`` Load the given plugin from a shared library file. =20 - ``arg=3Dstring`` - Argument string passed to the plugin. (Can be given multiple - times.) + ``argname=3Dargvalue`` + Argument passed to the plugin. (Can be given multiple times.) ERST =20 HXCOMM Internal use --=20 2.25.1 From nobody Sun May 12 00:34:05 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1626516851061639.0688728243466; Sat, 17 Jul 2021 03:14:11 -0700 (PDT) Received: from localhost ([::1]:41192 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m4hKj-0007Zv-Ma for importer@patchew.org; Sat, 17 Jul 2021 06:14:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35646) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m4hH1-0007hR-PU for qemu-devel@nongnu.org; Sat, 17 Jul 2021 06:10:19 -0400 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]:39476) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m4hGv-0007Rs-Kf for qemu-devel@nongnu.org; Sat, 17 Jul 2021 06:10:19 -0400 Received: by mail-wm1-x332.google.com with SMTP id l18-20020a1ced120000b029014c1adff1edso9662304wmh.4 for ; Sat, 17 Jul 2021 03:10:12 -0700 (PDT) Received: from localhost.localdomain ([41.34.125.69]) by smtp.gmail.com with ESMTPSA id 11sm13846923wmo.10.2021.07.17.03.10.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Jul 2021 03:10:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=JANcPX6qN4kluZ0AAfHgg+gmdeQLyrKh5r/cIUARSqU=; b=MdnhDqzYfsbRjLozoI2ALbM0QFarYfBEBbxy/dcvBeEJQ9FcgoosF7vz3wAqmEm0FP AMXc4KDKxxqR3Q7BpyWgYxiffPKeRbm9vySgZB1ohmyJAk5YnL5DnZShgcF4RHj17p38 fdcPph0GqmQ3/Q+nuuaEj6tDnayVd6ChBXsgPINmiruZnmJbsmfFCIRfhmCQY8By8JFh jcoEcud9Qevak7ChLnfX+2mJtO69arlAtwjUnzcRE7rs9Eo+G6riZ9fjeVMqcgs5aNuh jmcCLbUKe5c/hn9eqeGotDjdJQ8yiU48gETSxvcZVfuDCTLjH2zkYl3szuTi5qSqppW0 HzFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=JANcPX6qN4kluZ0AAfHgg+gmdeQLyrKh5r/cIUARSqU=; b=Yh9X3hxL3ORa4bjUB5I+WpXWjrBWv1eoTquYtvUzweejuODuFQSWBx1Pd1jeTGU0P6 rLHLEjWvhBE2sDt7NVk3cehoeS+cPMbb627p3fJ7WeM7rVPqyb1g4T2QLtxoK5iHZ3Z4 HBy8+Y9gbcJ0wgd8bixGFxNL/+ETD08GSTI53CfUzap1MNQuHL3AiGceAkPGaocldYPk G4qyMSLXlDr9GqR7drFymeVu+Ni7lMoTeT4reUUEdNDnZES6g4Yoh2Ch4exkhkz7BYeZ ADxFVPs93P+liPLYLF13fwd6lassnxXqCTwyxQFFsgarfC1Muvuh2Krc7/uy+O9y6b4p vZhw== X-Gm-Message-State: AOAM5301axQ/ZOeinjpuYejoNIbao/yrrjK/RRUPDVQAhstmNZiqhfyE FNNDE0XXkPDhwNSqoeJWgT3Aq8dEKOY= X-Google-Smtp-Source: ABdhPJxda4B+L7ZlHjcRayXNMAe/CYT8qjzTODEDP1MTWjWn59/unF5XwPvNrMy+IDEAd0aSVNprqA== X-Received: by 2002:a05:600c:5106:: with SMTP id o6mr21271152wms.18.1626516611580; Sat, 17 Jul 2021 03:10:11 -0700 (PDT) From: Mahmoud Mandour To: qemu-devel@nongnu.org Subject: [PATCH 02/13] plugins/api: added a boolean parsing plugin api Date: Sat, 17 Jul 2021 12:09:09 +0200 Message-Id: <20210717100920.240793-3-ma.mandourr@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210717100920.240793-1-ma.mandourr@gmail.com> References: <20210717100920.240793-1-ma.mandourr@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=ma.mandourr@gmail.com; helo=mail-wm1-x332.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mahmoud Mandour , cota@braap.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1626516852024100001 Content-Type: text/plain; charset="utf-8" This call will help boolean argument parsing since arguments are now passed to plugins as a name and value. Signed-off-by: Mahmoud Mandour --- include/qemu/qemu-plugin.h | 13 +++++++++++++ plugins/api.c | 5 +++++ 2 files changed, 18 insertions(+) diff --git a/include/qemu/qemu-plugin.h b/include/qemu/qemu-plugin.h index dc3496f36c..7d0b23c659 100644 --- a/include/qemu/qemu-plugin.h +++ b/include/qemu/qemu-plugin.h @@ -564,4 +564,17 @@ int qemu_plugin_n_max_vcpus(void); */ void qemu_plugin_outs(const char *string); =20 +/** + * qemu_plugin_bool_parse() - parses a boolean argument in the form of + * "=3D[on|yes|true|off|no|false]" + * + * @name: argument name, the part before the equals sign + * @val: argument value, what's after the equals sign + * @ret: output return value + * + * returns true if the combination @name=3D@val parses correctly to a bool= ean + * argument, and false otherwise + */ +bool qemu_plugin_bool_parse(const char *name, const char *val, bool *ret); + #endif /* QEMU_PLUGIN_API_H */ diff --git a/plugins/api.c b/plugins/api.c index 332e2c60e2..43e239f377 100644 --- a/plugins/api.c +++ b/plugins/api.c @@ -383,3 +383,8 @@ void qemu_plugin_outs(const char *string) { qemu_log_mask(CPU_LOG_PLUGIN, "%s", string); } + +bool qemu_plugin_bool_parse(const char *name, const char *value, bool *ret) +{ + return qapi_bool_parse(name, value, ret, NULL); +} --=20 2.25.1 From nobody Sun May 12 00:34:05 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 162651685184880.07395449694377; Sat, 17 Jul 2021 03:14:11 -0700 (PDT) Received: from localhost ([::1]:41222 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m4hKk-0007bf-Ht for importer@patchew.org; Sat, 17 Jul 2021 06:14:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35712) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m4hH4-0007mC-Mb for qemu-devel@nongnu.org; Sat, 17 Jul 2021 06:10:22 -0400 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]:34511) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m4hH0-0007T4-AM for qemu-devel@nongnu.org; Sat, 17 Jul 2021 06:10:22 -0400 Received: by mail-wm1-x336.google.com with SMTP id u5-20020a7bc0450000b02901480e40338bso8240913wmc.1 for ; Sat, 17 Jul 2021 03:10:13 -0700 (PDT) Received: from localhost.localdomain ([41.34.125.69]) by smtp.gmail.com with ESMTPSA id 11sm13846923wmo.10.2021.07.17.03.10.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Jul 2021 03:10:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=iHWdTeXytxUpcVqwmVfY5I5RkS0svkvZBXW0tynmbow=; b=N4RV91Q4WtDPU8nmLmh3PavxKgpfKwSO7MiTYWQlyDI+RjsMX9CCtWu3s6/xWWzvGc 0WUzLnyIAMJLn11Dn9vDsJ4hDoADeiM01uD/MzW2ie3OIMM1ia3eU5ARFqOZpxiXa7NE 4UEm2ROQTXeHLsmu0PmqHz3zVhxICsM4I6MATIX+QH1LwmR57e5h6r3B4+rNazvDZlbI soxsMHPxWnxMZyMzuWxPOxeqbyzSdVEqh2Gxcb+ZcQ+dgM49Wpaqk2RjOCOYeq/yH4Gd pKThUMi+P8s80EfyKBSekrnu/EvitfBiPD9My9AQqlv1PL4gvp+0EqYhBMr0tae24xkt IV0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=iHWdTeXytxUpcVqwmVfY5I5RkS0svkvZBXW0tynmbow=; b=BE65PkJyIbT0ngKSmu+O+pHUgo2aKU/qomL3ZYNkI0+bpeGb5kYJwJPBhCuHAnpEQg 8hOq5E2j3QOnXlvygnjcC7HOPsb34Pu3JpLGSHkoNQuxQElZdvJfyL1YqUAF8r/A4UG7 3Npx6Xip8Czw8XFS72Qmj6sxH6JiM0GrRgTP+ABf1RfykRjwjg/GTsWeEP8iv18GGIV/ Z3jFp2Pq4SV9lgl218JmiGXUqainDj9msqI3XUWmL8JFWRRJsyI8L7KhBXOmZTr2D5jX ANzw8GjCVXmmAla/iUF0D1ORs8N/T8D/cPIIzzIU5RdA/PnA5oFw0SERYmnxZ7JNPNHp 7qCA== X-Gm-Message-State: AOAM530twelpuxK1ZUdbKIW3WRTuVzXfmUBX06pD4iRYCUWQLQhJROfh hCIfwR67H3cEeKXHhMrmVDw/Z9XkRsw= X-Google-Smtp-Source: ABdhPJywWOuhkM5aSG3anlvjYRBOsT83lrjXO1o6WXMGaLDB3p9AxZrPX2EKf7xDb2fAboefEvpcjA== X-Received: by 2002:a1c:1f8a:: with SMTP id f132mr15199592wmf.56.1626516612642; Sat, 17 Jul 2021 03:10:12 -0700 (PDT) From: Mahmoud Mandour To: qemu-devel@nongnu.org Subject: [PATCH 03/13] plugins/hotpages: introduce sortby arg and parsed bool args correctly Date: Sat, 17 Jul 2021 12:09:10 +0200 Message-Id: <20210717100920.240793-4-ma.mandourr@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210717100920.240793-1-ma.mandourr@gmail.com> References: <20210717100920.240793-1-ma.mandourr@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=ma.mandourr@gmail.com; helo=mail-wm1-x336.google.com X-Spam_score_int: -1 X-Spam_score: -0.2 X-Spam_bar: / X-Spam_report: (-0.2 / 5.0 requ) DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mahmoud Mandour , cota@braap.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1626516853966100003 Content-Type: text/plain; charset="utf-8" Since plugin arguments now expect boolean arguments, a plugin argument name "sortby" now expects a value of "read", "write", or "address". "io" arg is now expected to be passed as a full-form boolean parameter, i.e. "io=3Don|true|yes|off|false|no" Signed-off-by: Mahmoud Mandour Reviewed-by: Alex Benn=C3=A9e --- contrib/plugins/hotpages.c | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/contrib/plugins/hotpages.c b/contrib/plugins/hotpages.c index bf53267532..0d12910af6 100644 --- a/contrib/plugins/hotpages.c +++ b/contrib/plugins/hotpages.c @@ -169,16 +169,26 @@ int qemu_plugin_install(qemu_plugin_id_t id, const qe= mu_info_t *info, =20 for (i =3D 0; i < argc; i++) { char *opt =3D argv[i]; - if (g_strcmp0(opt, "reads") =3D=3D 0) { - sort_by =3D SORT_R; - } else if (g_strcmp0(opt, "writes") =3D=3D 0) { - sort_by =3D SORT_W; - } else if (g_strcmp0(opt, "address") =3D=3D 0) { - sort_by =3D SORT_A; - } else if (g_strcmp0(opt, "io") =3D=3D 0) { - track_io =3D true; - } else if (g_str_has_prefix(opt, "pagesize=3D")) { - page_size =3D g_ascii_strtoull(opt + 9, NULL, 10); + g_autofree char **tokens =3D g_strsplit(opt, "=3D", -1); + + if (g_strcmp0(tokens[0], "sortby") =3D=3D 0) { + if (g_strcmp0(tokens[1], "reads") =3D=3D 0) { + sort_by =3D SORT_R; + } else if (g_strcmp0(tokens[1], "writes") =3D=3D 0) { + sort_by =3D SORT_W; + } else if (g_strcmp0(tokens[1], "address") =3D=3D 0) { + sort_by =3D SORT_A; + } else { + fprintf(stderr, "invalid value to sortby: %s\n", tokens[1]= ); + return -1; + } + } else if (g_strcmp0(tokens[0], "io") =3D=3D 0) { + if (!qemu_plugin_bool_parse(tokens[0], tokens[1], &track_io)) { + fprintf(stderr, "boolean argument parsing failed: %s\n", o= pt); + return -1; + } + } else if (g_strcmp0(tokens[0], "pagesize") =3D=3D 0) { + page_size =3D g_ascii_strtoull(tokens[1], NULL, 10); } else { fprintf(stderr, "option parsing failed: %s\n", opt); return -1; --=20 2.25.1 From nobody Sun May 12 00:34:05 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1626517162838680.2224132040147; Sat, 17 Jul 2021 03:19:22 -0700 (PDT) Received: from localhost ([::1]:58178 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m4hPl-00023f-My for importer@patchew.org; Sat, 17 Jul 2021 06:19:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35708) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m4hH4-0007lm-IC for qemu-devel@nongnu.org; Sat, 17 Jul 2021 06:10:22 -0400 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]:39665) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m4hH0-0007TR-AR for qemu-devel@nongnu.org; Sat, 17 Jul 2021 06:10:22 -0400 Received: by mail-wr1-x433.google.com with SMTP id f17so14984839wrt.6 for ; Sat, 17 Jul 2021 03:10:14 -0700 (PDT) Received: from localhost.localdomain ([41.34.125.69]) by smtp.gmail.com with ESMTPSA id 11sm13846923wmo.10.2021.07.17.03.10.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Jul 2021 03:10:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=qWN2HIRs01eKm6dhCHQnthOBil+q+4JpNVw/kRffS9E=; b=D8Rd1wtV9jDH3ODltaV8pm7t/cjt6cgrOEn35a1lSGPUy1jhVKtZPcSVfRR9z3F3Z8 ytSOPOf5y3Qq9NkRry4sgvzpxNhwNllRClWVx5Mxg0A+JupujooLNWiaIlZp5B35ueJa lc/z6p29oCjYlBHOM6QNYomdRNU6Hp6olb+cz0nhX4GQbCGjcfBzGpRGjzLJKyoXZilF l/5Foc+c1+MYecQEmQ/HeVLpMJYMZ+Qw+FubSDuQ+qm8rhrQvlnXq3mk2mpqtHkNpJ58 +0yRJ5ksd3vVds4sWr10XtbxkhtHiQnjWH6iC1DElmqaxBNU1lLmZDrGxjMNquqMOuWQ NSBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=qWN2HIRs01eKm6dhCHQnthOBil+q+4JpNVw/kRffS9E=; b=Q0KsNeUbtSw6ABIJVgoX33j+d8qlwwt43wfXeXZ8SgM9Qo/Ef8ltB9qheojFVlrXkM ib4vwZf/DXArVm2wXigz/7zfbRYrwcpWyJEsot+sBtxbHCwQiPzcji3qDLsl/8twtXC8 X9LyiJ8TjnmLoj2X82zOqkkz9xNZS3x/3bD+5c+GxEMkuHJNm6Ff3v+Q5n+qMQkEUIaG MLfYFMjhiU2s2topU7bQWUEsVw2gqvTSSHaYgkcW2z/I8BTLUO1d6H3mHZ5tk9dDmwoS U8qhXN+5nDD0Vxx4exL+TpHNJiaQ1MtYNFhKvodM1hxWGEZiaAf4lgFZa9SMJdKddbgi lpyg== X-Gm-Message-State: AOAM53051Lwil8Cgfcn7XNtCVKW8T0Q4t205oo/evIemxwJqna+5pGCG i29+ewZeh/EAvr2mntsbmsoPV2rv01A= X-Google-Smtp-Source: ABdhPJwyeCsSFZl3e5c//9b0Lm2GtOIeFLhkpZ08jv8JlhcPAfuS8esqXGsK62z2GtFxUR6ukaib3Q== X-Received: by 2002:a5d:4d01:: with SMTP id z1mr17628099wrt.34.1626516613711; Sat, 17 Jul 2021 03:10:13 -0700 (PDT) From: Mahmoud Mandour To: qemu-devel@nongnu.org Subject: [PATCH 04/13] plugins/hotblocks: Added correct boolean argument parsing Date: Sat, 17 Jul 2021 12:09:11 +0200 Message-Id: <20210717100920.240793-5-ma.mandourr@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210717100920.240793-1-ma.mandourr@gmail.com> References: <20210717100920.240793-1-ma.mandourr@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::433; envelope-from=ma.mandourr@gmail.com; helo=mail-wr1-x433.google.com X-Spam_score_int: -1 X-Spam_score: -0.2 X-Spam_bar: / X-Spam_report: (-0.2 / 5.0 requ) DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mahmoud Mandour , cota@braap.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1626517163063100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Mahmoud Mandour Reviewed-by: Alex Benn=C3=A9e --- contrib/plugins/hotblocks.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/contrib/plugins/hotblocks.c b/contrib/plugins/hotblocks.c index 4b08340143..062200a7a4 100644 --- a/contrib/plugins/hotblocks.c +++ b/contrib/plugins/hotblocks.c @@ -133,8 +133,18 @@ QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin_id_t id, const qemu_info_t *info, int argc, char **argv) { - if (argc && strcmp(argv[0], "inline") =3D=3D 0) { - do_inline =3D true; + for (int i =3D 0; i < argc; i++) { + char *opt =3D argv[i]; + g_autofree char **tokens =3D g_strsplit(opt, "=3D", 2); + if (g_strcmp0(tokens[0], "inline") =3D=3D 0) { + if (!qemu_plugin_bool_parse(tokens[0], tokens[1], &do_inline))= { + fprintf(stderr, "boolean argument parsing failed: %s\n", o= pt); + return -1; + } + } else { + fprintf(stderr, "option parsing failed: %s\n", opt); + return -1; + } } =20 plugin_init(); --=20 2.25.1 From nobody Sun May 12 00:34:05 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1626517271311464.9262640215676; Sat, 17 Jul 2021 03:21:11 -0700 (PDT) Received: from localhost ([::1]:35672 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m4hRW-0005xw-9h for importer@patchew.org; Sat, 17 Jul 2021 06:21:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35728) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m4hH5-0007ps-PC for qemu-devel@nongnu.org; Sat, 17 Jul 2021 06:10:24 -0400 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]:53987) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m4hH0-0007UL-Ok for qemu-devel@nongnu.org; Sat, 17 Jul 2021 06:10:23 -0400 Received: by mail-wm1-x32a.google.com with SMTP id w13so7272706wmc.3 for ; Sat, 17 Jul 2021 03:10:15 -0700 (PDT) Received: from localhost.localdomain ([41.34.125.69]) by smtp.gmail.com with ESMTPSA id 11sm13846923wmo.10.2021.07.17.03.10.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Jul 2021 03:10:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=uxSIlbrXoEWYH1V4OiwJbAMOptfvw4FTT6WZRqT5wuA=; b=HYCwDRjw8QXrPz/Trps87tznw7igo5cNd3bwXc5ggm8IzG35ARJ1+Yx2jFDssGSOt6 4DLoohzMBUQwDTo47yT94wtAGgsk6MgvcIPtqTxtE+wygBGQcoSkgyBseVnMDrdNmNxI 0hQCie01+0OCfkmvCJks8scOWUitZumYpXm7BU0stXv6pNEjmwQj7nSh9ERqaxlTE5Qk FXNOTlZS/JBcWQAsxsU38hBYoGlcI4vYcqwxWihLDZtLcRo+fko83/PQr2aiZ9XIVKQt an96IXaEVSma2U/siX8aNwEWuicGjEk4YGIQ1JoImW7gWEdgZZa+p8lFS1bS+qnW514j 8XgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=uxSIlbrXoEWYH1V4OiwJbAMOptfvw4FTT6WZRqT5wuA=; b=GlyfAA0Liyov0VFWmkdMZHOeZu0bt6u4W7olrIOcN57aC/mFEJ3T+AvXwf/PTJ3Q89 tz09ZFJbEQNjedwCphy9891+62NvDBgYaNAiwBPrJtJ+CUGH57uKqzRSiowM4DiE7cuZ hkqtiiXkczBOC8/2Dftn21avZRlICjI4+aGCQwkp+qM094oniCpOQoZQWLFpTADMEuGg mKHqPmwko88m5FKaAj9MjMfDVkwgc9xD59hSoN6Q+qM9iTTKu6H9YdDaVnGVPVO932Iw M9ysc0EpspMro8GUc1rrHGr/0wHxeyXj+w1t160SPSnaVlnStH+UKvpjlIpn4ykmxofb Qv0A== X-Gm-Message-State: AOAM5306yyYODP0xMiba1lXGgzcH6QPDWJfmL5sXWxiLnSRpHC4j0e1f EZ67w5IcghKsR5hf5/hKBxyOFYcanE8= X-Google-Smtp-Source: ABdhPJymQ/Xx57UDIBPtkkqkDDQKH1B+yGgjW9X1CkJLzCAXfTj7P2Y1CRd5Fzy08mTOInimD1wTgA== X-Received: by 2002:a1c:62c4:: with SMTP id w187mr15528769wmb.27.1626516614871; Sat, 17 Jul 2021 03:10:14 -0700 (PDT) From: Mahmoud Mandour To: qemu-devel@nongnu.org Subject: [PATCH 05/13] plugins/lockstep: make socket path not positional & parse bool arg Date: Sat, 17 Jul 2021 12:09:12 +0200 Message-Id: <20210717100920.240793-6-ma.mandourr@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210717100920.240793-1-ma.mandourr@gmail.com> References: <20210717100920.240793-1-ma.mandourr@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=ma.mandourr@gmail.com; helo=mail-wm1-x32a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mahmoud Mandour , cota@braap.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1626517281970100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Mahmoud Mandour Reviewed-by: Alex Benn=C3=A9e --- contrib/plugins/lockstep.c | 31 ++++++++++++++++++++++--------- docs/devel/tcg-plugins.rst | 2 +- 2 files changed, 23 insertions(+), 10 deletions(-) diff --git a/contrib/plugins/lockstep.c b/contrib/plugins/lockstep.c index 7fd35eb669..a41ffe83fa 100644 --- a/contrib/plugins/lockstep.c +++ b/contrib/plugins/lockstep.c @@ -319,22 +319,35 @@ QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugi= n_id_t id, int argc, char **argv) { int i; - - if (!argc || !argv[0]) { - qemu_plugin_outs("Need a socket path to talk to other instance."); - return -1; - } + g_autofree char *sock_path =3D NULL; =20 for (i =3D 0; i < argc; i++) { char *p =3D argv[i]; - if (strcmp(p, "verbose") =3D=3D 0) { - verbose =3D true; - } else if (!setup_unix_socket(argv[0])) { - qemu_plugin_outs("Failed to setup socket for communications."); + g_autofree char **tokens =3D g_strsplit(p, "=3D", 2); + + if (g_strcmp0(tokens[0], "verbose") =3D=3D 0) { + if (!qemu_plugin_bool_parse(tokens[0], tokens[1], &verbose)) { + fprintf(stderr, "boolean argument parsing failed: %s\n", p= ); + return -1; + } + } else if (g_strcmp0(tokens[0], "sockpath") =3D=3D 0) { + sock_path =3D tokens[1]; + } else { + fprintf(stderr, "option parsing failed: %s\n", p); return -1; } } =20 + if (sock_path =3D=3D NULL) { + fprintf(stderr, "Need a socket path to talk to other instance.\n"); + return -1; + } + + if (!setup_unix_socket(sock_path)) { + fprintf(stderr, "Failed to setup socket for communications.\n"); + return -1; + } + our_id =3D id; =20 qemu_plugin_register_vcpu_tb_trans_cb(id, vcpu_tb_trans); diff --git a/docs/devel/tcg-plugins.rst b/docs/devel/tcg-plugins.rst index 370c11373f..6ddf9c28c0 100644 --- a/docs/devel/tcg-plugins.rst +++ b/docs/devel/tcg-plugins.rst @@ -270,7 +270,7 @@ communicate over:: =20 ./sparc-softmmu/qemu-system-sparc -monitor none -parallel none \ -net none -M SS-20 -m 256 -kernel day11/zImage.elf \ - -plugin ./contrib/plugins/liblockstep.so,arg=3Dlockstep-sparc.sock \ + -plugin ./contrib/plugins/liblockstep.so,sockpath=3Dlockstep-sparc.soc= k \ -d plugin,nochain =20 which will eventually report:: --=20 2.25.1 From nobody Sun May 12 00:34:05 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1626516722251601.0688788952366; Sat, 17 Jul 2021 03:12:02 -0700 (PDT) Received: from localhost ([::1]:32980 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m4hIf-0002BU-4T for importer@patchew.org; Sat, 17 Jul 2021 06:12:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35668) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m4hH3-0007iw-B7 for qemu-devel@nongnu.org; Sat, 17 Jul 2021 06:10:21 -0400 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]:45684) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m4hH0-0007V3-A3 for qemu-devel@nongnu.org; Sat, 17 Jul 2021 06:10:21 -0400 Received: by mail-wm1-x329.google.com with SMTP id u8-20020a7bcb080000b02901e44e9caa2aso7331989wmj.4 for ; Sat, 17 Jul 2021 03:10:17 -0700 (PDT) Received: from localhost.localdomain ([41.34.125.69]) by smtp.gmail.com with ESMTPSA id 11sm13846923wmo.10.2021.07.17.03.10.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Jul 2021 03:10:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=FX5v+BKehc6DaRJmhosDluKPZkJTepgwovTu+vU/T/Y=; b=uI3O9EGpvIUat1xfE3SJZXbWGTOUjp9gsVXUPK+vjQdwnN26hqQ3+cttc3JLYPZ/zg IUg1H1EvEx4BotY/VxWSr4dA1Py1Pzx5omWJ7rKZLc3doxuhBdEExTB+F36GMZLEf8n1 M2OotL0/Hmpvxt32bvUOMQuXRpTVEDk5RUi+x3fZZ0MF3xKZ3WdpApLQJ5w2B9hSKnZk DssdbxAJe8sjgn6xErlZNt2TgoFRmNZVfmuOdafgZblg221RxEUmmhS6MTBEm8TCnMj4 74OMo0kzg9JJ3wfPizvM/wET3frsoyYOjqGhPmiQpD2G7T3sRmh+FlYrndK9YT1ev+YE 2m8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=FX5v+BKehc6DaRJmhosDluKPZkJTepgwovTu+vU/T/Y=; b=jucxTG3OtGAYVc7L4U8gK47GxG1QU+CFAYQiiLejzP8P9ZsTbyWUlNbgxXe7iSb/oy 6EMHqwbdzLHHA5N2Z1r5MRwxHZDXBZE03/qCVOcuddMa34zrw7CpHSdl3FJNMwfdITif GkxjyhKkMM9d1+4RV6gE+0IcQFs8l40j+zCbgwshzxg3NuEfAb9lqAUCRHuE0swqJuge HHwDO93OIBx77UwsgUcKSHNTGigKZIGg8/h6hdTmUJsWuP03aD+vKfzpynCsBD2gEEh4 t3XMBrOFnEwADwsmWsrkP5a90eKVoWcw189uEu5yd06rFuGXSytlQaIwRNlSF9MYPVPJ 6fBQ== X-Gm-Message-State: AOAM5318o0kieieWpI7vr7Ep35w0Y5XpCOThbXunImC0QtfvorblnYaW zkWgwB+XuoJyVivept4E/4XQohnosGI= X-Google-Smtp-Source: ABdhPJzIE9vDEHS21n7MA2v/+Rqp54fXBXUuac1iK0c8NMzGsPEggGDkB8H/YnizRJGHiZigehj8TQ== X-Received: by 2002:a7b:c7cb:: with SMTP id z11mr21659136wmk.102.1626516616067; Sat, 17 Jul 2021 03:10:16 -0700 (PDT) From: Mahmoud Mandour To: qemu-devel@nongnu.org Subject: [PATCH 06/13] plugins/hwprofile: adapt to the new plugin arguments scheme Date: Sat, 17 Jul 2021 12:09:13 +0200 Message-Id: <20210717100920.240793-7-ma.mandourr@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210717100920.240793-1-ma.mandourr@gmail.com> References: <20210717100920.240793-1-ma.mandourr@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=ma.mandourr@gmail.com; helo=mail-wm1-x329.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mahmoud Mandour , cota@braap.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1626516724164100007 Content-Type: text/plain; charset="utf-8" Parsing boolean arguments correctly (e.g. pattern=3Don or source=3Dfalse). Introduced a new "track" argument that takes a [read|write] value. This substitutes passing read or write to "arg=3D" that is deprecated. Also, matches are now taken one by one through the "match" argument. Signed-off-by: Mahmoud Mandour --- contrib/plugins/hwprofile.c | 39 +++++++++++++++++++++++++------------ docs/devel/tcg-plugins.rst | 8 ++++---- 2 files changed, 31 insertions(+), 16 deletions(-) diff --git a/contrib/plugins/hwprofile.c b/contrib/plugins/hwprofile.c index faf216ac00..691d4edb0c 100644 --- a/contrib/plugins/hwprofile.c +++ b/contrib/plugins/hwprofile.c @@ -259,27 +259,42 @@ int qemu_plugin_install(qemu_plugin_id_t id, const qe= mu_info_t *info, int argc, char **argv) { int i; + g_autoptr(GString) matches_raw =3D g_string_new(""); =20 for (i =3D 0; i < argc; i++) { char *opt =3D argv[i]; - if (g_strcmp0(opt, "read") =3D=3D 0) { - rw =3D QEMU_PLUGIN_MEM_R; - } else if (g_strcmp0(opt, "write") =3D=3D 0) { - rw =3D QEMU_PLUGIN_MEM_W; - } else if (g_strcmp0(opt, "pattern") =3D=3D 0) { - pattern =3D true; - } else if (g_strcmp0(opt, "source") =3D=3D 0) { - source =3D true; - } else if (g_str_has_prefix(opt, "match")) { - gchar **parts =3D g_strsplit(opt, "=3D", 2); + g_autofree char **tokens =3D g_strsplit(opt, "=3D", 2); + + if (g_strcmp0(tokens[0], "track") =3D=3D 0) { + if (g_strcmp0(tokens[1], "read") =3D=3D 0) { + rw =3D QEMU_PLUGIN_MEM_R; + } else if (g_strcmp0(tokens[1], "write") =3D=3D 0) { + rw =3D QEMU_PLUGIN_MEM_W; + } else { + fprintf(stderr, "invalid value for track: %s\n", tokens[1]= ); + return -1; + } + } else if (g_strcmp0(tokens[0], "pattern") =3D=3D 0) { + if (!qemu_plugin_bool_parse(tokens[0], tokens[1], &pattern)) { + fprintf(stderr, "boolean argument parsing failed: %s\n", o= pt); + return -1; + } + } else if (g_strcmp0(tokens[0], "source") =3D=3D 0) { + if (!qemu_plugin_bool_parse(tokens[0], tokens[1], &source)) { + fprintf(stderr, "boolean argument parsing failed: %s\n", o= pt); + return -1; + } + } else if (g_strcmp0(tokens[0], "match") =3D=3D 0) { check_match =3D true; - matches =3D g_strsplit(parts[1], ",", -1); - g_strfreev(parts); + g_string_append_printf(matches_raw, "%s,", tokens[1]); } else { fprintf(stderr, "option parsing failed: %s\n", opt); return -1; } } + if (check_match) { + matches =3D g_strsplit(matches_raw->str, ",", -1); + } =20 if (source && pattern) { fprintf(stderr, "can only currently track either source or pattern= .\n"); diff --git a/docs/devel/tcg-plugins.rst b/docs/devel/tcg-plugins.rst index 6ddf9c28c0..753f56ac42 100644 --- a/docs/devel/tcg-plugins.rst +++ b/docs/devel/tcg-plugins.rst @@ -290,22 +290,22 @@ which will eventually report:: The hwprofile tool can only be used with system emulation and allows the user to see what hardware is accessed how often. It has a number of op= tions: =20 - * arg=3Dread or arg=3Dwrite + * track=3Dread or track=3Dwrite =20 By default the plugin tracks both reads and writes. You can use one of these options to limit the tracking to just one class of accesses. =20 - * arg=3Dsource + * source =20 Will include a detailed break down of what the guest PC that made the - access was. Not compatible with arg=3Dpattern. Example output:: + access was. Not compatible with the pattern option. Example output:: =20 cirrus-low-memory @ 0xfffffd00000a0000 pc:fffffc0000005cdc, 1, 256 pc:fffffc0000005ce8, 1, 256 pc:fffffc0000005cec, 1, 256 =20 - * arg=3Dpattern + * pattern =20 Instead break down the accesses based on the offset into the HW region. This can be useful for seeing the most used registers of a --=20 2.25.1 From nobody Sun May 12 00:34:05 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1626516999443306.102667287328; Sat, 17 Jul 2021 03:16:39 -0700 (PDT) Received: from localhost ([::1]:49646 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m4hN7-0004kq-LR for importer@patchew.org; Sat, 17 Jul 2021 06:16:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35682) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m4hH3-0007jd-Me for qemu-devel@nongnu.org; Sat, 17 Jul 2021 06:10:21 -0400 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]:47076) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m4hH0-0007Vj-Ox for qemu-devel@nongnu.org; Sat, 17 Jul 2021 06:10:21 -0400 Received: by mail-wm1-x32a.google.com with SMTP id o30-20020a05600c511eb029022e0571d1a0so7321828wms.5 for ; Sat, 17 Jul 2021 03:10:18 -0700 (PDT) Received: from localhost.localdomain ([41.34.125.69]) by smtp.gmail.com with ESMTPSA id 11sm13846923wmo.10.2021.07.17.03.10.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Jul 2021 03:10:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=L3uilAactmUVXaG+kWGEGWQRYTQSIn+v/+hdU9qLmVY=; b=cINzWvNXFW83yRV6d+ZWKPGJAxGBm7tpE2XrgUvX2sDXcdoLxyXHYK7lX3AHbryiY6 4cVQ59Z5CDvJRFdompMMzv9K2e6qM5EjitJxDcUb7zCORbFSrFTvjNRbGS6xr/BxvaLv It/g8MDHMmdj0LEy8oXyD1ufjLl23znQdCeeLE5sZma6k74J7UCZ7SkbCF2perHiwqre atFmlMTL5rDrHPdwLYcifhjJApc0ddxVAQsTj/bm8/36SXcs7cWxtcFD+1GdP/aI6WBq 9GXSs+LkOYybXTtsNVDYPQJBamMnK487fFRcQMOdOLJI2X8tC248/sJpH/cQr0EDq/8s 6njg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=L3uilAactmUVXaG+kWGEGWQRYTQSIn+v/+hdU9qLmVY=; b=XEF6JwdaLuyxxgeiSRgk4Eu19uM72rvPzlEQqqX0JkQEcWD1vs9MOYVvju3j2DvID2 3ohZ5VzMqQxk90aKzVkOsWfPcZrc1rGu7bDgRn1unfAml7h1IiHSpr7L6GwntoFSnEAA +3iwRkBEjnHB5ggWMvNgSwRtHyKtEgTjadUTF1S1K3T7FZSppUAUQP5LjE5zmV8aeU0d osQ+slAlXNgLp/sQgHINPgomMbEZesOx5pAEu3nM+sFF/0sCT8iuGr0ox/HFFRH8ai6Y +i//Qmv9v2mK7QVbON0qmTlqDsbM12Xguyyuh96HF3IyFBs9OhDcKWJvRK4JvT5nnaZO wrWg== X-Gm-Message-State: AOAM530ydK0WDLngNiPZBztH0Sf67TAVYBBrSADS9ofba+qCXqflmGEm wh0ZTf1QJmtydt4/qGlgYcIi/TUuyM0= X-Google-Smtp-Source: ABdhPJyVRSBa/xzeLjDubpWfD+ZT38KnkEIRD1zWnB+2+j6+eisr03FM5xvwIHhaJJNMMtCT3CASbg== X-Received: by 2002:a1c:f70b:: with SMTP id v11mr15686605wmh.186.1626516617248; Sat, 17 Jul 2021 03:10:17 -0700 (PDT) From: Mahmoud Mandour To: qemu-devel@nongnu.org Subject: [PATCH 07/13] plugins/howvec: Adapting to the new argument passing scheme. Date: Sat, 17 Jul 2021 12:09:14 +0200 Message-Id: <20210717100920.240793-8-ma.mandourr@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210717100920.240793-1-ma.mandourr@gmail.com> References: <20210717100920.240793-1-ma.mandourr@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=ma.mandourr@gmail.com; helo=mail-wm1-x32a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mahmoud Mandour , cota@braap.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1626517001561100002 Content-Type: text/plain; charset="utf-8" Correctly parsing plugin argument since they now must be provided as full-form boolean parameters, e.g.: -plugin ./contrib/plugins/libhowvec.so,verbose=3Don,inline=3Don Also, introduced the argument "count" that accepts one opt to count individually at a time. Signed-off-by: Mahmoud Mandour Reviewed-by: Alex Benn=C3=A9e Tested-by: Alex Benn=C3=A9e --- contrib/plugins/howvec.c | 27 +++++++++++++++++++-------- docs/devel/tcg-plugins.rst | 10 +++++----- 2 files changed, 24 insertions(+), 13 deletions(-) diff --git a/contrib/plugins/howvec.c b/contrib/plugins/howvec.c index 600f7facc1..4a5ec3d936 100644 --- a/contrib/plugins/howvec.c +++ b/contrib/plugins/howvec.c @@ -333,23 +333,34 @@ QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugi= n_id_t id, =20 for (i =3D 0; i < argc; i++) { char *p =3D argv[i]; - if (strcmp(p, "inline") =3D=3D 0) { - do_inline =3D true; - } else if (strcmp(p, "verbose") =3D=3D 0) { - verbose =3D true; - } else { + g_autofree char **tokens =3D g_strsplit(p, "=3D", -1); + if (g_strcmp0(tokens[0], "inline") =3D=3D 0) { + if (!qemu_plugin_bool_parse(tokens[0], tokens[1], &do_inline))= { + fprintf(stderr, "boolean argument parsing failed: %s\n", p= ); + return -1; + } + } else if (g_strcmp0(tokens[0], "verbose") =3D=3D 0) { + if (!qemu_plugin_bool_parse(tokens[0], tokens[1], &verbose)) { + fprintf(stderr, "boolean argument parsing failed: %s\n", p= ); + return -1; + } + } else if (g_strcmp0(tokens[0], "count") =3D=3D 0) { + char *value =3D tokens[1]; int j; CountType type =3D COUNT_INDIVIDUAL; - if (*p =3D=3D '!') { + if (*value =3D=3D '!') { type =3D COUNT_NONE; - p++; + value++; } for (j =3D 0; j < class_table_sz; j++) { - if (strcmp(p, class_table[j].opt) =3D=3D 0) { + if (strcmp(value, class_table[j].opt) =3D=3D 0) { class_table[j].what =3D type; break; } } + } else { + fprintf(stderr, "option parsing failed: %s\n", p); + return -1; } } =20 diff --git a/docs/devel/tcg-plugins.rst b/docs/devel/tcg-plugins.rst index 753f56ac42..4ab9dc4bb1 100644 --- a/docs/devel/tcg-plugins.rst +++ b/docs/devel/tcg-plugins.rst @@ -79,7 +79,7 @@ Once built a program can be run with multiple plugins loa= ded each with their own arguments:: =20 $QEMU $OTHER_QEMU_ARGS \ - -plugin tests/plugin/libhowvec.so,arg=3Dinline,arg=3Dhint \ + -plugin tests/plugin/libhowvec.so,inline=3Don,count=3Dhint \ -plugin tests/plugin/libhotblocks.so =20 Arguments are plugin specific and can be used to modify their @@ -196,13 +196,13 @@ Similar to hotblocks but this time tracks memory acce= sses:: =20 This is an instruction classifier so can be used to count different types of instructions. It has a number of options to refine which get -counted. You can give an argument for a class of instructions to break -it down fully, so for example to see all the system registers -accesses:: +counted. You can give a value to the `count` argument for a class of +instructions to break it down fully, so for example to see all the system +registers accesses:: =20 ./aarch64-softmmu/qemu-system-aarch64 $(QEMU_ARGS) \ -append "root=3D/dev/sda2 systemd.unit=3Dbenchmark.service" \ - -smp 4 -plugin ./contrib/plugins/libhowvec.so,arg=3Dsreg -d plugin + -smp 4 -plugin ./contrib/plugins/libhowvec.so,count=3Dsreg -d plugin =20 which will lead to a sorted list after the class breakdown:: =20 --=20 2.25.1 From nobody Sun May 12 00:34:05 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1626516999433950.7448234588734; Sat, 17 Jul 2021 03:16:39 -0700 (PDT) Received: from localhost ([::1]:49702 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m4hN8-0004mv-6G for importer@patchew.org; Sat, 17 Jul 2021 06:16:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35758) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m4hH6-0007rO-PS for qemu-devel@nongnu.org; Sat, 17 Jul 2021 06:10:24 -0400 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]:45688) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m4hH1-0007X2-RJ for qemu-devel@nongnu.org; Sat, 17 Jul 2021 06:10:24 -0400 Received: by mail-wm1-x32d.google.com with SMTP id u8-20020a7bcb080000b02901e44e9caa2aso7332028wmj.4 for ; Sat, 17 Jul 2021 03:10:19 -0700 (PDT) Received: from localhost.localdomain ([41.34.125.69]) by smtp.gmail.com with ESMTPSA id 11sm13846923wmo.10.2021.07.17.03.10.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Jul 2021 03:10:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=rMLAuiSXBB39vnc7yIBeUjpUzjmirkB4ItWpH9noXsY=; b=HEfutHOLgmWI7Hb2tCg3vMQ0OnRDZ/JDGtm5UXbfbu+1E/qP2QCLeV+ZdZlVaufy8A m3Ern9Grz+WE33ODCx2qPVZ2m2dTtd6uMqm0rzNqm36F1SsBElx+7+PTSI1GtUoikq1D CoCYzLFzKplSeppdr+UuSR8SyiHBmrR/tCIXgX9vPs3UdlgDibZhGjqSddW3l2OYtP03 eiGu/uFWl+Q7LTcreg7qt1eOkUNBKZFVVbt6+YpyMclVgoOxDZYPo9GCDg0NG1Wlqd7W E9SFf228kfnP9fJ1fdEDrl9KVlXzTmBSUEOGfdCcSLw+U+SBZzqIAGCJJ4bpO1YhiqJ3 2QDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=rMLAuiSXBB39vnc7yIBeUjpUzjmirkB4ItWpH9noXsY=; b=JizILjEthvqbnKQYyiB1ZEtVP8LA6IP9NChTFzXPR90KIPEJbe2SaCdovkQ6Bt8E7H u3J0Mm+75R+Oq9rCezxTAN9bCrdgI+UWifDQWGejth1Wm3ftG5/amIq2FaPLXJUBV/X6 WVvpSOhx3FHKoQFCQfcgOR2vjDAMRpvsBCGVP9rc6vaN64Z81gOLM2zZZVxY50fOjVOq yGnsn9pD4MXTJLTAlmz6In7Cm0qzckkDEpceJ7br8LBc8z0am1GsmbtSGv0c/OhXGAu/ K4NovznZZMShfCWqidbg20fLzq3KDjr0vKdg17uOvSkd0aJu8rC3sX3y5zcypNDoKtJ1 JpkQ== X-Gm-Message-State: AOAM532bW0SQxCAi3VsBh/aai/s89tJXis/Y1s7j7Ep7VZ1nhJkaJyhs UO+hh8DqV6CzXf03fDs472KSfaAYGEw= X-Google-Smtp-Source: ABdhPJzT95V/z2VT9hlUYpWBqblIrtNTiZq1WSWJFFsHC1H5IJfMd2GsTiCSPcGOxuyNfiwizwu26g== X-Received: by 2002:a05:600c:4f54:: with SMTP id m20mr21271646wmq.52.1626516618363; Sat, 17 Jul 2021 03:10:18 -0700 (PDT) From: Mahmoud Mandour To: qemu-devel@nongnu.org Subject: [PATCH 08/13] docs/tcg-plugins: new passing parameters scheme for cache docs Date: Sat, 17 Jul 2021 12:09:15 +0200 Message-Id: <20210717100920.240793-9-ma.mandourr@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210717100920.240793-1-ma.mandourr@gmail.com> References: <20210717100920.240793-1-ma.mandourr@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=ma.mandourr@gmail.com; helo=mail-wm1-x32d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mahmoud Mandour , cota@braap.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1626517001553100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Mahmoud Mandour Reviewed-by: Alex Benn=C3=A9e --- docs/devel/tcg-plugins.rst | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/devel/tcg-plugins.rst b/docs/devel/tcg-plugins.rst index 4ab9dc4bb1..be1256d50c 100644 --- a/docs/devel/tcg-plugins.rst +++ b/docs/devel/tcg-plugins.rst @@ -349,34 +349,34 @@ will report the following:: =20 The plugin has a number of arguments, all of them are optional: =20 - * arg=3D"limit=3DN" + * limit=3DN =20 Print top N icache and dcache thrashing instructions along with their address, number of misses, and its disassembly. (default: 32) =20 - * arg=3D"icachesize=3DN" - * arg=3D"iblksize=3DB" - * arg=3D"iassoc=3DA" + * icachesize=3DN + * iblksize=3DB + * iassoc=3DA =20 Instruction cache configuration arguments. They specify the cache size, = block size, and associativity of the instruction cache, respectively. (default: N =3D 16384, B =3D 64, A =3D 8) =20 - * arg=3D"dcachesize=3DN" - * arg=3D"dblksize=3DB" - * arg=3D"dassoc=3DA" + * dcachesize=3DN + * dblksize=3DB + * dassoc=3DA =20 Data cache configuration arguments. They specify the cache size, block s= ize, and associativity of the data cache, respectively. (default: N =3D 16384, B =3D 64, A =3D 8) =20 - * arg=3D"evict=3DPOLICY" + * evict=3DPOLICY =20 Sets the eviction policy to POLICY. Available policies are: :code:`lru`, :code:`fifo`, and :code:`rand`. The plugin will use the specified policy= for both instruction and data caches. (default: POLICY =3D :code:`lru`) =20 - * arg=3D"cores=3DN" + * cores=3DN =20 Sets the number of cores for which we maintain separate icache and dcach= e. (default: for linux-user, N =3D 1, for full system emulation: N =3D cores --=20 2.25.1 From nobody Sun May 12 00:34:05 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1626517162493609.4900124172241; Sat, 17 Jul 2021 03:19:22 -0700 (PDT) Received: from localhost ([::1]:58168 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m4hPl-00023D-BX for importer@patchew.org; Sat, 17 Jul 2021 06:19:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35772) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m4hH7-0007sG-8L for qemu-devel@nongnu.org; Sat, 17 Jul 2021 06:10:25 -0400 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]:40923) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m4hH3-0007XW-BB for qemu-devel@nongnu.org; Sat, 17 Jul 2021 06:10:24 -0400 Received: by mail-wr1-x42d.google.com with SMTP id l7so14967420wrv.7 for ; Sat, 17 Jul 2021 03:10:20 -0700 (PDT) Received: from localhost.localdomain ([41.34.125.69]) by smtp.gmail.com with ESMTPSA id 11sm13846923wmo.10.2021.07.17.03.10.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Jul 2021 03:10:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=g9GPBnOls6lqCRr2cBSrHII9Px4RdKxn4NmBlv5xAGo=; b=fWgthwIvFg0rDex8JVcOUT/nQunff3u/j+Y93SmEdgjsrfvWxT9W/8e/l/e9SCBjKR KEo2hHRH6DjEuUoFiSLzufX7uArvhhnsIxHlRiI7iBsQosaZJGW9Dc56uhWidbv6sh2+ gm+uBEsT/dHSGz25LA3serLej07t5bEU8vUiXM0xt/620SWgXmoa9t8Z6ao/Uy+KGmG3 3JisBu0H/lEnTQvoYlX2FMIWXW3mfpPNaSSOwHIhRqVcj1KcRtPH5HMP+OQEbZKFYCmP tlakOf5GB4sJubwmSgLVmpaigUDgRk53lqxWKLn9IJgV5sfPD7TtnTHOetT9SrPmuDUw Gw/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=g9GPBnOls6lqCRr2cBSrHII9Px4RdKxn4NmBlv5xAGo=; b=INmEdy+3LMTPs2hUAoA5Xt9nwNDQRHqkmpq0CCHzOQBL13cuaqtZvUsGmkL74VhcJP 5wbQMHU2jkzQ+Dth671gIDve6SqUV7jBYtVBIEfs+nZHNIYdTFxUkIUsc4LqaC/hHZ0Y YJgYfV+VJHG10+7yM3+WzK0jEK0BoLCqbrrBk/6iulau+h55vskrBFiRA28aQBrdLCXG OCuoVU4nCGDi3gUn8GtUCB6TCqYtS9PXADKmuYMPQt9KFv5uvLVUfn6frxvx7WfIpFEK pzaHlQ0L0oHhK7hxRFeJ4poG3JKMYNb57D0+6WMCbDwnbolzHc+4vwkS6aRkzv3t7JYo V4sQ== X-Gm-Message-State: AOAM530geiuTAUJihg9JTQYbonJYP99uk5Q/yKiL5wSD9OphYNsRQp6I TwyVgJ/qyn1t9BonrlxomdBb3vq5DjI= X-Google-Smtp-Source: ABdhPJwh6+Cbu4E4I2PWWUGYgCoJspVQVCrvFUTR6zhpVz4IpAhFCwDmjakIAmacVBVT7eblQLFgfA== X-Received: by 2002:a5d:4573:: with SMTP id a19mr18183656wrc.346.1626516619616; Sat, 17 Jul 2021 03:10:19 -0700 (PDT) From: Mahmoud Mandour To: qemu-devel@nongnu.org Subject: [PATCH 09/13] tests/plugins/bb: adapt to the new arg passing scheme Date: Sat, 17 Jul 2021 12:09:16 +0200 Message-Id: <20210717100920.240793-10-ma.mandourr@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210717100920.240793-1-ma.mandourr@gmail.com> References: <20210717100920.240793-1-ma.mandourr@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=ma.mandourr@gmail.com; helo=mail-wr1-x42d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mahmoud Mandour , cota@braap.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1626517163066100002 Content-Type: text/plain; charset="utf-8" Signed-off-by: Mahmoud Mandour Reviewed-by: Alex Benn=C3=A9e --- tests/plugin/bb.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/tests/plugin/bb.c b/tests/plugin/bb.c index de09bdde4e..7d470a1011 100644 --- a/tests/plugin/bb.c +++ b/tests/plugin/bb.c @@ -104,10 +104,17 @@ QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugi= n_id_t id, =20 for (i =3D 0; i < argc; i++) { char *opt =3D argv[i]; - if (g_strcmp0(opt, "inline") =3D=3D 0) { - do_inline =3D true; - } else if (g_strcmp0(opt, "idle") =3D=3D 0) { - idle_report =3D true; + g_autofree char **tokens =3D g_strsplit(opt, "=3D", 2); + if (g_strcmp0(tokens[0], "inline") =3D=3D 0) { + if (!qemu_plugin_bool_parse(tokens[0], tokens[1], &do_inline))= { + fprintf(stderr, "boolean argument parsing failed: %s\n", o= pt); + return -1; + } + } else if (g_strcmp0(tokens[0], "idle") =3D=3D 0) { + if (!qemu_plugin_bool_parse(tokens[0], tokens[1], &idle_report= )) { + fprintf(stderr, "boolean argument parsing failed: %s\n", o= pt); + return -1; + } } else { fprintf(stderr, "option parsing failed: %s\n", opt); return -1; --=20 2.25.1 From nobody Sun May 12 00:34:05 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1626516853107495.7178332414567; Sat, 17 Jul 2021 03:14:13 -0700 (PDT) Received: from localhost ([::1]:41388 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m4hKl-0007iS-VV for importer@patchew.org; Sat, 17 Jul 2021 06:14:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35782) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m4hH8-0007vq-3L for qemu-devel@nongnu.org; Sat, 17 Jul 2021 06:10:26 -0400 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]:33600) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m4hH4-0007YI-9m for qemu-devel@nongnu.org; Sat, 17 Jul 2021 06:10:25 -0400 Received: by mail-wr1-x42e.google.com with SMTP id d2so15046539wrn.0 for ; Sat, 17 Jul 2021 03:10:21 -0700 (PDT) Received: from localhost.localdomain ([41.34.125.69]) by smtp.gmail.com with ESMTPSA id 11sm13846923wmo.10.2021.07.17.03.10.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Jul 2021 03:10:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=f8o0n+4DG6HViuGjG54BZ2SQjZzUv2ICi5cU27e7QLU=; b=dySDNL9nVZaMUb/4gHYjamz54oTo/FaxIvaLuBpbMWITVOCvbLxGA99FORF/zTZnK4 /ZG57AKh7q0Olbasps/qszDn7tiqBWJHHPMOe5O9VvbmOl3AzQ3H+I8grKqayzmbVMbr aA19Ii8sdJb2TqRmZYvjfQEQfgMuTKCo3PHorPWQQc3Pee6+91/4Cr+Qqyqz4yCnb2Tv xGiqKzctxPyW+/TxBHp6m3KzE6vS2BlKEnDgd5uMCk0gyOnhsRQqmlobmwFUN2ftj7XN 8dT1NztcMZawLgt4C40RCa5+K3yfn0C8pN2I4wq45gK9O50UQ/xZQH0nDlfMomWyq/co +FQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=f8o0n+4DG6HViuGjG54BZ2SQjZzUv2ICi5cU27e7QLU=; b=h9qe0uNFyzLh59JSWce7lzGgfVTPNECL4XCBA53qOmkycXh5LPazPD7X5KywUp3PSA 12KZqP2pJ2A4e9kCwiwfA80RidmJw6q+XeQiFOjDvq9eiMzf+UvwSK1cTXlC72xr3/WA p8sBlj5+cW6ppfXaDJ7jlxWiJeIKj0lyG5BPhEoJiS0Uin3XAuvglhxArOu/1hPDGz8s YG5UyPiPYjoOaqVhu4FgRNYhCGd6SGqHPCEykdc5sfTua0Sq6tgZzrqmJefWnaPK/Gv+ iOYkOlmJemgrJVJLUtF070/z3Pc0Qlu8H41w9Eooz+R56c/Pt4pHY8WhiXSzHTsowvAZ rUGw== X-Gm-Message-State: AOAM533WFxz5LhjAx5MdkFpUbx8EsIa6qDQkel6nvomqqwOXOhe8f6Lf RQIJdFo87B9Tnce6F8tk9Axq4we9RXU= X-Google-Smtp-Source: ABdhPJyeaJ8DitNWvtMxP33MbRiHfgJLCbV04zhgUIQQqXVWoZGOIXWL3pu7N7hQhEnb66gPT/ihCg== X-Received: by 2002:a5d:6302:: with SMTP id i2mr18063496wru.366.1626516620802; Sat, 17 Jul 2021 03:10:20 -0700 (PDT) From: Mahmoud Mandour To: qemu-devel@nongnu.org Subject: [PATCH 10/13] tests/plugins/insn: made arg inline not positional and parse it as bool Date: Sat, 17 Jul 2021 12:09:17 +0200 Message-Id: <20210717100920.240793-11-ma.mandourr@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210717100920.240793-1-ma.mandourr@gmail.com> References: <20210717100920.240793-1-ma.mandourr@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42e; envelope-from=ma.mandourr@gmail.com; helo=mail-wr1-x42e.google.com X-Spam_score_int: -1 X-Spam_score: -0.2 X-Spam_bar: / X-Spam_report: (-0.2 / 5.0 requ) DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mahmoud Mandour , cota@braap.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1626516854117100004 Content-Type: text/plain; charset="utf-8" Made argument "inline" not positional, this has two benefits. First is that we adhere to how QEMU passes args generally, by taking the last value of an argument and drop the others. And the second is that this sets up a framework for potentially adding new args easily. Signed-off-by: Mahmoud Mandour Reviewed-by: Alex Benn=C3=A9e --- tests/plugin/insn.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tests/plugin/insn.c b/tests/plugin/insn.c index c253980ec8..0f6a1938c1 100644 --- a/tests/plugin/insn.c +++ b/tests/plugin/insn.c @@ -62,8 +62,18 @@ QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin_i= d_t id, const qemu_info_t *info, int argc, char **argv) { - if (argc && !strcmp(argv[0], "inline")) { - do_inline =3D true; + for (int i =3D 0; i < argc; i++) { + char *opt =3D argv[i]; + g_autofree char **tokens =3D g_strsplit(opt, "=3D", 2); + if (g_strcmp0(tokens[0], "inline") =3D=3D 0) { + if (!qemu_plugin_bool_parse(tokens[0], tokens[1], &do_inline))= { + fprintf(stderr, "boolean argument parsing failed: %s\n", o= pt); + return -1; + } + } else { + fprintf(stderr, "option parsing failed: %s\n", opt); + return -1; + } } =20 qemu_plugin_register_vcpu_tb_trans_cb(id, vcpu_tb_trans); --=20 2.25.1 From nobody Sun May 12 00:34:05 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1626517005576883.9650663309808; Sat, 17 Jul 2021 03:16:45 -0700 (PDT) Received: from localhost ([::1]:49962 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m4hNE-0004yX-Ib for importer@patchew.org; Sat, 17 Jul 2021 06:16:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35794) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m4hH8-0007yh-Ps for qemu-devel@nongnu.org; Sat, 17 Jul 2021 06:10:26 -0400 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]:41909) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m4hH5-0007ZD-KE for qemu-devel@nongnu.org; Sat, 17 Jul 2021 06:10:26 -0400 Received: by mail-wr1-x42b.google.com with SMTP id k4so14948578wrc.8 for ; Sat, 17 Jul 2021 03:10:23 -0700 (PDT) Received: from localhost.localdomain ([41.34.125.69]) by smtp.gmail.com with ESMTPSA id 11sm13846923wmo.10.2021.07.17.03.10.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Jul 2021 03:10:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=rSm96D6r0gBJdnBHUTP1OLqekpphinSagmjmjNFJcIA=; b=ncsT5pJTc83+WkpzgYjTtafSfcIdxv5s+SA5CTUFqjpK95hy26a5rzCcupE8Tu1PyD shh3qmxge50Bg+FkWxTrWCSav07eExdhcnGi7p1+5PxIVG3I7b5tExBpGXOSW+bn/8I6 +HT3AGFmW6U8Z2PfiHTB983RbAXlrbvLcvgtebZ6fZ16P7VyiQPtcbu04MfxMQHyMe6n D5Yeps2Zz8sM5tRgOprH8v3P60uMFcBss4zr5bF3504/3Ign1xTtYiQM0iUxqNB2LOhY OodVZHIDp89xBXAGTPGdSYLJ4nRl+4EjGintaoR/1M3ylWdZ/RWS+HgaxkWXXhu8rLRH LX6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=rSm96D6r0gBJdnBHUTP1OLqekpphinSagmjmjNFJcIA=; b=b4KRDDbo+OfyC66I1rFs9bK5Zo1VSqsiWc4kAdYBUp9n0FN4NUTkzlv1ebSsmjjRTH 4sPweGRaIIov+ea8Lsq2arbeCERgpbx0VYcTUSSZUUF76Gy8tQMxmkmOkVFqImfB+KQH X1YtJuujEIzJL4/sxuPc3xF9BoDZiyW1xnRnKNdZppPQYkioxDFZ/y7/jzcdWBYCq7/D 6dOmP7swII57YwIHlfp58c01nIdYzIOBjtD2X6qJMZua3QF5DDWt6ef2/tXnf3PUWUSe u9o/PXn9A23K2NRrRNrcbfjILNIYz2wUKeg59+7Hrl2+oNmWmvaeQB+xvVzQUj+ovcPN w0gA== X-Gm-Message-State: AOAM530k1h2QRGomPEsyqQtEH4k6OwCPg3RX927NHtFR0b/UQFLMFubF eGNqZe6N7KmkyE2HE4/OaxmigjOnFGM= X-Google-Smtp-Source: ABdhPJyILRSXH0/6KpLGOOpppULR1hwBf+lWQu4vd8FcjjasiK1EtSRpenp450nD/NM2HYX0sqkybg== X-Received: by 2002:adf:a350:: with SMTP id d16mr18167655wrb.207.1626516621883; Sat, 17 Jul 2021 03:10:21 -0700 (PDT) From: Mahmoud Mandour To: qemu-devel@nongnu.org Subject: [PATCH 11/13] tests/plugins/mem: introduce "track" arg and make args not positional Date: Sat, 17 Jul 2021 12:09:18 +0200 Message-Id: <20210717100920.240793-12-ma.mandourr@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210717100920.240793-1-ma.mandourr@gmail.com> References: <20210717100920.240793-1-ma.mandourr@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=ma.mandourr@gmail.com; helo=mail-wr1-x42b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mahmoud Mandour , cota@braap.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1626517007652100001 Content-Type: text/plain; charset="utf-8" This commit makes the plugin adhere to the new plugins arg-passing scheme by expecting full-form boolean args instead of short-form booleans. This necessitates that we introduce a new argument, here "track", to accept "r", "w", or "rw". Also, it makes arguments not positional and we only care about the last value specified for a certain argument. callback/inline args are now supplied separately as bool arguments so that both can be enabled individually. Signed-off-by: Mahmoud Mandour Reviewed-by: Alex Benn=C3=A9e --- tests/plugin/mem.c | 47 ++++++++++++++++++++++++++++------------------ 1 file changed, 29 insertions(+), 18 deletions(-) diff --git a/tests/plugin/mem.c b/tests/plugin/mem.c index afd1d27e5c..3000f847b5 100644 --- a/tests/plugin/mem.c +++ b/tests/plugin/mem.c @@ -80,29 +80,40 @@ QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin_= id_t id, const qemu_info_t *info, int argc, char **argv) { - if (argc) { - if (argc >=3D 3) { - if (!strcmp(argv[2], "haddr")) { - do_haddr =3D true; - } - } - if (argc >=3D 2) { - const char *str =3D argv[1]; =20 - if (!strcmp(str, "r")) { + for (int i =3D 0; i < argc; i++) { + char *opt =3D argv[i]; + g_autofree char **tokens =3D g_strsplit(opt, "=3D", 2); + + if (g_strcmp0(tokens[0], "hadrr") =3D=3D 0) { + if (!qemu_plugin_bool_parse(tokens[0], tokens[1], &do_haddr)) { + fprintf(stderr, "boolean argument parsing failed: %s\n", o= pt); + return -1; + } + } else if (g_strcmp0(tokens[0], "track") =3D=3D 0) { + if (g_strcmp0(tokens[1], "r") =3D=3D 0) { rw =3D QEMU_PLUGIN_MEM_R; - } else if (!strcmp(str, "w")) { + } else if (g_strcmp0(tokens[1], "w") =3D=3D 0) { rw =3D QEMU_PLUGIN_MEM_W; + } else if (g_strcmp0(tokens[1], "rw") =3D=3D 0) { + rw =3D QEMU_PLUGIN_MEM_RW; + } else { + fprintf(stderr, "invaild value for argument track: %s\n", = opt); + return -1; + } + } else if (g_strcmp0(tokens[0], "inline") =3D=3D 0) { + if (!qemu_plugin_bool_parse(tokens[0], tokens[1], &do_inline))= { + fprintf(stderr, "boolean argument parsing failed: %s\n", o= pt); + return -1; + } + } else if (g_strcmp0(tokens[0], "callback") =3D=3D 0) { + if (!qemu_plugin_bool_parse(tokens[0], tokens[1], &do_callback= )) { + fprintf(stderr, "boolean argument parsing failed: %s\n", o= pt); + return -1; } - } - if (!strcmp(argv[0], "inline")) { - do_inline =3D true; - do_callback =3D false; - } else if (!strcmp(argv[0], "both")) { - do_inline =3D true; - do_callback =3D true; } else { - do_callback =3D true; + fprintf(stderr, "option parsing failed: %s\n", opt); + return -1; } } =20 --=20 2.25.1 From nobody Sun May 12 00:34:05 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1626516853268592.5156364378867; Sat, 17 Jul 2021 03:14:13 -0700 (PDT) Received: from localhost ([::1]:41496 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m4hKm-0007nL-93 for importer@patchew.org; Sat, 17 Jul 2021 06:14:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35786) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m4hH8-0007w8-7G for qemu-devel@nongnu.org; Sat, 17 Jul 2021 06:10:26 -0400 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]:37783) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m4hH6-0007ZU-L9 for qemu-devel@nongnu.org; Sat, 17 Jul 2021 06:10:25 -0400 Received: by mail-wr1-x429.google.com with SMTP id i94so14978092wri.4 for ; Sat, 17 Jul 2021 03:10:24 -0700 (PDT) Received: from localhost.localdomain ([41.34.125.69]) by smtp.gmail.com with ESMTPSA id 11sm13846923wmo.10.2021.07.17.03.10.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Jul 2021 03:10:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4qyLRgjtuRAGaJfw5IPvpDI1rMZ3+dPJpfrbSZzJXHU=; b=tQEXJpBCZ+pgaM4vPbNPJonJk4Kg7aqyTVGCc35trRPKONB4e3k/hFy3U0P+gcilXv uMSqzDvnTQp0ZMuIJj7HeSp7sDVN8MtV7MmneQU8sXX8AYPVbZl6CYMxloyWC50J/tda KGwfORaCFn4FhytsEdqPi9JGVfURpEpeqQcaUliRm5eLBEHU6zePmLTNfmCdX8e3DK38 REv1MNI14NGh4uoQftwWWjh8FixKuGgXxq5YLnzx7yk3Rx1ITb5A9rp6rENbOdmGNSnz JdS/QYcmqE9EyBnosJUB8zpxf2jhFsa59SCt8UNj7U0x+6BGF9INni81B0qUEkbj94Fn u4Sg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=4qyLRgjtuRAGaJfw5IPvpDI1rMZ3+dPJpfrbSZzJXHU=; b=gEYGPMhGFBScEsA4eg0rkk/6vImj1LSno+GnF1d9REXvJx8S2f0QYzIQYFZJ3GIO16 5z4xqOKqW/6uHIB4mn7TLdCKqJ1tBQnC9WQK+zAaSXXzDnTFPgt3JnEamWEKd6drg1+x pgwDThnDD1+2M0kIHYw2wHiLpaNzGBHPMujWQxfXxC/TcZ8mgOnhZEzC5Cpk9i8QIwRr kvcTNDywSVD2C/LrwjbjS97q7+dLSitoMaV8MRVVeU/3mEhJaGZCRnL/A0PgsgCA2oB/ 8tumN54Mu4IM64p7T9KSEnkG6pTKcMZhfdDlZKqBqWsedH0tefPYM8L7mFfs0gjKTRJE Bw6w== X-Gm-Message-State: AOAM532+qtHfloum0aTWLHThhozA2Z0YuF+bvzvR2ZBAdLkFcJvM2ueQ ThOAk9GyR0yeCP3Z32QejuwzLWRDBUs= X-Google-Smtp-Source: ABdhPJzq89nPzpl7S6K0Gmqa/8PBZ39vQAQY8z/ed6DG5BqxEQi0B9+zvKCn8sZZ/MT90aUD2bZDdg== X-Received: by 2002:adf:b318:: with SMTP id j24mr18517793wrd.361.1626516623050; Sat, 17 Jul 2021 03:10:23 -0700 (PDT) From: Mahmoud Mandour To: qemu-devel@nongnu.org Subject: [PATCH 12/13] tests/plugins/syscalls: adhere to new arg-passing scheme Date: Sat, 17 Jul 2021 12:09:19 +0200 Message-Id: <20210717100920.240793-13-ma.mandourr@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210717100920.240793-1-ma.mandourr@gmail.com> References: <20210717100920.240793-1-ma.mandourr@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::429; envelope-from=ma.mandourr@gmail.com; helo=mail-wr1-x429.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mahmoud Mandour , cota@braap.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1626516854136100005 Content-Type: text/plain; charset="utf-8" Signed-off-by: Mahmoud Mandour Reviewed-by: Alex Benn=C3=A9e --- tests/plugin/syscall.c | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/tests/plugin/syscall.c b/tests/plugin/syscall.c index 6dd71092e1..484b48de49 100644 --- a/tests/plugin/syscall.c +++ b/tests/plugin/syscall.c @@ -119,17 +119,26 @@ QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugi= n_id_t id, const qemu_info_t *info, int argc, char **argv) { - if (argc =3D=3D 0) { - statistics =3D g_hash_table_new_full(NULL, g_direct_equal, NULL, g= _free); - } else { - for (int i =3D 0; i < argc; i++) { - if (g_strcmp0(argv[i], "print") !=3D 0) { - fprintf(stderr, "unsupported argument: %s\n", argv[i]); - return -1; + bool do_print =3D false; + + for (int i =3D 0; i < argc; i++) { + char *opt =3D argv[i]; + g_autofree char **tokens =3D g_strsplit(opt, "=3D", 2); + + if (g_strcmp0(tokens[0], "print") =3D=3D 0) { + if (!qemu_plugin_bool_parse(tokens[0], tokens[1], &do_print)) { + fprintf(stderr, "boolean argument parsing failed: %s\n", o= pt); } + } else { + fprintf(stderr, "unsupported argument: %s\n", argv[i]); + return -1; } } =20 + if (!do_print) { + statistics =3D g_hash_table_new_full(NULL, g_direct_equal, NULL, g= _free); + } + qemu_plugin_register_vcpu_syscall_cb(id, vcpu_syscall); qemu_plugin_register_vcpu_syscall_ret_cb(id, vcpu_syscall_ret); qemu_plugin_register_atexit_cb(id, plugin_exit, NULL); --=20 2.25.1 From nobody Sun May 12 00:34:05 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1626516649056595.2451879340581; Sat, 17 Jul 2021 03:10:49 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-81-qpEg9KwANf2hin5wOvRXfQ-1; Sat, 17 Jul 2021 06:10:46 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3FD921835AC9; Sat, 17 Jul 2021 10:10:39 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 09CDE60C0F; Sat, 17 Jul 2021 10:10:37 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 07BED4E9F5; Sat, 17 Jul 2021 10:10:31 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 16HAAUwa019456 for ; Sat, 17 Jul 2021 06:10:30 -0400 Received: by smtp.corp.redhat.com (Postfix) id 3BCD5202BFA3; Sat, 17 Jul 2021 10:10:30 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast06.extmail.prod.ext.rdu2.redhat.com [10.11.55.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 371D02156A37 for ; Sat, 17 Jul 2021 10:10:27 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 229B4185A7A4 for ; Sat, 17 Jul 2021 10:10:27 +0000 (UTC) Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-247-LvtEXqLMOwSqhnrajXesyA-1; Sat, 17 Jul 2021 06:10:25 -0400 Received: by mail-wr1-f46.google.com with SMTP id d12so14934626wre.13 for ; Sat, 17 Jul 2021 03:10:25 -0700 (PDT) Received: from localhost.localdomain ([41.34.125.69]) by smtp.gmail.com with ESMTPSA id 11sm13846923wmo.10.2021.07.17.03.10.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Jul 2021 03:10:23 -0700 (PDT) X-MC-Unique: qpEg9KwANf2hin5wOvRXfQ-1 X-MC-Unique: LvtEXqLMOwSqhnrajXesyA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=TQ4eoAhFvF5WLmzSkOUBXUWpS6dwt1gpkEIzciIqlv0=; b=luMMlPVQGdtP2JROyGugzkgpDOMdONbyZ5567jszZMoBraNXFRkRNi8GDwYGlTag47 THlh7mii4ZdMzdsDiJwqopsnXsC/d5xiyA/CYKUSur4+/8nw5Xb5Gj6q9dazjzCEW+Pz VTor+k7MqfRHnYTBBe94JwFxx8Q6VNVNo016tG2qTp9Mt/wMnaKPkiCm9j2qMQbwFeyi pynGmGjhcqjzyFC68t4Z7fFczfheRSuNP4hLmnr5LJIYnQCRtTebpiCwmwd0ljeUBRTT FDJ1X+OAjNAFNV0o7/CxlZwnNBMkpxrp96oYREUGN/jHsX5davkBwWnZo5QseYf+4ojB ik3A== X-Gm-Message-State: AOAM531d+NIuamFBblKfDPcrYpGnk43z1UhMe4qUUzQXDRj9bUra5M9A DXws2QpjF8FzFPwnqux+pYs= X-Google-Smtp-Source: ABdhPJwir8mf7p/tifKwQA42d/GxZSYvkntkmc8pz+EBim7DR+Y4xJSdnl827OC/2DIXJfBnd0TXnw== X-Received: by 2002:adf:a1c4:: with SMTP id v4mr17754095wrv.217.1626516624151; Sat, 17 Jul 2021 03:10:24 -0700 (PDT) From: Mahmoud Mandour To: qemu-devel@nongnu.org Subject: [PATCH 13/13] docs/deprecated: deprecate passing plugin args through `arg=` Date: Sat, 17 Jul 2021 12:09:20 +0200 Message-Id: <20210717100920.240793-14-ma.mandourr@gmail.com> In-Reply-To: <20210717100920.240793-1-ma.mandourr@gmail.com> References: <20210717100920.240793-1-ma.mandourr@gmail.com> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Cc: "reviewer:Incompatible changes" , Mahmoud Mandour , cota@braap.org X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1626516651181100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Mahmoud Mandour --- docs/system/deprecated.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/system/deprecated.rst b/docs/system/deprecated.rst index e2e0090878..aaf0ee5777 100644 --- a/docs/system/deprecated.rst +++ b/docs/system/deprecated.rst @@ -126,6 +126,12 @@ other options have been processed. This will either h= ave no effect (if if they were not given. The property is therefore useless and should not = be specified. =20 +Plugin argument passing through ``arg=3D`` (since 6.1) +'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' + +Passing arguments through ``arg=3D`` is redundant is makes the command-lin= e less +readable, especially when the argument itself consist of a name and a valu= e, +e.g. ``arg=3D"arg_name=3Darg_value"``. Therefore, the usage of ``arg`` is = redundant. =20 QEMU Machine Protocol (QMP) commands ------------------------------------ --=20 2.25.1