From nobody Mon May 13 13:01:37 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 1626422777590120.93954422545471; Fri, 16 Jul 2021 01:06:17 -0700 (PDT) Received: from localhost ([::1]:43946 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m4IrQ-0001P0-5w for importer@patchew.org; Fri, 16 Jul 2021 04:06:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55994) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m4IpO-00078M-Ft for qemu-devel@nongnu.org; Fri, 16 Jul 2021 04:04:10 -0400 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]:36587) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m4IpM-0005IA-KQ for qemu-devel@nongnu.org; Fri, 16 Jul 2021 04:04:10 -0400 Received: by mail-wm1-x336.google.com with SMTP id l17-20020a05600c1d11b029021f84fcaf75so7627194wms.1 for ; Fri, 16 Jul 2021 01:04:08 -0700 (PDT) Received: from localhost.localdomain ([41.34.125.69]) by smtp.gmail.com with ESMTPSA id p12sm6558046wma.19.2021.07.16.01.04.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Jul 2021 01:04:06 -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=Aae4PyAsdbABL7pcXNVqHYnwexdU3XdXGPQCEinbnt43qczlj6eRHr8R58VtpJ39pn diLJc4WHN1m404ch/9Uej/qe6AJUgKa4ELbFC53VMRB/VPsl4suHdnMTSh7H8wuakaoh uGZ/VWojO5UsIDRQc5dCMsWciKzt0gX+kBp/t0Nu7RefDP9EmOuEPbJ6q7cFzxY+NrpU cu+MWilhmB7WAipwdAUpocOw3+5lFrGuIfgcH2fG4q57xCScUoH4pno8R0R+kbE467GF f4cAFluIiOV88JMdUmDtenEYXd9m+V0pfV1ydEbt1s82gKJsQhETdZd0+lGi8GUOpEtP Inyw== 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=ei+JIu7rUoOR5DJ41b3tB8X7d8Pme0gxR7OpvUWUkihAhws0nB/G9PEvwDfhxZ+6x1 YY/59NBXNf0v5UxVpIppaQNcdYot148UEWYVv/LfAJSMV18eh/ir7lqW0Zx1b2WdvTS6 2RDuznvhfMxyarHDrp7VNh2yHBuPJoRCgL+UiNuMv54nMPPusE8mMt2Y7vc3oMyzU/w6 n8eQCew0jnPAunMvBE4GuhP+3bslHSI6xfnKWP1m25JnKMMQHB1Mzl/Zc6rIiSA3XGGq e8dQAFrOXw69sKxy8mk6lIylubwK0RgPDN56NnJICpzB55dTz50YtdKDg7LZRvdGEL4P 5zVA== X-Gm-Message-State: AOAM5311m1ilq96b2TzpJ/+k/cirQloSCOggdyADdjnoeEeFcB50IxXt fIHsg6WWOtZosFAPdnWveTgQ2qU0gQ5Oqw== X-Google-Smtp-Source: ABdhPJzz3NNVhMoDuky/yBC274InUneCQ9umR696QYH7ILpOe6JLKn/pqG3m7Yppgk+z+EuvBngAww== X-Received: by 2002:a05:600c:190a:: with SMTP id j10mr14788634wmq.109.1626422647059; Fri, 16 Jul 2021 01:04:07 -0700 (PDT) From: Mahmoud Mandour To: qemu-devel@nongnu.org Subject: [PATCH 1/9] plugins: allow plugin arguments to be passed directly Date: Fri, 16 Jul 2021 10:03:37 +0200 Message-Id: <20210716080345.136784-2-ma.mandourr@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210716080345.136784-1-ma.mandourr@gmail.com> References: <20210716080345.136784-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: -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: 1626422779476100002 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 --- 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 Mon May 13 13:01:37 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 1626422817616171.89713411478454; Fri, 16 Jul 2021 01:06:57 -0700 (PDT) Received: from localhost ([::1]:47290 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m4Is2-0003fn-Qz for importer@patchew.org; Fri, 16 Jul 2021 04:06:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56012) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m4IpP-0007AE-EX for qemu-devel@nongnu.org; Fri, 16 Jul 2021 04:04:11 -0400 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]:33424) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m4IpN-0005Ip-PY for qemu-devel@nongnu.org; Fri, 16 Jul 2021 04:04:11 -0400 Received: by mail-wm1-x332.google.com with SMTP id g8-20020a1c9d080000b02901f13dd1672aso6573347wme.0 for ; Fri, 16 Jul 2021 01:04:09 -0700 (PDT) Received: from localhost.localdomain ([41.34.125.69]) by smtp.gmail.com with ESMTPSA id p12sm6558046wma.19.2021.07.16.01.04.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Jul 2021 01:04:07 -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=gUN5RibiyBj867rmFyWRnVv07wyqoflURxMuDP7mYGs0EiIblD2cV3vD7tuSJFInve HYmoWZbp8uAJo+UnslWo8lGn7FoLmNUdOxn4NxHYSI2DvvfZ/CNF5DmacAzcp/M6aZqS wlLhoJeMEEj27nZ6AEvwQaYAu58/bJdpqqOiHbTJ+5tSqeTImBpaLs0uf0rdQLOq+TTT SvEaYXM95fthDVw5K31y5OjXmnjVCyjbFcvEVY/stqAiA1QcraKu/FHEyGnzZFUFcHsv 8GsvDgYh5HnOTakz+b65MKrqwHVzu0zB3ZXWJykECM57SOgkVF/9wUOHaA5cUEc7CGiC Y6bA== 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=c2W366Z1DPcx89L2D4pDN+Q7l5C1Qju46Q/rV0IytQMEjdi7IBx7stzyoDxG1oATeB HxQX1KoynfpWZZAWt9yX4+4Brzip7GhnvGbuekZRDMXE1DIo3lGoFfpO/lD4FKncPIUn 7JBAjk24MMeGYOiSvlD3ucLZC13enVmCVdxSQkTIFf/V9N7iHU8KsNei2e/oP5YCppVv savafkoUf8Bcijdvsx8W+Pm1flbtEZxnJJ1rElIRcevnaJ4MqJQijLCIrvU6W6wBHBvp lwh9kcTsX602eg8sxDZZr/G5+fNxUX3mxIRzoR8HkD1A6g0GOHaGOjJ6GdIjlrGk0Nsf GO1g== X-Gm-Message-State: AOAM532ZzzdfmNRaqRNap36NfWB9GgPcdePu4ElyVbC29LtfGjLafvIK SkqRZO6oJfu1sg/j1iolm+4hhHtSYndozg== X-Google-Smtp-Source: ABdhPJxQ+VwpBzMkOHHBkG/dOfLfoPGz1DyOTwDz6/DyI7fZpevIIXUr/kZYNZfle04kPvx5Xt69xw== X-Received: by 2002:a1c:f203:: with SMTP id s3mr14657064wmc.138.1626422648302; Fri, 16 Jul 2021 01:04:08 -0700 (PDT) From: Mahmoud Mandour To: qemu-devel@nongnu.org Subject: [PATCH 2/9] plugins/api: added a boolean parsing plugin api Date: Fri, 16 Jul 2021 10:03:38 +0200 Message-Id: <20210716080345.136784-3-ma.mandourr@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210716080345.136784-1-ma.mandourr@gmail.com> References: <20210716080345.136784-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: 1626422819885100001 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 Mon May 13 13:01:37 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 1626422930013991.7201120816862; Fri, 16 Jul 2021 01:08:50 -0700 (PDT) Received: from localhost ([::1]:52300 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m4Its-0006zR-Tx for importer@patchew.org; Fri, 16 Jul 2021 04:08:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56026) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m4IpQ-0007DF-Gw for qemu-devel@nongnu.org; Fri, 16 Jul 2021 04:04:12 -0400 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]:37465) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m4IpP-0005Ja-2A for qemu-devel@nongnu.org; Fri, 16 Jul 2021 04:04:12 -0400 Received: by mail-wr1-x433.google.com with SMTP id i94so11027459wri.4 for ; Fri, 16 Jul 2021 01:04:10 -0700 (PDT) Received: from localhost.localdomain ([41.34.125.69]) by smtp.gmail.com with ESMTPSA id p12sm6558046wma.19.2021.07.16.01.04.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Jul 2021 01:04:09 -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=SfAhQUAM+LvWkf1MSIcch3KC34oBgSNa9P0sl4gSNdZfYX/UziH99n+1tA5/gRuu1P PD3UgQqVwkJJ5LkK1UrotGrQE7Xi6166yTHMP3XJOdmVjve0Xx/y6nRKd78znD/d+PQs pl7SwQjwl5l8eaWM1iqwugvHlaHW4s7WQrAC0Z9uWONrpMN76TJ/dtG19m13m8EqcTwj 0XWcfPOPtRcjr65KHNjq5wNGYdQbYNdlWOG+Ei2yuOfX9xq/f9qIVg/EBOCyp6+q3eNV vHGQMhLoAbeL65ZdNggmKmPnfEhz+sGotUFnT7w8z502RvKUmdBzNtNXVHwlZ3/NSrua g8kg== 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=UWUiMlIVuwGGgIHY/gUZt7g1P5zkEW6rf90kMaWG0ZmDy0ce6L5fTnaNNetxnyw3mO aZabR9P/m+q1dVwepEvNN4Y/5YueqJKTYCxA3UpnAjSaLbr92ncGAgr0GN0KR7KT1Tle rDhq/lBWZ24dKIo06y6yMAvw7Rocj4UYtWpOYvYwPx5gHrsvLq95FzqKEg/2i2LDmo8v /bf6CAzKGC7Bwzl6tPPU38I3vK9f1MENvZMNWOr2aZaQU6NXBvtc4/z1x8uCW9xJ/YRX 0sVYEihInc5KM8mdVeLIGyn2HSjA+Jk2L/PEM4RNETGlob0fCkwSPgtAu46Nl+HAcvkG pHkw== X-Gm-Message-State: AOAM531vBvUefE5yVfOHk8fkJgFQve9zbl0SMQ/0JFqMwIwQgafMtfNM Sy5Sinu/5oNEZWTz8m3VI3L2rxlS+CuZrA== X-Google-Smtp-Source: ABdhPJwZwiMZywH9aHoTgEhbdJOCJ/VexFLfpPz9Y2AUuzz2D3I+dBryPbmeF1TCD4cSQPGd2g8nxw== X-Received: by 2002:adf:d0d0:: with SMTP id z16mr10889736wrh.29.1626422649495; Fri, 16 Jul 2021 01:04:09 -0700 (PDT) From: Mahmoud Mandour To: qemu-devel@nongnu.org Subject: [PATCH 3/9] plugins/hotpages: introduce sortby arg and parsed bool args correctly Date: Fri, 16 Jul 2021 10:03:39 +0200 Message-Id: <20210716080345.136784-4-ma.mandourr@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210716080345.136784-1-ma.mandourr@gmail.com> References: <20210716080345.136784-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: -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: 1626422932226100001 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 --- 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 Mon May 13 13:01:37 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 1626422816058892.8509490095049; Fri, 16 Jul 2021 01:06:56 -0700 (PDT) Received: from localhost ([::1]:47326 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m4Is3-0003hR-BN for importer@patchew.org; Fri, 16 Jul 2021 04:06:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56036) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m4IpR-0007Gq-Ns for qemu-devel@nongnu.org; Fri, 16 Jul 2021 04:04:13 -0400 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]:41558) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m4IpQ-0005Kv-7r for qemu-devel@nongnu.org; Fri, 16 Jul 2021 04:04:13 -0400 Received: by mail-wr1-x433.google.com with SMTP id k4so11000427wrc.8 for ; Fri, 16 Jul 2021 01:04:11 -0700 (PDT) Received: from localhost.localdomain ([41.34.125.69]) by smtp.gmail.com with ESMTPSA id p12sm6558046wma.19.2021.07.16.01.04.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Jul 2021 01:04: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=qWN2HIRs01eKm6dhCHQnthOBil+q+4JpNVw/kRffS9E=; b=Ik/je3Kbpm5MBKnh9ysuRUlQYcKW81ukCUUPzizt+Z1UCkc+AZbaG8yQbVf0MF8uSZ x9tsZ5X7qSQZgDMZXE9dfShIlb8f+aMpeQ5IXM8pyy2aGIcz46RSbjPs3VeFhIpyDbcn +G4C4xbe3pnD5S7C7RZJ4/fxBZhKV4/at8aCQBLdyAUOz/e6VKnOob5LuC8J8x/IbuWC l/MHY83Po9skgTJcjBZNkpjdoq8jrjzyPuEhD78Fe7s6M1ZHTwjHZrfTLvIsrChAtQtK LR1uJ3NHfRnfy/9xE97zcl8vHvRxKSBJN9h99KIMeJ9Qv10NbMYZigdv/H3hAdyhOW0r w/sQ== 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=DuPESpxOVowt5ky+KAEDfCIw7WmTnS0K3zQ98Fqpuuka37pf7oiC5Tg7jmvUNtgDZS n1Xsv+dZt8GWnIHdFzJmaC4PlkSq7ZIckTxk1EbsOOC2Y6PcfHMgqx/p4RD+E3EfDgBA NtPpeqpVYthZS/NozPRvG5LpsblzTsJx7e0KsPHsErXstuNvStF2NcYIOucxJlUy0YDO v8YBguVJyKFZ/aEVYzHtA5sk/7bra2Rb472Q2tSBkSFiajlLW9gCcvCR9rWuJZ8SkmWf W2OFTXeQtbbZqJKePdXNdbY31X6a8LMZybn1pu0LUvDJYe4lGDtF+foIN2JSsOYXcphn ZdLQ== X-Gm-Message-State: AOAM530L0cVsqGDwDdyuzGUz0mRCpl0Pdsn3xSYfbR1BbrISFzKIKFch wFReRnxD+jDLnKjgfu0KAE9GBU6zT6/axg== X-Google-Smtp-Source: ABdhPJyGG7kYeXiI8mfx6rRsOSwiHGbfGimqAVoyqdTbi6ek59K7fHPih3AH2/PyPG/bOja2FZU1EQ== X-Received: by 2002:a5d:6c6d:: with SMTP id r13mr10656450wrz.227.1626422650795; Fri, 16 Jul 2021 01:04:10 -0700 (PDT) From: Mahmoud Mandour To: qemu-devel@nongnu.org Subject: [PATCH 4/9] plugins/hotblocks: Added correct boolean argument parsing Date: Fri, 16 Jul 2021 10:03:40 +0200 Message-Id: <20210716080345.136784-5-ma.mandourr@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210716080345.136784-1-ma.mandourr@gmail.com> References: <20210716080345.136784-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: -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: 1626422817727100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Mahmoud Mandour --- 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 Mon May 13 13:01:37 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 1626422932960115.69848547552272; Fri, 16 Jul 2021 01:08:52 -0700 (PDT) Received: from localhost ([::1]:52582 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m4Itw-0007Ae-3T for importer@patchew.org; Fri, 16 Jul 2021 04:08:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56052) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m4IpT-0007MG-FY for qemu-devel@nongnu.org; Fri, 16 Jul 2021 04:04:15 -0400 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]:38874) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m4IpR-0005Ll-Qe for qemu-devel@nongnu.org; Fri, 16 Jul 2021 04:04:15 -0400 Received: by mail-wr1-x42b.google.com with SMTP id g16so11033808wrw.5 for ; Fri, 16 Jul 2021 01:04:13 -0700 (PDT) Received: from localhost.localdomain ([41.34.125.69]) by smtp.gmail.com with ESMTPSA id p12sm6558046wma.19.2021.07.16.01.04.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Jul 2021 01:04: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=uxSIlbrXoEWYH1V4OiwJbAMOptfvw4FTT6WZRqT5wuA=; b=cx06bNKYyYIp1CvvQwB+RIrVkVtpGwePpRXLkRmkmOBIKu/8D0Xg6fBOP6la1aGiM0 J0ZIr9gLfZmAvCKYcKoonsngB3LD34UrzEwIl4rrA1BUFj/rDdvSohNqXFX15YW63Crc Lp8If3EcX6PwNuF7YDAIV8lBdJXoCxY0Y7wiAVhHFmlWgChIKYZB7k0naUVOrRMtVzQa 8Aj5pcJggLyzL600Dn0aZnPk51j9MY7Vrk4g4EiloJsa+BM8BaSxjn3jobwrHx/N4d1/ s80dcsnfepA31EboUrknT4g7b5KY8L596p4jJXWjqoAYuZe6UFm3TDV21g21GQd21gRO 53HQ== 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=JoHfCjkRWYvCk9q5l/fbXzkZ7Iqo92CGYQNb0TuiHmCIZ91FrMLJLr9XtqPPYv16rK h8sV/W4rcLw0Blmt1uQ+Y04n5UgOjgjJsmErR5Agbt2lYk5AvcKdcnnBbs7w5Je41Fmc qH+zvCtZDN0fhJMggOODfs+nbYFoYC3vqsSyhWrd6uNxZ8ojFUEslU5RfufUwsFMngIy HZ1jNKxps9GlV5xmZIoab9liblAgBECjisIcrQtb17sO22Vz5ZlqzaKwpOoYFAcHmdLG yp/k5QUFD+FOYPpGxf2HjP1QHq7ifjJKRYm+8OYfp7E1XJxowgTI+eIbXjULEABxX6S6 3UOg== X-Gm-Message-State: AOAM5317bC8tFNR59hwYJ/XsTp2QuYHNCXQSuucgrBpvMuUPWsaD9D/m GKb1SWnOvqhU/kCidw0zIIotw0e9W2zeBg== X-Google-Smtp-Source: ABdhPJy7mlmanLyFcOnQ1LYPwILB8MLAWZ2rZsZthE70i20f8UWIYaq1MEydHV+48pUXphwcNc1AnA== X-Received: by 2002:a5d:438c:: with SMTP id i12mr10778049wrq.99.1626422652354; Fri, 16 Jul 2021 01:04:12 -0700 (PDT) From: Mahmoud Mandour To: qemu-devel@nongnu.org Subject: [PATCH 5/9] plugins/lockstep: make socket path not positional & parse bool arg Date: Fri, 16 Jul 2021 10:03:41 +0200 Message-Id: <20210716080345.136784-6-ma.mandourr@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210716080345.136784-1-ma.mandourr@gmail.com> References: <20210716080345.136784-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: 1626422935624100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Mahmoud Mandour --- 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 Mon May 13 13:01:37 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 1626423044120742.1052432029174; Fri, 16 Jul 2021 01:10:44 -0700 (PDT) Received: from localhost ([::1]:60992 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m4Ivi-0004Ii-37 for importer@patchew.org; Fri, 16 Jul 2021 04:10:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56074) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m4IpV-0007Ss-Dz for qemu-devel@nongnu.org; Fri, 16 Jul 2021 04:04:17 -0400 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]:54784) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m4IpT-0005Mu-E5 for qemu-devel@nongnu.org; Fri, 16 Jul 2021 04:04:17 -0400 Received: by mail-wm1-x32c.google.com with SMTP id f190so3675922wmf.4 for ; Fri, 16 Jul 2021 01:04:15 -0700 (PDT) Received: from localhost.localdomain ([41.34.125.69]) by smtp.gmail.com with ESMTPSA id p12sm6558046wma.19.2021.07.16.01.04.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Jul 2021 01:04: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=FX5v+BKehc6DaRJmhosDluKPZkJTepgwovTu+vU/T/Y=; b=fTVTCqk4AEGprVqe1rUa0GucY5VVt6w5vvdXce9/TiE9AaEBxMBKDYeyN+3M6zTlkJ p+gVuTYvpvuz8qwMyd6OcJWvY/L8dH9FKevMlhCseVXSIZ/lFkMUjY3SbuR+EYLBvbst Zs3vZSr3CNmpj8FexAR18Fa30eOA0j588jDFn3OUm6VzsWWFNLl1nIo1c/V/ZI7ZjEAw BnLFb6SCv+hHg+XPecVrTwcAOCiYhj/O0Xle9jAReFXXG6yO8GSN+gdUNRO2rAhgd+UF ck1F7mffTRzQRqgSJEVdPxbBSG26E6IlQ80WB5AXr1HVa6jk9kPNApVN8Qm1YTOgB/8e P0Tg== 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=Xsaqdtri/FupLQZ0/JzbINCadVDTV+AVTrUAI0iw0Upmn94+myyOqGF2Wc/RvQk2as I9EMvlxeXZyQ7NIuwBVuUlRzTreA+U0QM68UWHK51OYTB2XNJ47cmtWLwUmp/EtEf681 WPOLEE0fck8aYmf2K3eUXfWQ4PhmWQ+Tg3kNIpBsto3yYk9UE83hecSVd3ogBxd3Z5vx EDrS/vv25ZC0sRfOKEL2/B4M6BaT5ULmjmt/rUuLlcKWd1THKitGJkgR+CYT48OAlwee MyEcIK24FJ4kzY/2D9joXVIG8ISIj8K5o0Dlf3cwkr3hIzCxnv56GMzaydTNr3zt8PiW jMXw== X-Gm-Message-State: AOAM530FYE7hkpjq3zbnV6Red0VKRREHmXKU1I53ZIF1Jr5rtNnE3ap+ jjZ07vW160DpeYBaIe8xRzIBI/SNWgUfTg== X-Google-Smtp-Source: ABdhPJzmcLoBBmoPFZ+4Gdtd1WNevO0sGOtcw0Gn5QdH3Diog/Qb9WlTq8H70V003m18CwXlDGms9w== X-Received: by 2002:a05:600c:221a:: with SMTP id z26mr15333634wml.34.1626422653662; Fri, 16 Jul 2021 01:04:13 -0700 (PDT) From: Mahmoud Mandour To: qemu-devel@nongnu.org Subject: [PATCH 6/9] plugins/hwprofile: adapt to the new plugin arguments scheme Date: Fri, 16 Jul 2021 10:03:42 +0200 Message-Id: <20210716080345.136784-7-ma.mandourr@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210716080345.136784-1-ma.mandourr@gmail.com> References: <20210716080345.136784-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?= 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: 1626423045574100001 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 Mon May 13 13:01:37 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 1626423163718571.3956891767522; Fri, 16 Jul 2021 01:12:43 -0700 (PDT) Received: from localhost ([::1]:38572 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m4Ixe-0008G6-CZ for importer@patchew.org; Fri, 16 Jul 2021 04:12:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56082) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m4IpW-0007VU-7Z for qemu-devel@nongnu.org; Fri, 16 Jul 2021 04:04:18 -0400 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]:34503) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m4IpU-0005Ni-Fa for qemu-devel@nongnu.org; Fri, 16 Jul 2021 04:04:17 -0400 Received: by mail-wm1-x333.google.com with SMTP id u5-20020a7bc0450000b02901480e40338bso6544736wmc.1 for ; Fri, 16 Jul 2021 01:04:16 -0700 (PDT) Received: from localhost.localdomain ([41.34.125.69]) by smtp.gmail.com with ESMTPSA id p12sm6558046wma.19.2021.07.16.01.04.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Jul 2021 01:04: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=QYlZr4m7peS7MfzAJi+qX2Ml7ux6aBoPT20UJbED7TM=; b=Q8u/VzysVLumGelup2D3K6a5x+WbXLAn6FFXL5g/gHegRJx9y09RlZ6RMYitho8dU5 ree/g51QL8oPoi543noBrnl67yvkQ7fwYJ65O+uH2gDgBQlm2WFqAdHMCUpAUfGERiIq +BFmrXmgoGi2/ctpF+SHx5EAFHTW3gcVp3APZdmWNHOAoKnSJQhAyWAwqXZylVYabK6D TQb75m6Tv62Vm+HQOpgHMx1v95e5hGmSlzBta7fAzwAu5/ZmoWqQFoZBjVcWukDBY/LT 4PEn/HmFp4ZfRlkuHqxpQMu6/c2ypuIMeLxNi7bspc0XkertkvK7QGq7AWZ5UwWhHUX9 tX2Q== 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=QYlZr4m7peS7MfzAJi+qX2Ml7ux6aBoPT20UJbED7TM=; b=dkwKcQqGbqbKPHfV/aXcp+8cGgu/XcHqiFkAA4FiQCr1ilcccJovS3agGkSbNZ3ANT bPvlDM+oAb/J1sIeG6f8fCy36n0b8Ppe/qkQZL/Z7lxAayzxXkZjGndDqcqfqt3xD3e1 nhV8zeNjYsSqftjUguZoRnGXeWOmMOdM4xFd1uOivraRoYOvTSQMEoJI3aB8tVjTF6Mt hvUv0X1gfHoGi/mhjAva0pE/8P+yJt7P+7oV8Uunhc3kQQmiL//HOXjrkC5CdGeCr5bu mixLkJQqiVHtV5XtVlbjMAkoW8b2LJK0aStgAIqEC9OAr05asLbza0gMD6r6MY4iiajN +//w== X-Gm-Message-State: AOAM530lHoaFZCvmUAu+4qJnbpOwx5GwQO1xK0LgMSI+mWpqnm0e9FTt tMJvvR0lCZtyRGPVgxqZWsNCdfa5QE/RoA== X-Google-Smtp-Source: ABdhPJy6JUW9e7rxhg+13mM03Evb/Zo8n9ZHqpfSzhItTmefGN64WcdVODUGjnetTUHCTXnZ2XEWqQ== X-Received: by 2002:a05:600c:649:: with SMTP id p9mr15269274wmm.151.1626422654877; Fri, 16 Jul 2021 01:04:14 -0700 (PDT) From: Mahmoud Mandour To: qemu-devel@nongnu.org Subject: [PATCH 7/9] plugins/howvec: Adapting to the new argument passing scheme. Date: Fri, 16 Jul 2021 10:03:43 +0200 Message-Id: <20210716080345.136784-8-ma.mandourr@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210716080345.136784-1-ma.mandourr@gmail.com> References: <20210716080345.136784-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::333; envelope-from=ma.mandourr@gmail.com; helo=mail-wm1-x333.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: 1626423166618100001 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 --- contrib/plugins/howvec.c | 24 ++++++++++++++++-------- docs/devel/tcg-plugins.rst | 10 +++++----- 2 files changed, 21 insertions(+), 13 deletions(-) diff --git a/contrib/plugins/howvec.c b/contrib/plugins/howvec.c index 600f7facc1..847baef214 100644 --- a/contrib/plugins/howvec.c +++ b/contrib/plugins/howvec.c @@ -333,19 +333,27 @@ 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; } 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 Mon May 13 13:01:37 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 1626422977001704.7409584636548; Fri, 16 Jul 2021 01:09:37 -0700 (PDT) Received: from localhost ([::1]:55860 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m4Iud-0000we-Mj for importer@patchew.org; Fri, 16 Jul 2021 04:09:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56096) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m4IpX-0007XW-8O for qemu-devel@nongnu.org; Fri, 16 Jul 2021 04:04:19 -0400 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]:38885) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m4IpV-0005OR-MF for qemu-devel@nongnu.org; Fri, 16 Jul 2021 04:04:19 -0400 Received: by mail-wr1-x436.google.com with SMTP id g16so11034010wrw.5 for ; Fri, 16 Jul 2021 01:04:17 -0700 (PDT) Received: from localhost.localdomain ([41.34.125.69]) by smtp.gmail.com with ESMTPSA id p12sm6558046wma.19.2021.07.16.01.04.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Jul 2021 01:04: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=rMLAuiSXBB39vnc7yIBeUjpUzjmirkB4ItWpH9noXsY=; b=cCOY0mC9ra/7SsDfebj/D08+Dy+nRckKIgX15ZlUSbpFiKB/d1Z6yWsMoCIIzuqlyZ k8pXv+voPpi1DKUhyKq9tCDg6t0miyGvLd6TVLhNkpmWOqF9Y3ikDogbr5C8mi/PliVF BiAttu61Mm0NHISJG+WjEjGnmaa7GKw9IGEkma946YwgdIDmWzbHR1FN1kXOQfPLxezp yHzdzvYe8/yOHLi/URx29MCRNkiRupR40/xATOns4KJAc8ei5J/FlAwqMAByGEOcISTJ Kp+kI+jdShwPzVvFkXxLjr0U+4rk/PvaND8UZm/fVOZQYrIiJX1deQNuYePc6fBwgwoQ ChEQ== 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=ecZzm4YUzfJpliEGj8uOs3FnYh0YCLR7eNl1NjbvJkadJfaKviv8ReBBRYW7hImVPk 4nC4/vsLIvT4bGq2WR6y+XQyI33hD1Li7O+F2omPd2ASyYWAB4PZ8dOxDWfZW3mivRvm Tf28w5GCTQLkLOUORq333yo/+448UBe3nUcDNb0Bk/3RjPvYxIyHojEevwZGSvg8suV5 QDbMDKiqVG4DxZ5SgqDywkJERwxiFp78faOX9QEYyNu7gCy8aaX6uCfYefrZDZ5krYZy OeKFouX3plrg+c5PRx2QM85B4YuUojZjYQqef9wBdBxMsLeDy7ZeQu0w2nWDiut1F9dJ 3j8Q== X-Gm-Message-State: AOAM533m0URwSyZeF0TkWBqlptVRBn5oAnz22+qdzRNiNUM/0rgjh6A5 zJngT/c8KvUYPpjvZhBXeN5WOdMDxS2g6A== X-Google-Smtp-Source: ABdhPJwxDcg8RW/1y8vMiobR8g1IMK2baLwzBxludvNyY48aR1tEE3ISYpTi7DJ0H4gqknastCGUTw== X-Received: by 2002:adf:ee0a:: with SMTP id y10mr10716594wrn.209.1626422656059; Fri, 16 Jul 2021 01:04:16 -0700 (PDT) From: Mahmoud Mandour To: qemu-devel@nongnu.org Subject: [PATCH 8/9] docs/tcg-plugins: new passing parameters scheme for cache docs Date: Fri, 16 Jul 2021 10:03:44 +0200 Message-Id: <20210716080345.136784-9-ma.mandourr@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210716080345.136784-1-ma.mandourr@gmail.com> References: <20210716080345.136784-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::436; envelope-from=ma.mandourr@gmail.com; helo=mail-wr1-x436.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: 1626422979293100002 Content-Type: text/plain; charset="utf-8" Signed-off-by: Mahmoud Mandour --- 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 Mon May 13 13:01:37 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 1626422977615250.7657474206943; Fri, 16 Jul 2021 01:09:37 -0700 (PDT) Received: from localhost ([::1]:55932 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m4Iue-0000zT-Kx for importer@patchew.org; Fri, 16 Jul 2021 04:09:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56102) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m4IpY-0007Yl-1w for qemu-devel@nongnu.org; Fri, 16 Jul 2021 04:04:20 -0400 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]:33419) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m4IpW-0005P8-M5 for qemu-devel@nongnu.org; Fri, 16 Jul 2021 04:04:19 -0400 Received: by mail-wm1-x32c.google.com with SMTP id g8-20020a1c9d080000b02901f13dd1672aso6573576wme.0 for ; Fri, 16 Jul 2021 01:04:18 -0700 (PDT) Received: from localhost.localdomain ([41.34.125.69]) by smtp.gmail.com with ESMTPSA id p12sm6558046wma.19.2021.07.16.01.04.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Jul 2021 01:04: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=TQ4eoAhFvF5WLmzSkOUBXUWpS6dwt1gpkEIzciIqlv0=; b=GzO6Z+mKwv8Q7n0/GPrPVD4J3L0YK8PFvSs/gsjnlEDRAP9yVjJXdaJlzQfsvgkSVM v7dukz2J6Z903xn4df79U5JLnzZdkNjot5zR20VlmfbMEZzVgvGJfEPyU8A1bm14BFQx dmu93HTBy2W73lbEFJfkMHMS98IGGNXpKW1xdv2QXW7p2+dOPmBwDYCeHf91Tf2iZCin HLREGWID/sroEL6Df+9bOwwb4dnEE3vbtuAWdEMfEQ31zjwPsCTHFC1eHyJTlZZx6pR2 3uXGdLEaWciHDJmBBQDnMUCb2vWKBQ3IIeQw7IX+mVppxFz4E6k6ZLdu0cKPJC+69YJQ 0SkA== 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=CYPTbMPAgkI71ZGVGep/7hPrrtfUau0dkmg2+0mi0yXdwm9iDCtXbggi2iyR9NkVV4 J5iFUmT0hJMs1o9yZN91zha7J9hmcbIiFgR+dRaChyfy4hEam6TpJqWlwMvTTGUroNT9 Oq+ELPSjJvI6/Pg1gFsQYyCUYYFpkg0iqcYlz8aNorp41PvH+WJQrfqhcZgdCJM872tj af09bbXDLr8yvfs9Tt/9Khc/WnmrtREp0A3XgILKySsw5tILJOBWDc3DLjLAIE6LsZ5d kh6KcaGaIDOM7X5Hase5Y99XYlbNPonuWpVXXnJ7mfNtoRN56QX+M2jyLkuakDT1EyGA Etzw== X-Gm-Message-State: AOAM530AP6shw3Fyp37Wef+HQGpPldJ6kWjj15KJiW7CLHlbtNsNVeEK TXCcdqiDKZkmUeAwiHwoCrIiszYwuvfhtw== X-Google-Smtp-Source: ABdhPJyTrjanosCqlPGlKoaAoeimkuvDariCCUwT1rqFiyr763n90S3Cy7AwFzVmmwJLBk1iEKfG4g== X-Received: by 2002:a05:600c:220c:: with SMTP id z12mr9128986wml.116.1626422657285; Fri, 16 Jul 2021 01:04:17 -0700 (PDT) From: Mahmoud Mandour To: qemu-devel@nongnu.org Subject: [PATCH 9/9] docs/deprecated: deprecate passing plugin args through `arg=` Date: Fri, 16 Jul 2021 10:03:45 +0200 Message-Id: <20210716080345.136784-10-ma.mandourr@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210716080345.136784-1-ma.mandourr@gmail.com> References: <20210716080345.136784-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: "reviewer:Incompatible changes" , Mahmoud Mandour , cota@braap.org 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: 1626422979290100001 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