From nobody Sat May 18 19:24:38 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 162693822345958.024850544379206; Thu, 22 Jul 2021 00:17:03 -0700 (PDT) Received: from localhost ([::1]:53796 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m6Sx4-0005hC-C8 for importer@patchew.org; Thu, 22 Jul 2021 03:17:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47890) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m6St1-0005z8-Ca for qemu-devel@nongnu.org; Thu, 22 Jul 2021 03:12:51 -0400 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]:51081) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m6Ssx-0005Li-6F for qemu-devel@nongnu.org; Thu, 22 Jul 2021 03:12:51 -0400 Received: by mail-wm1-x330.google.com with SMTP id l6so2721746wmq.0 for ; Thu, 22 Jul 2021 00:12:46 -0700 (PDT) Received: from localhost.localdomain ([102.44.10.38]) by smtp.gmail.com with ESMTPSA id v21sm1802871wml.5.2021.07.22.00.12.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Jul 2021 00:12:45 -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=mGWmTK71niMIoQ1vMh8Wy1odTeatcZXIhqhkzJx/rlH/qcZA4oxWEFMqr7bnrCBWwL KptRJm3NTH2Un81iO/MZtAfJUead3rQuQI5B7sKbQuVCf00Z8Dc1y5+RFaf6I/zIrMj4 xPi+vKlim3i6dmoxt9dDsr6TKu9Pl1mowsku8tmAKTCMPIonmybqpeQbnRlkaBp+2Z68 OT6ePcFneTIePtn5E5TNbIv0n+AlJAP0XJby4rCz8zjbBXnfqaGfLEbA9EXzptWtWPqB ycQzljHuJUIyGtGYPApobHK74GiWapYQXPEErIyQuhSv0QVTS+psNWHu53X4DWT7yu2y 8YNQ== 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=DkRPBOY6qV3rFJzGQH6UtCCSaSx5WFUEj4+JPo7dYKBBz/AosZBFZZx0up/+qVvrSg iP3POH/jDTr2Qspx+irdKyjDRweEvzG96p9TtyDc1eSdxrwF56hJq96EdlZcjH8Ia541 OmJXbiSty5xsXX4kgUrIpWu/+ZwsoKJ4yiakAOkEVpLCy7efTf4E0YV4845jDqB8kilo ri7vypSYe7cAujs+yp7Or6lfkm3rASZGK2zMy1mY7dQ5ticlh3NF3NMz0D8GQejmFJM8 XB5lZBDCpcXA4m4YDJG9nw4C6ll/jLlLkqJQ1Q4ywC3AGbTuw+iGs1QacSDK5Ul3Xitl gurQ== X-Gm-Message-State: AOAM5329whPneh2OVKSzA3TofE3hl5RZaXd1Zdc1Z8kH0FspMETUlPlR 0Xfb0sPgOw90ql1sQgiW4Zl2i0sNXXQ= X-Google-Smtp-Source: ABdhPJwrGI343L92kgZj2K8inXo90bCRMmE+39kmMLyzg//G5b6HG+S6P0lq4xWIdN/C7z3gSp8OKg== X-Received: by 2002:a1c:6a06:: with SMTP id f6mr5612573wmc.38.1626937965697; Thu, 22 Jul 2021 00:12:45 -0700 (PDT) From: Mahmoud Mandour To: qemu-devel@nongnu.org Subject: [PATCH v3 01/13] plugins: allow plugin arguments to be passed directly Date: Thu, 22 Jul 2021 09:12:24 +0200 Message-Id: <20210722071236.139520-2-ma.mandourr@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210722071236.139520-1-ma.mandourr@gmail.com> References: <20210722071236.139520-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::330; envelope-from=ma.mandourr@gmail.com; helo=mail-wm1-x330.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: 1626938224307100001 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 Sat May 18 19:24:38 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 1626938221609242.34690555001134; Thu, 22 Jul 2021 00:17:01 -0700 (PDT) Received: from localhost ([::1]:53620 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m6Sx2-0005Zz-KN for importer@patchew.org; Thu, 22 Jul 2021 03:17:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47878) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m6St0-0005yh-9E for qemu-devel@nongnu.org; Thu, 22 Jul 2021 03:12:50 -0400 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]:34699) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m6Ssy-0005My-KE for qemu-devel@nongnu.org; Thu, 22 Jul 2021 03:12:50 -0400 Received: by mail-wr1-x42e.google.com with SMTP id u1so4790941wrs.1 for ; Thu, 22 Jul 2021 00:12:48 -0700 (PDT) Received: from localhost.localdomain ([102.44.10.38]) by smtp.gmail.com with ESMTPSA id v21sm1802871wml.5.2021.07.22.00.12.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Jul 2021 00:12:46 -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=9YvtSymqUoD0Ep/Zs7OWqwqxy2FOGQ26RHoeEjgQ23k=; b=Uo+mlFhp6r5XrBESlTAeo+MckE1kfMAHkiFtwBx844BSW0Y2GqnAuCrUjaZqabxLsm rq7DdIc5I8+MUSGEuCgbUGye52C+Op/dYdkJNn4XsYfloH4nGXmORKCNuRiyOZ3VWcVg ACgrJNbCqb58SWi/L9RYjBK8YYjrOpDqo7D2UwkDdK2kyDUDV9MoQsxJW3mxESq+Nd2d 6FfG3OxwYK6HHM+HuJAvXdK5FIKwO51mPx0nPv5lAA+IWKPvSeJARWHGlYrk9ITZ9+4/ O3DS+Dw0W/Bq6Gmm3jBWFz+Ztpy8GbiHcNpC+PjRtB+pALMh62fFJ4EOLWiEXnMnaLy5 gQ9Q== 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=9YvtSymqUoD0Ep/Zs7OWqwqxy2FOGQ26RHoeEjgQ23k=; b=GjHBdvlmFigv5JeWBhl/mhxhcOiplFkfNzWuDThekRCC9Vy76bv/4fE4igKZ5ZoV1g YIgxl+ua+eyZdzv6LJma1m2vVoHK2d5hGMrN2zfMuySMFAeSCuFP1ZPkfJS+ogB7By0N clG3sPCqTkN6zWMF3r7ASgSEMapFWEDKEH+/iVY+4sW2aQRydNi5z603fL2KybLNsw0M 6QZh+tlQKBn+QeBdYOfYdXKIUAzsCjWf+w0DfG1UF/thXP3XpQgRamsRpTz6rp4hTdLb KUXhpAg60gBzcUKZCnx+D3UkHmlzHCS9NwD4iNVPkIpluUu1COgitpP1XrKOmjojUmHT fw9w== X-Gm-Message-State: AOAM533Z/4S9Q4guqNlgS2xCZ4GyXlHMbi/Qqd6TP5VlfqUbFbuFBHaM WReqk3B/9pFgSjt+8Johr7pJiSg89sg= X-Google-Smtp-Source: ABdhPJwy/tC4MFJiz4b1dUtSdfZvM0ZxGhwiPLg4JdV91TlQRf88MqXqgDlw949VUT88TBOfzgYa4A== X-Received: by 2002:adf:fd8a:: with SMTP id d10mr47375874wrr.108.1626937967065; Thu, 22 Jul 2021 00:12:47 -0700 (PDT) From: Mahmoud Mandour To: qemu-devel@nongnu.org Subject: [PATCH v3 02/13] plugins/api: added a boolean parsing plugin api Date: Thu, 22 Jul 2021 09:12:25 +0200 Message-Id: <20210722071236.139520-3-ma.mandourr@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210722071236.139520-1-ma.mandourr@gmail.com> References: <20210722071236.139520-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: -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: 1626938222258100001 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..404a1b6120 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 name && value && qapi_bool_parse(name, value, ret, NULL); +} --=20 2.25.1 From nobody Sat May 18 19:24:38 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 1626938358711324.7333484977346; Thu, 22 Jul 2021 00:19:18 -0700 (PDT) Received: from localhost ([::1]:33472 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m6SzF-0002Xm-8W for importer@patchew.org; Thu, 22 Jul 2021 03:19:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47894) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m6St1-0005zW-Ot for qemu-devel@nongnu.org; Thu, 22 Jul 2021 03:12:51 -0400 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]:55887) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m6St0-0005OK-5V for qemu-devel@nongnu.org; Thu, 22 Jul 2021 03:12:51 -0400 Received: by mail-wm1-x334.google.com with SMTP id p9so609912wmq.5 for ; Thu, 22 Jul 2021 00:12:49 -0700 (PDT) Received: from localhost.localdomain ([102.44.10.38]) by smtp.gmail.com with ESMTPSA id v21sm1802871wml.5.2021.07.22.00.12.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Jul 2021 00:12:48 -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=M5VlBMv+1xhtN/dKoeUxrkNxne0z8P6rIAiCLzB64L0=; b=kyMQL+zUomt/XEMRm7oP9/ZUz26l6L+zCQ2SLl/eHcXrEd7O7W3IVLI6O7l+eSvz2s c0KXqXtH+rMXYEzttjmErxZv+Wn/Xyp+Pt+aT7S4KclSIMe4p4NqYIHA9u4C2aJ/nbq3 1zlz/JBNv1JlXuue9MUG3R7p7axwXspaOrVrWno6aZXGjT2+ObJXT06eaBsGGIuV6Pq+ GPWLU3ywJNqODVUKtmwJiKpcwJkylnBU2XHr7J4uwTKp5rmZQs0a9cgr5pE+74D8bunh o6jK++ECWq7rXM+DhOgEB4SzhD1FP5W+5yV+TAsadqA/hp3tZvLkhoSp0eam3FxxLOB4 OL7Q== 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=M5VlBMv+1xhtN/dKoeUxrkNxne0z8P6rIAiCLzB64L0=; b=bY6su6tPsfIlGRjlBM5196y7ix7hMfXE9XLBfA4Po9TJ2xhd6Uhf6DiBDUo+lRyhFO 1VOeBkjQbn0Lp2xYRopBZqlD5uoTzPU5AdhW9DhA0TRzDE1vfkFZbbq7N1bBRSHi69sv +8BduFRj5arBNp7VEtG4jxT73l8BxaREzDCb1ANch7aRVtNO6nDAakP/Xy1n3WWs3awa 9eFWVbcqrUJjyDaVJno9tMM9Hsl9bkqhdgGrrfkBAC95uEjErKXHgTvC0Kqo3G1QugAG EFPCqV+NXxKXvZiUNLwzs+7APAHOk9ZBup6o4z5eDfCPNAhoC9GzVm9JPfMxLsUKVRgM y1QQ== X-Gm-Message-State: AOAM531ZMEX7e+Ou7S9WiHJuOOyu71mYo6GPG5ea8gm+Ue6CUO3AZOGO hKPjExcnhV2blR8r+sNpSv+m0zMmHMQ= X-Google-Smtp-Source: ABdhPJyxPTNdRi3SC9lWQ6hXV1i7rDZyM/DBEtVeFR2wgnF+tLsUdt2dLFRqpPaa4xuQnCXsGgDRNA== X-Received: by 2002:a1c:7e44:: with SMTP id z65mr7658395wmc.1.1626937968537; Thu, 22 Jul 2021 00:12:48 -0700 (PDT) From: Mahmoud Mandour To: qemu-devel@nongnu.org Subject: [PATCH v3 03/13] plugins/hotpages: introduce sortby arg and parsed bool args correctly Date: Thu, 22 Jul 2021 09:12:26 +0200 Message-Id: <20210722071236.139520-4-ma.mandourr@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210722071236.139520-1-ma.mandourr@gmail.com> References: <20210722071236.139520-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::334; envelope-from=ma.mandourr@gmail.com; helo=mail-wm1-x334.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: 1626938360723100001 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 ++++++++++++++++++++---------- docs/devel/tcg-plugins.rst | 15 +++++++++++++++ 2 files changed, 35 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; diff --git a/docs/devel/tcg-plugins.rst b/docs/devel/tcg-plugins.rst index 370c11373f..d09c349234 100644 --- a/docs/devel/tcg-plugins.rst +++ b/docs/devel/tcg-plugins.rst @@ -192,6 +192,21 @@ Similar to hotblocks but this time tracks memory acces= ses:: 0x0000000048b000, 0x0001, 130594, 0x0001, 355 0x0000000048a000, 0x0001, 1826, 0x0001, 11 =20 +The hotpages plugin can be configured using the following arguments: + + * sortby=3Dreads|writes|address + + Log the data sorted by either the number of reads, the number of writes,= or + memory address. (Default: entries are sorted by the sum of reads and wri= tes) + + * io=3Don + + Track IO addresses. Only relevant to full system emulation. (Default: of= f) + + * pagesize=3DN + + The page size used. (Default: N =3D 4096) + - contrib/plugins/howvec.c =20 This is an instruction classifier so can be used to count different --=20 2.25.1 From nobody Sat May 18 19:24:38 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 1626938039850605.7619022519285; Thu, 22 Jul 2021 00:13:59 -0700 (PDT) Received: from localhost ([::1]:45666 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m6Su6-0000Cr-Px for importer@patchew.org; Thu, 22 Jul 2021 03:13:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47904) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m6St2-00061w-S8 for qemu-devel@nongnu.org; Thu, 22 Jul 2021 03:12:52 -0400 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]:33291) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m6St1-0005Pp-DV for qemu-devel@nongnu.org; Thu, 22 Jul 2021 03:12:52 -0400 Received: by mail-wm1-x32c.google.com with SMTP id k14-20020a05600c1c8eb02901f13dd1672aso1974124wms.0 for ; Thu, 22 Jul 2021 00:12:51 -0700 (PDT) Received: from localhost.localdomain ([102.44.10.38]) by smtp.gmail.com with ESMTPSA id v21sm1802871wml.5.2021.07.22.00.12.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Jul 2021 00:12:49 -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=bnXzRNou3B0QNiGKhYYdq9XybemWfoFTodXM4iK0Ph/nWabvtdRK3ub7Tx0iQKySsX 4T12bGJZqci6f8M64fCoB//E+s49mqqoa5rMR2fxbpdd4C1zkufysdwb5XpDnYys6TKv ijKSUY0+rC8j1didsr/5Zfc7/k/Ldi7WbrPMquE8lI1CoXV2exX40t4nZ+tK7VRQwRTT STsa84cGixL26RVpyj1jHXok0QzFl2izAEATvYoX4m4lziU2xaUtRQQXl9bEXsiGG8wE m2hl6Dc++xVNP802vx5pBADbjCjkIGQGY9R74lwscr1hN5BAQQC2HYITMqWg2l0Qg5iH 3oSg== 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=GW4QH2qWCQ8Gv5EorPMSWK9GulgMhIQGCwDTQujtrT13Ty+jQbfqQKDOsS2cUw1jtH lPv8WZQQxTzTaNIanGZpk6RFGcy/BlAyZjwyMMVbWKO10lgkUqn6dsywm425VPTTWhU6 MeUJtfI+X7J62WxJ+lTpDyVLuCAsjixY0WHrQ9JhdYy/L6t7ddLTmP+Mobuqhpu1Zomz 7t92l4iKYPp0Vp6KBBXatpwso06qVEs5lwvVPB2m+RVqSh+5hoXOkLPJPJMCx91X8d9/ Cjl/mVwpRpiTu1j0Lc0b3RAIzIa9k4MRs61hGoH0QHYuaGa3sstTQI4xEcqbF7fluxhr ejxg== X-Gm-Message-State: AOAM533i2lLuc5jjBELgZepIVbACWP316xHTCvTp94Qd2GVtmFkaRE3M z86DZvcFwcW5XnHJph85VS5SnYJgSu4= X-Google-Smtp-Source: ABdhPJxbPKmfNwZVc8gbzzUwMRDdS5ucF15O/tvTw5/RBP5Jna+JI+jM2n0fHTg7B4zYx6rcOWzXLw== X-Received: by 2002:a1c:7410:: with SMTP id p16mr7392085wmc.6.1626937969995; Thu, 22 Jul 2021 00:12:49 -0700 (PDT) From: Mahmoud Mandour To: qemu-devel@nongnu.org Subject: [PATCH v3 04/13] plugins/hotblocks: Added correct boolean argument parsing Date: Thu, 22 Jul 2021 09:12:27 +0200 Message-Id: <20210722071236.139520-5-ma.mandourr@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210722071236.139520-1-ma.mandourr@gmail.com> References: <20210722071236.139520-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: 1626938041676100001 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 Sat May 18 19:24:38 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 162693822858557.41588723972245; Thu, 22 Jul 2021 00:17:08 -0700 (PDT) Received: from localhost ([::1]:54216 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m6Sx9-0005zO-HV for importer@patchew.org; Thu, 22 Jul 2021 03:17:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47916) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m6St4-00065y-DR for qemu-devel@nongnu.org; Thu, 22 Jul 2021 03:12:54 -0400 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]:47050) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m6St2-0005RF-Tj for qemu-devel@nongnu.org; Thu, 22 Jul 2021 03:12:54 -0400 Received: by mail-wm1-x334.google.com with SMTP id o30-20020a05600c511eb029022e0571d1a0so2331646wms.5 for ; Thu, 22 Jul 2021 00:12:52 -0700 (PDT) Received: from localhost.localdomain ([102.44.10.38]) by smtp.gmail.com with ESMTPSA id v21sm1802871wml.5.2021.07.22.00.12.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Jul 2021 00:12:51 -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=WhizFxo4aiOW3Z39CzCqIEDI8mj9ApvcpvEv89MbsmY=; b=S8bFOL6+KVOnxC7crcoSFj1HT3JXrWNdNVEW/JJw271wF6rskvKyDfJTbwFck1mrXm YJamh9nwKCZjpTHJylNPjg4cffMzHlSE4EhAF6t4zElCKG9WnmuW6Y7YHQEKX1WVQH6c CZROAagx0gCgTrT4elZuG94lIBqEAqpSCqDnrC0aHLdNM8OJpmqdAr2rmUp/Vsx7szA0 9ME+hmNRGBzZw1DftLKcWg/WBw6NyU9mhyAilpz/6t7uEG7+aRdokUssMzjuWxZzBSwI kbLGSk298Rg5orJySoamxKZKDBt+DdkvAynxKLJQFm6JQHGZkisedSGw+Y8H38bISe/U 016Q== 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=WhizFxo4aiOW3Z39CzCqIEDI8mj9ApvcpvEv89MbsmY=; b=F9Fq+SVOcFCR0+Q75OF/otZLp1HVYdXHLeOseKQ1SAgJXB2P0d706SHWTJXSQnWrwY qstKdHbhDZXiUgxlqq61CuPW+j2U0c+yHTGxcSe1W6Kn54rh/q0O2JZR/UkRpx6Orqof 3a2cBnyrUgqnLml6nxHggfuaJ4NlQeMtJD6BagZZR0p+CxxCsBMNiK1kiBQD31aY49Wj rR5TgxjDNqCspcu6C2wP6QFcLcPTrvvI8YFyn64QQV+BJ1RR5fr/jUVtY5Ox8Lb6s56N +PGP4m0usLDKz/ggbHQM1PiJ6V/k2e+JeePMrckGlndRpVQUASS2udxRIK5fTVc5vtNd RSmw== X-Gm-Message-State: AOAM5306zd1yl+oXakwwOZPMucIRyUcqnz8UNH/0SIcUPSK/QogszwkD PWfFqNJOkmbOR+O4p2i6GmPYNnOMPgE= X-Google-Smtp-Source: ABdhPJzsvr655s3UtsF4oAFJt+NyB/3y72RySG4z0LPBsIug12AgmS3Mq0vWrxn8D00c8XJmgVDefA== X-Received: by 2002:a1c:4e0c:: with SMTP id g12mr7580725wmh.120.1626937971442; Thu, 22 Jul 2021 00:12:51 -0700 (PDT) From: Mahmoud Mandour To: qemu-devel@nongnu.org Subject: [PATCH v3 05/13] plugins/lockstep: make socket path not positional & parse bool arg Date: Thu, 22 Jul 2021 09:12:28 +0200 Message-Id: <20210722071236.139520-6-ma.mandourr@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210722071236.139520-1-ma.mandourr@gmail.com> References: <20210722071236.139520-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::334; envelope-from=ma.mandourr@gmail.com; helo=mail-wm1-x334.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: 1626938230631100001 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 d09c349234..1cb8dee240 100644 --- a/docs/devel/tcg-plugins.rst +++ b/docs/devel/tcg-plugins.rst @@ -285,7 +285,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 Sat May 18 19:24:38 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 1626938365174928.272360477598; Thu, 22 Jul 2021 00:19:25 -0700 (PDT) Received: from localhost ([::1]:34182 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m6SzL-00030m-Th for importer@patchew.org; Thu, 22 Jul 2021 03:19:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47938) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m6St6-0006BG-NK for qemu-devel@nongnu.org; Thu, 22 Jul 2021 03:12:56 -0400 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]:44829) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m6St4-0005S9-Lq for qemu-devel@nongnu.org; Thu, 22 Jul 2021 03:12:56 -0400 Received: by mail-wr1-x42a.google.com with SMTP id f9so4746973wrq.11 for ; Thu, 22 Jul 2021 00:12:54 -0700 (PDT) Received: from localhost.localdomain ([102.44.10.38]) by smtp.gmail.com with ESMTPSA id v21sm1802871wml.5.2021.07.22.00.12.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Jul 2021 00:12:52 -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=YM9lSqkX/63SYJ35GkzH3H6NlxnAItXlDoJMddZrrag=; b=Tu5/0zCpPXggKABRh2lMhDPDVf7T7wuWxww7OzDBWh6UnX/zxcWBimLPWvlje/naNT ICo085fO0XMfzc0QDTdiWh8ceJsGbKFqVihvEFpUpz6e5flSxLgU2hQ10zmeY1d+gAmM noMsby1sY/Cz8hdbVb1bIGnMFLVbfPg2zScJpymJyUF1azmespmNK7yikFAGAAsyYXBN 8l2KPCDaXpVp6UHE5d0GpDh2uqdkEXhOb7TrzcjhFPvG3UnBUNtVdrQ9vDNjzPLvkQQr xZWVPFO0yJ3BlTQwj3b1EOZH45thsSPsf8Fh84LwzLPMOiq99dyiX1QXzauwyPaCRhfu p2+w== 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=YM9lSqkX/63SYJ35GkzH3H6NlxnAItXlDoJMddZrrag=; b=eJgDP/qFejPBXsRnmLbAKakTupuP7L+Kl90uMXuzkBOBk8LR+VQHxsLBUtQNMttjLh qyKty+PcfZGlzjMNUaV5elep2aIAhm9QJE7zLKwQWELq7up7PK1kVsa6fhyxTcyIZ0sa VxjwqT2hH3lEkVDX6kM2Uk8OXDlsZT8FoFY6id/TTTyM5xv6KRxVIKAyGR21z6WN3Cim +eW/qHvxST3ttr0NUw2e2gsJkaps4ECCaqXvupX46pYBMP6eO88oqB5kI8ihF2kSrJWC aSnrxnFBKHmrq7l9qAnxwRz3sGcZBusy4Z5CFrhMHCVNi2Ck3jELk2019sO0y1RsWRKn Hehg== X-Gm-Message-State: AOAM530Wh0OgZh4mDA6qssExfPUflQj/XY6Fp69aaLaXtWz7Nb9FTiD7 Tr6x/GXDpQOce/g/h0LlaaEgBN+aFp0= X-Google-Smtp-Source: ABdhPJxhoPCKtQtULfnM4Wg5pCVz/Va4gvUevGc8yHAqOun97Xa0clOQPfw6uAjpqSg7y6ZeZcNxZg== X-Received: by 2002:a5d:6c6d:: with SMTP id r13mr46355856wrz.227.1626937972857; Thu, 22 Jul 2021 00:12:52 -0700 (PDT) From: Mahmoud Mandour To: qemu-devel@nongnu.org Subject: [PATCH v3 06/13] plugins/hwprofile: adapt to the new plugin arguments scheme Date: Thu, 22 Jul 2021 09:12:29 +0200 Message-Id: <20210722071236.139520-7-ma.mandourr@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210722071236.139520-1-ma.mandourr@gmail.com> References: <20210722071236.139520-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::42a; envelope-from=ma.mandourr@gmail.com; helo=mail-wr1-x42a.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: 1626938366959100001 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 1cb8dee240..b7148abef5 100644 --- a/docs/devel/tcg-plugins.rst +++ b/docs/devel/tcg-plugins.rst @@ -305,22 +305,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 Sat May 18 19:24:38 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 1626938478935207.6286422214531; Thu, 22 Jul 2021 00:21:18 -0700 (PDT) Received: from localhost ([::1]:41920 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m6T1B-0008Dn-W4 for importer@patchew.org; Thu, 22 Jul 2021 03:21:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47958) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m6St8-0006Gp-87 for qemu-devel@nongnu.org; Thu, 22 Jul 2021 03:12:58 -0400 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]:37688) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m6St6-0005TH-46 for qemu-devel@nongnu.org; Thu, 22 Jul 2021 03:12:57 -0400 Received: by mail-wr1-x42b.google.com with SMTP id i94so4764909wri.4 for ; Thu, 22 Jul 2021 00:12:55 -0700 (PDT) Received: from localhost.localdomain ([102.44.10.38]) by smtp.gmail.com with ESMTPSA id v21sm1802871wml.5.2021.07.22.00.12.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Jul 2021 00:12:53 -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=n3SI7N3Ch+OuHorYlLp6xG6roUvzBNOvr6zAzTv7Az0=; b=VMroZWjB2WuEThzwMedGEiqo5wu4uEmH4hwtF5vv0TC9NneqMr+71dnLPN7cGcP1vX 7RL9dR/WTXt9QD1SiJsZxbUVc0V9AFpgPbon10XIYqQH5mUW4yMM2YW7mNsHz5hj/TNY uoBEyNup+qbntIZK6gWwadu/YtwyRGC2cN3SaicvDIjJKhXWK0P9FP0L+8LyBUGJgJa3 GvMw+Kf8Qkg9wege5FQqEeS6lJO342k7nuvufxSZVTxv5LPyLISNQbgjC3iZBu9RTLhV F+qhpCUnmh77iH/03/bsPjUmlvRSVMOm4qn5rK8Np1ejh6qFj8RCdP/bPDnNJZphjuh9 fnZQ== 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=n3SI7N3Ch+OuHorYlLp6xG6roUvzBNOvr6zAzTv7Az0=; b=ppZvSB9Zlkmn0N+cw1dAPQVpBS/d0lNms2DZBL8iSZEUqjo/Esc3lk1o3IR8yRtssq WoeVbEkibz5NDbZxgIQrHb1Fs3bcZFfdeWHhmp8CV4R2Q3hqeW3/U9Jjx5rA7sn3cpGx E4HzRFxpbXbr/1CDN21M4ntPdC4/li1HTGf0DjRKLzkuqmI30ItuYA1uBu0GFWVOPiMp P+hJ5oazuYvBDz6WpV4wN4fbQGTFO1uaE5d7M30PBz1tU0cSYQWTHVcmxVo46QTIySef GJYnh0e6yCHCHXQe16Mcb/1hlNwSAH+Gzz5ldzS/fRT+0YcqWaM/AWejoxvTY6121+0F lIfw== X-Gm-Message-State: AOAM530ZElsv0VC8R6NCeu2XO5klkeBlWC/xMz5JKFgkAMXw3kVooUN8 jd8qsIxT/Tsi4cLnmVXdYMX/oVzUJBI= X-Google-Smtp-Source: ABdhPJy6wmeqYVVQTJr0wQmfgYxPvhImzqkqwCe+ls/pk9oOWAUE3XYIk6oNYTULZyUZHSfGsK90ig== X-Received: by 2002:adf:f9c9:: with SMTP id w9mr45815498wrr.107.1626937974325; Thu, 22 Jul 2021 00:12:54 -0700 (PDT) From: Mahmoud Mandour To: qemu-devel@nongnu.org Subject: [PATCH v3 07/13] plugins/howvec: Adapting to the new argument passing scheme. Date: Thu, 22 Jul 2021 09:12:30 +0200 Message-Id: <20210722071236.139520-8-ma.mandourr@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210722071236.139520-1-ma.mandourr@gmail.com> References: <20210722071236.139520-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: 1626938480982100001 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 | 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 b7148abef5..9377bc51d8 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 @@ -211,13 +211,13 @@ The hotpages plugin can be configured using the follo= wing arguments: =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 Sat May 18 19:24:38 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 1626938472432597.4934960334758; Thu, 22 Jul 2021 00:21:12 -0700 (PDT) Received: from localhost ([::1]:41538 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m6T15-0007yL-Ac for importer@patchew.org; Thu, 22 Jul 2021 03:21:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47968) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m6St9-0006KG-1f for qemu-devel@nongnu.org; Thu, 22 Jul 2021 03:12:59 -0400 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]:41772) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m6St7-0005Tf-DO for qemu-devel@nongnu.org; Thu, 22 Jul 2021 03:12:58 -0400 Received: by mail-wm1-x330.google.com with SMTP id p15-20020a05600c358fb0290245467f26a4so2349591wmq.0 for ; Thu, 22 Jul 2021 00:12:56 -0700 (PDT) Received: from localhost.localdomain ([102.44.10.38]) by smtp.gmail.com with ESMTPSA id v21sm1802871wml.5.2021.07.22.00.12.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Jul 2021 00:12:55 -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=wz+9PQgNBB9NOSlbXOCgDYqNMDqyiiLq1Squ3vsDqRY=; b=FFfYFXZMCEky7zEF74Tteo3omJPaJu+WKTJ2ITIU+Ii74M5DlPQN/mgm9sLVIspBmN IgD6hTxSxwc0V/YsGX7FHWDL3HM3Knr98os9JvrznEIp1MHX9yra8bFvwajsfveysCSs /8Oofyt5DNlG6lhCVSKJW1rGoJ/BQOhxRx+9PKBxVZeQTdsqLDgX9J5PG9t3bqb4KJ7s kPHAzEy42AjmZbP7xxlLhZvsQn2Sye5oQrH/FveOJc+tN49MW6YREd9yPx3191LBhXkq P9+BYzJnPVj64pwY9dr8LitbyXVH2GaM7aymtfJAOpsFPHysuQTl29Ajktmy5CZ3tuHg hysw== 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=wz+9PQgNBB9NOSlbXOCgDYqNMDqyiiLq1Squ3vsDqRY=; b=J7ZH9gDj4ohioXUvGyME/Z7F3OmsMMrlx6tJq2GAnnGomWWvz6KoqJy/XQG/bkbEir HBACmmtnpP5KqLkBQM4tTo7mdZTOb+BH7bsSlaPKsMN9Tqjf34ZudIQuOpc5YvH9PK6C 5smVMucrrgOjrTiHtjS3BmQvoDL9ISBLWsGjb3bp6pDgbNICuENB6h7ZNo5EyXYKc2my TRsKrPYk/XVVi4IgfW/jUHu6vKK5sXddyH+g02HJHKTOrnpcW8bdnSqmW8PfUYpSc64I QEB7II/wWjKTQiMPJqKGQbq8XABAyQXvw/yAbqJ3reUJWuUrVSj7WaDhYalIGM9u+XBT C9/A== X-Gm-Message-State: AOAM533LAc5eOW+POSO+ugiLum8wBKbUTurVdAOEPXEK5ETWr/bMfxrR WDQmZqmzisy0YgrdNpXsoQdcWMIldP8= X-Google-Smtp-Source: ABdhPJySLhvRVm0b3MO+nXeg3iMTs4SfDYYJ8JVzUfSeMS6zfMzrM419lYNWv9g7oqaIBStBi9/bag== X-Received: by 2002:a1c:f414:: with SMTP id z20mr7792519wma.94.1626937975693; Thu, 22 Jul 2021 00:12:55 -0700 (PDT) From: Mahmoud Mandour To: qemu-devel@nongnu.org Subject: [PATCH v3 08/13] docs/tcg-plugins: new passing parameters scheme for cache docs Date: Thu, 22 Jul 2021 09:12:31 +0200 Message-Id: <20210722071236.139520-9-ma.mandourr@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210722071236.139520-1-ma.mandourr@gmail.com> References: <20210722071236.139520-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::330; envelope-from=ma.mandourr@gmail.com; helo=mail-wm1-x330.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: 1626938472683100001 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 9377bc51d8..7b1a3921b6 100644 --- a/docs/devel/tcg-plugins.rst +++ b/docs/devel/tcg-plugins.rst @@ -364,34 +364,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 Sat May 18 19:24:38 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 1626938404174770.1896452859644; Thu, 22 Jul 2021 00:20:04 -0700 (PDT) Received: from localhost ([::1]:36830 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m6Szz-0004ke-4S for importer@patchew.org; Thu, 22 Jul 2021 03:20:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47994) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m6StB-0006T3-7b for qemu-devel@nongnu.org; Thu, 22 Jul 2021 03:13:01 -0400 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]:41924) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m6St8-0005V1-GM for qemu-devel@nongnu.org; Thu, 22 Jul 2021 03:13:00 -0400 Received: by mail-wr1-x430.google.com with SMTP id k4so4768994wrc.8 for ; Thu, 22 Jul 2021 00:12:58 -0700 (PDT) Received: from localhost.localdomain ([102.44.10.38]) by smtp.gmail.com with ESMTPSA id v21sm1802871wml.5.2021.07.22.00.12.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Jul 2021 00:12:56 -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=aHGXbQWsv3gabJrXsECmcYTyQtBn3lPm/IrpHx0Ndq7A6BvYm3no97oQENQ6NLtVLA RufsUw41bUDz2rB9kziP100gu8hmt/60Z5c4ZL2hKDLb99Y11SbHbs96UyjdrAsyjju1 QBtjhccSu83flM2boWSC9d8aZgYF3tNsnCrbO4Hy51/YOXyF5geeNJ8dOB4QaAcUIyF9 WWhuoD4XHsobU1xY4R+/7T9RUBTPl50Yt5yEiuIqxwOk6Bw/e61thtk3rjuyr1A676cG jSAvTzsQ2efPQQT8ZtF9SwvI8ypB2N7uJ8stSzY7rN5EEzL2QWSZe1KUI0MRR5AcKUmV VtKg== 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=DBEVA7N05TT8pv8eJSQhjZRtMOg6fCj0oJ2AV+m6YG9JI06I9nWYD7tzwyuBr52tYA KLANNL4YoAWF8jRm2CXu5HgGXjX0dfyNCq3Tii/qqd5KrPGYvkSBNB4dj/uo+LeI4KUt irMWDukC6KjN5t9Nd4y80pVrFkh8fAy1z73XlybsMxhMM/r8jOKJs3tpuYi4VU5u9lh1 JKID+ODBbcsv+xisobFAMx0ThNhbpIj541FqBHbkB9XCL7sM3162gV/ZbCuK4ObNrVQP /v3LvHHtXhlEQfTxMEcVtt2grveGFRvIyD9/XlOcmZQa6f79ZLT2V4IcgysY3LZaDsSm KKXQ== X-Gm-Message-State: AOAM5325xs8Lagg1Qh4EJ8tl/BxOxTJhrXjsaYdqSLuWrde7Mi5UgVvQ gjf7EVwcs/UEHDr5w9J51ocQfsWmYsc= X-Google-Smtp-Source: ABdhPJw5CHWMWvRUl2GcmmOQ5kz3LXdcLvTddAYYM+sG65SdFDw6xMzXRMA2DcDX+6YrQptCfLvUxQ== X-Received: by 2002:a05:6000:1544:: with SMTP id 4mr47734564wry.288.1626937977032; Thu, 22 Jul 2021 00:12:57 -0700 (PDT) From: Mahmoud Mandour To: qemu-devel@nongnu.org Subject: [PATCH v3 09/13] tests/plugins/bb: adapt to the new arg passing scheme Date: Thu, 22 Jul 2021 09:12:32 +0200 Message-Id: <20210722071236.139520-10-ma.mandourr@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210722071236.139520-1-ma.mandourr@gmail.com> References: <20210722071236.139520-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::430; envelope-from=ma.mandourr@gmail.com; helo=mail-wr1-x430.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: 1626938405747100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Mahmoud Mandour --- 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 Sat May 18 19:24:38 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 162693857059839.733407656857366; Thu, 22 Jul 2021 00:22:50 -0700 (PDT) Received: from localhost ([::1]:44984 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m6T2f-0001qc-KP for importer@patchew.org; Thu, 22 Jul 2021 03:22:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47996) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m6StB-0006TI-FO for qemu-devel@nongnu.org; Thu, 22 Jul 2021 03:13:01 -0400 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]:34707) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m6St9-0005W8-V1 for qemu-devel@nongnu.org; Thu, 22 Jul 2021 03:13:01 -0400 Received: by mail-wr1-x435.google.com with SMTP id u1so4791472wrs.1 for ; Thu, 22 Jul 2021 00:12:59 -0700 (PDT) Received: from localhost.localdomain ([102.44.10.38]) by smtp.gmail.com with ESMTPSA id v21sm1802871wml.5.2021.07.22.00.12.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Jul 2021 00:12:58 -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=DkGP6sXMmwp3ds9M9m4o4yV6tmuP/fpq6w09dV7vkTQiteGQp6w583yA0Gv+62fqzv 4dIZrHh8TeyWQRtN5M2C4spve2nXz7ZM9LstnS+xWpDUyUWFSGxxdLLrR6GZ0nSPdP50 DrrVu3pm5mCEJgBMb97/yMJUfohrhEGTcgb54TAL3QNiYNGWLmgmkoJKPkiAjDeP4nu+ +vd/Vx16Mpydi498SSBRzx89rPz7bS8JyMqtEKlAKEjPakKIlIrZqGesl0B9HvIA1N7K qIsrkmOVGGO9CHMBJufE3RMVqIKDtamkM5WYBQnaAUb+KLHd3RHEyH4vQ1uvcVFdydMX OsBA== 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=sPohf+2dPVyFgZv4MGr6m3bWgdHagFQ4qzLXASV5E2SbLIPED4uEnv5kLO2NeQXl48 uF5J7nsQIHbapP1Z9DXJS71P6h/roCo0DzdtC0v4eie7iNECvb+2+BAy70GtSXv86CM5 6YkWZK+yuuvS3a0ixq5HTePq0H+YQB6XmOWlf2nP3HULbOA5Xm/n8lbhJLl1ZqpGkwD2 NbCzYXqX9GxgPX/ZuSjREInaFMDe1p7nT+Aq6oiRyiYW0UYPKEIniv8rOMcj3e18C1Vu PudifvyZrWrpqJ/FF9kLJeEo8zpWUAciBykvuyN8YXJDkxPEshP4HHLHHntmcpAeLo7E +apQ== X-Gm-Message-State: AOAM532tuasglhfwdtog+o6eE6qi+7KwUxkC9+bvIK8u+zH5kBsiCDNS bD7fEC8cbkFxIQWLPcNCfhlEd+DdD2U= X-Google-Smtp-Source: ABdhPJwU82LDKw5fcB2K+PtoxSzxkJ5XYLmduhCSd7Ix2Gl67G3Sy4VdRbZy6iPNLOtQ5wTxz8x9AQ== X-Received: by 2002:a05:6000:1a86:: with SMTP id f6mr26555386wry.127.1626937978487; Thu, 22 Jul 2021 00:12:58 -0700 (PDT) From: Mahmoud Mandour To: qemu-devel@nongnu.org Subject: [PATCH v3 10/13] tests/plugins/insn: made arg inline not positional and parse it as bool Date: Thu, 22 Jul 2021 09:12:33 +0200 Message-Id: <20210722071236.139520-11-ma.mandourr@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210722071236.139520-1-ma.mandourr@gmail.com> References: <20210722071236.139520-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::435; envelope-from=ma.mandourr@gmail.com; helo=mail-wr1-x435.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: 1626938572001100001 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 --- 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 Sat May 18 19:24:38 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 1626938050480531.1226146181161; Thu, 22 Jul 2021 00:14:10 -0700 (PDT) Received: from localhost ([::1]:46756 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m6SuH-0000xe-GI for importer@patchew.org; Thu, 22 Jul 2021 03:14:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48012) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m6StD-0006YT-5r for qemu-devel@nongnu.org; Thu, 22 Jul 2021 03:13:03 -0400 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]:38417) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m6StB-0005Wf-JP for qemu-devel@nongnu.org; Thu, 22 Jul 2021 03:13:02 -0400 Received: by mail-wr1-x432.google.com with SMTP id c15so4770529wrs.5 for ; Thu, 22 Jul 2021 00:13:01 -0700 (PDT) Received: from localhost.localdomain ([102.44.10.38]) by smtp.gmail.com with ESMTPSA id v21sm1802871wml.5.2021.07.22.00.12.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Jul 2021 00:12:59 -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=B+1M+aV9E2wGVHJ16Wx/w06MuQ5uraDMtjwhK3r80/w=; b=Sz4O8p6Yf4xGoWrc3x1rIdtjXG32PYlh/bDXf4mIX3YK753012yM48iisB73aeoXWb M9SvUnIApPAnGJxHWVYLhIWvY3ZEXTtq/1s2A2gA8xRvYXUnpHq34v1DsT22lkuVT5Ie O71jGQAU+eKOKY2DUeDvKdSMZ4gwea1Hd88YAC2Yxw20JDSXOlzto09jjhvkmOBhgAGL PWS6OjhzfbhHy/CCuO4vYNhkhXUUZLbAE3JIoPlRKkyGbXS9+ZkoDZFRxLyc6tr0FA/f h/bRUhmRi9eKrclAPGMcpSQoOmMi/6hpZtOZsNYfqQn1hzP1se+PG66U9B7B5obEMm5Q Q71Q== 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=B+1M+aV9E2wGVHJ16Wx/w06MuQ5uraDMtjwhK3r80/w=; b=CRgLH2+DnuWHtcP9ewe3kcwh8D4TygIkhHrRPVc+r3vgFisLK3o0j3fenvBkeX9qpE rNFsWAFDV4EzpjcWqR23kUhHuihUuTKeKmeGZLGPnXUt1PKKjknbETkQKp2XbM5d2S06 gwv+Wrh1rE8Wtp2LzStzDTobwr5OZoSh1lV3PbGoF15siYAuAwQC/hVMDyWT5iKxNqvz Dg+kCDdpYaawk1m6g0WRTfILTNkUflvwjvo9zU2V/jpkAmxlfCEgFqgL8XzFtgINuEbd Wx9aRZs7USV/gQfCSoBGWRUxiIBk2qkOO6gV1SUs3G/2yg1Y0HpDEdSz/iy0u0NxX9hq JuFQ== X-Gm-Message-State: AOAM531o6hV8Q04TuY2sel6QzTHDrUNZPnmjlsVUziN2JVcieW3anIbT lcmr5Xq1eDGbvO/zF0oqBS5dSsXdPA8= X-Google-Smtp-Source: ABdhPJxPicj3Om7NQbL26Tlm4ILH7VUSknXLN+AgcOAm1qYYhYProORMes1P/w2m7ydN0/ayp9G/Dg== X-Received: by 2002:adf:ff85:: with SMTP id j5mr46913180wrr.49.1626937980068; Thu, 22 Jul 2021 00:13:00 -0700 (PDT) From: Mahmoud Mandour To: qemu-devel@nongnu.org Subject: [PATCH v3 11/13] tests/plugins/mem: introduce "track" arg and make args not positional Date: Thu, 22 Jul 2021 09:12:34 +0200 Message-Id: <20210722071236.139520-12-ma.mandourr@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210722071236.139520-1-ma.mandourr@gmail.com> References: <20210722071236.139520-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::432; envelope-from=ma.mandourr@gmail.com; helo=mail-wr1-x432.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: 1626938051041100009 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 --- 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..4570f7d815 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], "haddr") =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 Sat May 18 19:24:38 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 16269382474351019.0734247863751; Thu, 22 Jul 2021 00:17:27 -0700 (PDT) Received: from localhost ([::1]:55378 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m6SxS-0006lo-Bc for importer@patchew.org; Thu, 22 Jul 2021 03:17:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48020) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m6StE-0006ci-8p for qemu-devel@nongnu.org; Thu, 22 Jul 2021 03:13:04 -0400 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]:47000) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m6StC-0005Yr-MS for qemu-devel@nongnu.org; Thu, 22 Jul 2021 03:13:03 -0400 Received: by mail-wr1-x42a.google.com with SMTP id d12so4724721wre.13 for ; Thu, 22 Jul 2021 00:13:02 -0700 (PDT) Received: from localhost.localdomain ([102.44.10.38]) by smtp.gmail.com with ESMTPSA id v21sm1802871wml.5.2021.07.22.00.13.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Jul 2021 00:13:00 -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=AntOj9Y2I92RBmKECEDufiCA+SWY3iNb8oQRijAZyXI31c/VsBcBq/KL3Rx5JWSvH7 4vi7YYg4CygQwYTLZOCCKPjJbrKhJcWtLM7h9CloOxV65T9If7iTDN4LFNgAWtIKqOe2 2VYBcd16bvukc69C/ak2b5kvbmyFNxkflzxqNc/Og6FN5Tca6A954Ow7eqZ2ftFMW0HY tDpaRG6+tAzu/buQxDk48bVAGoIxX3Q2QGPnqaXWgZAHtK5N/RGFPyhRiynR5oi7u8Qs C9IbsUs94W1q6x6r/yY3Rc2bAPzVx0R/MoJqCO75RzoZWOzXnlMY30bK5emu6acpCcUO RBOw== 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=ZjN5fqzjInYICGzdxXRi1kH3S4+3AbbZGTN3bCizJ+XBFeI/ChCt9oXfcdVGJJgvrj jfa2mYqu+fsqDDGYiD4ZiQtIf5UfGDCF1dLaxaNrEKs8JvT8GG2JNfHMYT95SyhQc08A nl/J+mOF59WIl46KlClYCfuLqYAx/yY6ugEP2tgKTyFH7HlipuPS2T/bq2pLqAME9W+R Z/5PQb7ApADasekxQTTpQejGH54pU2VnTmv2cie3ho1V7H4WeSeP4tDvZqKhqG4DLFHh 7io7m0VF5/iTykjvojK4jHCv4IrFbMcFpyGHLiEUziVW1moTXClcZH68lkNmF+DIL6n9 H5gA== X-Gm-Message-State: AOAM531TCK617rJrVlifIhvs5j05DNk5hZ9dVDcNymzWgF0e3o6E7ove CNWPDnPZojxJ5qK2DTHyDpO++RSQlQU= X-Google-Smtp-Source: ABdhPJzAFTOewNMVhawBTDq5nShr74Q9EKFfJX7NtrCkUrrLs3iwnDeVGM95owUqKsTapOaAClcU5w== X-Received: by 2002:a5d:6148:: with SMTP id y8mr46533715wrt.20.1626937981341; Thu, 22 Jul 2021 00:13:01 -0700 (PDT) From: Mahmoud Mandour To: qemu-devel@nongnu.org Subject: [PATCH v3 12/13] tests/plugins/syscalls: adhere to new arg-passing scheme Date: Thu, 22 Jul 2021 09:12:35 +0200 Message-Id: <20210722071236.139520-13-ma.mandourr@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210722071236.139520-1-ma.mandourr@gmail.com> References: <20210722071236.139520-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::42a; envelope-from=ma.mandourr@gmail.com; helo=mail-wr1-x42a.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: 1626938249086100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Mahmoud Mandour --- 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 Sat May 18 19:24:38 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 1626938002664404.7912272286194; Thu, 22 Jul 2021 00:13:22 -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-75-kike6ptkNAWJK6r8EuY15w-1; Thu, 22 Jul 2021 03:13:20 -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 13E7A1084F4C; Thu, 22 Jul 2021 07:13:14 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8844061095; Thu, 22 Jul 2021 07:13:13 +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 458511818481; Thu, 22 Jul 2021 07:13:12 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 16M7DAKB005208 for ; Thu, 22 Jul 2021 03:13:10 -0400 Received: by smtp.corp.redhat.com (Postfix) id A5FC110CD2D6; Thu, 22 Jul 2021 07:13:10 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast03.extmail.prod.ext.rdu2.redhat.com [10.11.55.19]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A1E6010CD2D3 for ; Thu, 22 Jul 2021 07:13:06 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) (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 7B736811E78 for ; Thu, 22 Jul 2021 07:13:06 +0000 (UTC) Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-372-SdV55l3MOAejaCO3y7noig-1; Thu, 22 Jul 2021 03:13:03 -0400 Received: by mail-wr1-f45.google.com with SMTP id r11so4752402wro.9 for ; Thu, 22 Jul 2021 00:13:03 -0700 (PDT) Received: from localhost.localdomain ([102.44.10.38]) by smtp.gmail.com with ESMTPSA id v21sm1802871wml.5.2021.07.22.00.13.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Jul 2021 00:13:02 -0700 (PDT) X-MC-Unique: kike6ptkNAWJK6r8EuY15w-1 X-MC-Unique: SdV55l3MOAejaCO3y7noig-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=ybpq7YGDaKRKyk0i8Mhsn/DdfCsTran5Fk9EVIFVKMg=; b=FGwgWwIWoIq871vLqdcO294LT2+1BM3rPEor5iuEC6rAV1wJciIUjzt6XqHbIQDfl1 Ln6MrapQOFGqo5W68dR6jKMW5MonuUeiYIPB6oxXINUymYL98n9h1LKn/3D7QO+9IWm0 a2zy5IL7SB7D4NjEgdnQHqRMZwmUuCHTPRvS4gXWf5NYGB0jIymhM+Lx+v6PlIQ9a1mI dhuq4vXsDSUFNSVahDydzNsWrnoS8h7A/TR+JsBuNVqnfMZUXSAypQ1Qt/gUOopTQKLs Sj4cppALY2H0HhAQ8EqAgH/jAgBiXK62dtxTbtbWHHkKIQuOtkwok0VuD6k2uMeVTmjp VEdA== X-Gm-Message-State: AOAM533eUpG1pm0F7ePpG4T27yBQsl+i9dsoeRRCn6jqXbzm0K0oIEzf RrNXRlaZv8dRhGLaBxu7ZQw= X-Google-Smtp-Source: ABdhPJzPxNmCDxw8PQu3SyKCYPwS7fC2hCCd1QVkuIvPvkRHPB4Sdvl1hx9fnyfwr38ERLj2NPDFug== X-Received: by 2002:adf:eacb:: with SMTP id o11mr48956029wrn.62.1626937982684; Thu, 22 Jul 2021 00:13:02 -0700 (PDT) From: Mahmoud Mandour To: qemu-devel@nongnu.org Subject: [PATCH v3 13/13] docs/deprecated: deprecate passing plugin args through `arg=` Date: Thu, 22 Jul 2021 09:12:36 +0200 Message-Id: <20210722071236.139520-14-ma.mandourr@gmail.com> In-Reply-To: <20210722071236.139520-1-ma.mandourr@gmail.com> References: <20210722071236.139520-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.3 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: 1626938003300100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Mahmoud Mandour --- docs/system/deprecated.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/system/deprecated.rst b/docs/system/deprecated.rst index e2e0090878..7ae6f1f727 100644 --- a/docs/system/deprecated.rst +++ b/docs/system/deprecated.rst @@ -126,6 +126,13 @@ 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 TCG plugins arguments through ``arg=3D`` is redundant is makes the +command-line less readable, especially when the argument itself consist of= a +name and a value, e.g. ``-plugin plugin_name,arg=3D"arg_name=3Darg_value"`= `. +Therefore, the usage of ``arg`` is redundant. =20 QEMU Machine Protocol (QMP) commands ------------------------------------ --=20 2.25.1