From nobody Sat May 11 09:15:58 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 162765361411238.134649416343564; Fri, 30 Jul 2021 07:00:14 -0700 (PDT) Received: from localhost ([::1]:39778 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m9T3b-0006hx-Uj for importer@patchew.org; Fri, 30 Jul 2021 10:00:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35678) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m9T2R-00041E-0o for qemu-devel@nongnu.org; Fri, 30 Jul 2021 09:58:59 -0400 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]:46980) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m9T2P-0006VW-C0 for qemu-devel@nongnu.org; Fri, 30 Jul 2021 09:58:58 -0400 Received: by mail-wr1-x42c.google.com with SMTP id c16so11418367wrp.13 for ; Fri, 30 Jul 2021 06:58:56 -0700 (PDT) Received: from localhost.localdomain ([102.44.217.242]) by smtp.gmail.com with ESMTPSA id h9sm1770277wrw.38.2021.07.30.06.58.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Jul 2021 06:58: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=WV1gi48x+pyBlG/FO6knEEZWqKZDLecl8orWg4GV4os=; b=eGNjU3mxkTChiA/MZLzKbwz4n5NBxDewZHLmBObcypoV5FwUI3ZOqcqwDnE0p9nchA 4kVnN2IiRcdZO0alQ5cTzr3yolJYSnqLHRWj3beJBBKMCetFKD8n+/tEO298uugWx3BQ HvN3OLVCD+5L0J0mrQTo7p2iRCC6ME9tQMB56084OwqcQr4oPRjGfryZVyXyDhBw0dBp nw3Fc34WvT1oMTRRLh4cHCaKI+uYQdom546aKF7BY1ks7/SS9h5sWUhgrE2GqrniniYA rS5myI1cYI1RmhIUpJaR/y/bsn38Ekc1m/JooDP0lNYGLgbkZJ7R/JvndRhPAI3vJn1V lb+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=WV1gi48x+pyBlG/FO6knEEZWqKZDLecl8orWg4GV4os=; b=j3g+ehO39746Z6uJoTTpt3TQmpMZiFqOanlp4TdJw/p7YzT2VKCq8ZCS9Kwh0topYE DFrYhMUmD2GV88kHWjaOy8PTMfvWrv6FktNU5QCBUHywd8U7YiaAsuKsWB+kMcvg2I6d nU5aCyzbnFb0ZB7NaFKjI3WA3b3hJ5ybbTn1VkY6fCmq0cnrXCL7A0fKBNOCsvvfHS/C dyd/odBca//mXbyDKPk+AayviLpUrouc1mNXYdiYwCDADb80IqTmceouKsczUhk96cKa 8mA1lHf04s4tmzTp14sWXhztg4Gcj/mYriOXRoU+//gioLrKKPx7FOdoZdqCbFvuXAOk 6alQ== X-Gm-Message-State: AOAM531d152utCJM9aJg5lq61D+zVPI16fd2js1NXEeNOeoK6GG9MBOu oAlI+ygZnieMl3eNJ3gaoiR6T120JtE= X-Google-Smtp-Source: ABdhPJw2xnygJxIzW507Rvb+h5QX3Si2WRvJVmMeAm+V70IEhPQ61sdaaypSVg9VmB3Q6bE7YXktmw== X-Received: by 2002:a5d:68cb:: with SMTP id p11mr3297957wrw.364.1627653535404; Fri, 30 Jul 2021 06:58:55 -0700 (PDT) From: Mahmoud Mandour To: qemu-devel@nongnu.org Subject: [PATCH v4 01/13] plugins: allow plugin arguments to be passed directly Date: Fri, 30 Jul 2021 15:58:05 +0200 Message-Id: <20210730135817.17816-2-ma.mandourr@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210730135817.17816-1-ma.mandourr@gmail.com> References: <20210730135817.17816-1-ma.mandourr@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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::42c; envelope-from=ma.mandourr@gmail.com; helo=mail-wr1-x42c.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, alex.bennee@linaro.org, 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: 1627653615729100003 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 Tested-by: Alex Benn=C3=A9e Reviewed-by: Alex Benn=C3=A9e --- linux-user/main.c | 2 +- plugins/loader.c | 24 ++++++++++++++++++++---- qemu-options.hx | 9 ++++----- 3 files changed, 25 insertions(+), 10 deletions(-) diff --git a/linux-user/main.c b/linux-user/main.c index 4dfc47ad3b..d47f78132c 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -462,7 +462,7 @@ static const struct qemu_argument arg_table[] =3D { "", "[[enable=3D]][,events=3D][,file=3D]"}, #ifdef CONFIG_PLUGIN {"plugin", "QEMU_PLUGIN", true, handle_arg_plugin, - "", "[file=3D][,arg=3D]"}, + "", "[file=3D][,=3D]"}, #endif {"version", "QEMU_VERSION", false, handle_arg_version, "", "display version information and exit"}, diff --git a/plugins/loader.c b/plugins/loader.c index 05df40398d..a4ec281692 100644 --- a/plugins/loader.c +++ b/plugins/loader.c @@ -94,6 +94,8 @@ static int plugin_add(void *opaque, const char *name, con= st char *value, { struct qemu_plugin_parse_arg *arg =3D opaque; struct qemu_plugin_desc *p; + bool is_on; + char *fullarg; =20 if (strcmp(name, "file") =3D=3D 0) { if (strcmp(value, "") =3D=3D 0) { @@ -107,18 +109,32 @@ static int plugin_add(void *opaque, const char *name,= const char *value, QTAILQ_INSERT_TAIL(arg->head, p, entry); } arg->curr =3D p; - } else if (strcmp(name, "arg") =3D=3D 0) { + } else { if (arg->curr =3D=3D NULL) { error_setg(errp, "missing earlier '-plugin file=3D' option"); return 1; } + + if (g_strcmp0(name, "arg") =3D=3D 0 && + !qapi_bool_parse(name, value, &is_on, NULL)) { + if (strchr(value, '=3D') =3D=3D NULL) { + /* Will treat arg=3D"argname" as "argname=3Don" */ + fullarg =3D g_strdup_printf("%s=3D%s", value, "on"); + } else { + fullarg =3D g_strdup_printf("%s", value); + } + warn_report("using 'arg=3D%s' is deprecated", value); + error_printf("Please use '%s' directly\n", fullarg); + } else { + fullarg =3D g_strdup_printf("%s=3D%s", name, value); + } + p =3D arg->curr; p->argc++; p->argv =3D g_realloc_n(p->argv, p->argc, sizeof(char *)); - p->argv[p->argc - 1] =3D g_strdup(value); - } else { - error_setg(errp, "-plugin: unexpected parameter '%s'; ignored", na= me); + p->argv[p->argc - 1] =3D fullarg; } + return 0; } =20 diff --git a/qemu-options.hx b/qemu-options.hx index 14258784b3..36b6cb9a2f 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -4459,19 +4459,18 @@ SRST =20 ERST DEF("plugin", HAS_ARG, QEMU_OPTION_plugin, - "-plugin [file=3D][,arg=3D]\n" + "-plugin [file=3D][,=3D]\n" " load a plugin\n", QEMU_ARCH_ALL) SRST -``-plugin file=3Dfile[,arg=3Dstring]`` +``-plugin file=3Dfile[,argname=3Dargvalue]`` Load a plugin. =20 ``file=3Dfile`` Load the given plugin from a shared library file. =20 - ``arg=3Dstring`` - Argument string passed to the plugin. (Can be given multiple - times.) + ``argname=3Dargvalue`` + Argument passed to the plugin. (Can be given multiple times.) ERST =20 HXCOMM Internal use --=20 2.25.1 From nobody Sat May 11 09:15:58 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 1627653798122873.0054976153407; Fri, 30 Jul 2021 07:03:18 -0700 (PDT) Received: from localhost ([::1]:46952 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m9T6b-0003LJ-3Y for importer@patchew.org; Fri, 30 Jul 2021 10:03:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35684) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m9T2S-00042y-Ej for qemu-devel@nongnu.org; Fri, 30 Jul 2021 09:59:00 -0400 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]:33327) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m9T2Q-0006X4-Bc for qemu-devel@nongnu.org; Fri, 30 Jul 2021 09:59:00 -0400 Received: by mail-wm1-x334.google.com with SMTP id a192-20020a1c7fc90000b0290253b32e8796so7291327wmd.0 for ; Fri, 30 Jul 2021 06:58:57 -0700 (PDT) Received: from localhost.localdomain ([102.44.217.242]) by smtp.gmail.com with ESMTPSA id h9sm1770277wrw.38.2021.07.30.06.58.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Jul 2021 06:58: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=9YvtSymqUoD0Ep/Zs7OWqwqxy2FOGQ26RHoeEjgQ23k=; b=qzpy6wT0hjz3i02zD09Qz4LR41DwX3oHmk4Jg0XOiqE3hVO0PCgHbHSna03YGBsceB j4pZpJtPpEALP+uDaKkfqrSA4wSwl8P6uKmu3jyY3edwjNAYKiG2/R7VRdTqG2WfHjs8 otBTwgBYRUBFs9jrFl3vlP6eyG7JsftaDM2RqxF/WD4R7KOYoIUrMWc2KocpapcnXgSz +EuDp1Ru66N490Ctyza2eLDfAndmRt2Fldj0RxFkOqZI3p3FtZPiBXQJe8oQdYfem5uv oxXzz/F3E97EM2tuh5ZyPBPjS5VnBLinjFmN0WTD8H/toT1ooz8YyeTw3mn2234r2i6o 8lCQ== 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=ZC07UaMHhi7FxZD7+Rm81EwbC3IiiduAA4hB4Ot3EIaqFd537lFbfRD5JNK1tgRg7E 6z/zUZRuHq/0vrIHvMGgcrCscT9lCNI/DBbySy4Nl2Jl2hc5JiUXPSOWA3klfnKOlEP7 ZU2OIUV1RcDkhXbyrVTK1dX9YThjNkITNGdWCisWF03K7eV5B3qFbUPwxkXzdCescjUR NyDyCBx0BUEpysTOiMJZlD2CyBrBRLaR2mscGNPOytScaRfZ40OVIDVheZf4GYDrFgvq azagNKpUsvicPJruuwB36r+Opg0Yziv2L3ongZvTOZ+qqPfzCa93Xx3w8te8ueR9VCc4 EbNA== X-Gm-Message-State: AOAM530SVZUiSx7HzVlNjhhZguOC22OV7YsdnWeMT6TzbqrAXP6U5fhh JtC2TAzRPio/eHeQjWTSU8YnSXLJW0c= X-Google-Smtp-Source: ABdhPJzrK9OlpZKXwRyAH9dLgzSVWRiFthqPIs+JliUa2ynaq7Sw6nDwWelOXM3WjU5qzeL1+Tun7w== X-Received: by 2002:a05:600c:414e:: with SMTP id h14mr3219100wmm.92.1627653536845; Fri, 30 Jul 2021 06:58:56 -0700 (PDT) From: Mahmoud Mandour To: qemu-devel@nongnu.org Subject: [PATCH v4 02/13] plugins/api: added a boolean parsing plugin api Date: Fri, 30 Jul 2021 15:58:06 +0200 Message-Id: <20210730135817.17816-3-ma.mandourr@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210730135817.17816-1-ma.mandourr@gmail.com> References: <20210730135817.17816-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, alex.bennee@linaro.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: 1627653800332100001 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 Reviewed-by: Alex Benn=C3=A9e --- 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 11 09:15:58 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 1627653615114520.5569409874033; Fri, 30 Jul 2021 07:00:15 -0700 (PDT) Received: from localhost ([::1]:39918 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m9T3e-0006nc-0k for importer@patchew.org; Fri, 30 Jul 2021 10:00:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35696) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m9T2U-00045K-Mc for qemu-devel@nongnu.org; Fri, 30 Jul 2021 09:59:02 -0400 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]:43583) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m9T2S-0006YU-64 for qemu-devel@nongnu.org; Fri, 30 Jul 2021 09:59:01 -0400 Received: by mail-wm1-x336.google.com with SMTP id m20-20020a05600c4f54b029024e75a15716so6487711wmq.2 for ; Fri, 30 Jul 2021 06:58:59 -0700 (PDT) Received: from localhost.localdomain ([102.44.217.242]) by smtp.gmail.com with ESMTPSA id h9sm1770277wrw.38.2021.07.30.06.58.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Jul 2021 06:58:57 -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=FJDl9mAtg/B5/AFGs/m7ohohIlPvDj9ka9ChwuTyltU=; b=FD3JCRld7N06zI9kwJwlQTZMeR84WEL8TcoRqhSbPyvtmXJsdefNvMyhylB7xcph8N fh3FU9kBW5UChYRBHFba4sh+rXzhUrXBB3klhl0jRbBNpV7irwFlOO7U9WwUNnxDXc2Y TX5ltPlOkUeQ4mILkpPYwcpFgSamSXERNEVmE70QYtgcLeDzs0w6kiw2ggsW5Q/mznUQ WnpGirzPMqYlonHIbayqjdDGT2SrRQMiDyrEh2xpiNBQykeS3S5AUpe5/67i4PXymyjb 5WaP+OyKYkbZ/6Ewoah4OhM5bqcr5Rhh/+fdJf9MmQ4sIfPwx5RBtuIBPbziI51lRf5C BQ1A== 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=FJDl9mAtg/B5/AFGs/m7ohohIlPvDj9ka9ChwuTyltU=; b=rmJRwcZ+pygbWL1OkHmcA9GXfDjn2ROsxIzYQJ3wH08tNIMWgWZxvlkCzz0bVdckkH QdiVeR4FvUjPJEmzYrqt6Or1ymkcXwoC/0smqjrvdoRXElPlK7rQvW1BwqYlTHxX/ppq exxRgC+Pdu9mboTf9zaJLNzshpPM4UfRHq+Xl3qPIKjt4D7KdRoIn+uI/RFm2L5Mn/wb nQ+iQi4XtPrDimFIFEUVmk87Gz0bLdqLZDX1qnpLsHmvqIcC5tdev/93D5R3K0D/wXLd X4eQUqcalj1Gnqx7xfIHHUAZu+JCKrEju7ZtktzvAUV+2dXVHQdmmrStiCLg9xpIqs+t 7RRw== X-Gm-Message-State: AOAM530LHhnhWrGtkm9lnDoPVfQW9ETViyGBxFfaZeN+HIZxPRROuCbj M8l00Pec1QHzb8QF+8AHCHMBuhXCwGQ= X-Google-Smtp-Source: ABdhPJwrJyjWhuNZ+/nq2z/szE4mVJ7N64SLsKGr6P6faM6bL7MpZXDqukc/v9Du4FKiwySB2l0v0w== X-Received: by 2002:a05:600c:219:: with SMTP id 25mr3124375wmi.49.1627653538287; Fri, 30 Jul 2021 06:58:58 -0700 (PDT) From: Mahmoud Mandour To: qemu-devel@nongnu.org Subject: [PATCH v4 03/13] plugins/hotpages: introduce sortby arg and parsed bool args correctly Date: Fri, 30 Jul 2021 15:58:07 +0200 Message-Id: <20210730135817.17816-4-ma.mandourr@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210730135817.17816-1-ma.mandourr@gmail.com> References: <20210730135817.17816-1-ma.mandourr@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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, alex.bennee@linaro.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: 1627653616483100005 Since plugin arguments now expect boolean arguments, a plugin argument name "sortby" now expects a value of "read", "write", or "address". "io" arg is now expected to be passed as a full-form boolean parameter, i.e. "io=3Don|true|yes|off|false|no" Signed-off-by: Mahmoud Mandour Reviewed-by: Alex Benn=C3=A9e --- contrib/plugins/hotpages.c | 30 ++++++++++++++++++++---------- 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 11 09:15:58 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 1627653804374193.40799070459855; Fri, 30 Jul 2021 07:03:24 -0700 (PDT) Received: from localhost ([::1]:47420 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m9T6h-0003fU-CO for importer@patchew.org; Fri, 30 Jul 2021 10:03:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35720) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m9T2X-00048m-6a for qemu-devel@nongnu.org; Fri, 30 Jul 2021 09:59:05 -0400 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]:34521) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m9T2U-0006ZM-Fz for qemu-devel@nongnu.org; Fri, 30 Jul 2021 09:59:04 -0400 Received: by mail-wr1-x432.google.com with SMTP id r2so11497511wrl.1 for ; Fri, 30 Jul 2021 06:59:01 -0700 (PDT) Received: from localhost.localdomain ([102.44.217.242]) by smtp.gmail.com with ESMTPSA id h9sm1770277wrw.38.2021.07.30.06.58.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Jul 2021 06:59: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=xGfAEZI06RYsFGS9ZJIyiWOEo8EAYMj1eN2Iae2jGXM=; b=M6Wm2g/7jNBhuN6IbK2/PbW1sVpbxISmUpWfJAjxicvECgDxGmBjZldi+RBW3E1Jn1 JBRMEupnfnhbTfhrf3/bc2IlLOJl0/rp17qDGSlpZFy0Wmam1uGj6Cd4DFErzSFOdmuy q8acEv0lgLIH4a3bhaFkpuUCuSnhxUkkoIT67hnqvlhOY6ZhO+TFQUbKPf2+DJ/OMxOE ORU39q+lzrnn3cU5Kcii0LY3Rc4XCTWw877SHJtx1831HQu5aEWgS0fq068X/HXijJM4 pqsefTanQpoXAhu1X2wG8M+vi1ZI6x2crZbzmxCSlv+cKqwklOeUJ/QlG1STwpH64SzM 4HlA== 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=xGfAEZI06RYsFGS9ZJIyiWOEo8EAYMj1eN2Iae2jGXM=; b=MfKkscFuQzd1+BoH0XQxG0AqdfCr8RU1D9IaqFtNg0RIM5tnRL8VOhgD1Amt57Nmz7 UFE3lssW12TrsNycOOX3CNyZoreF1MwqDZJ+t1f+hEq6suQtY1k6OzIx61nJncwvbz5y pAtsetBJJpfrXDp+QM6SB7JaZg6N57v+4D0a1V0sbHEFR5uRBK5CQckPxtG6jqH4T7aZ 3y0NuDKvauGRzsBPa+6XgSlJOaXgirhwvNauiI3KgKi9UpJZZ4gABdVw+lJRYqeJOTlB yYtgt3NTWRyZ4Nrvchjw2pugkYJK2r75LAtyn7/ZKMyzq+JCVnNlZ4h/wTn9VrSJIjq5 lIzw== X-Gm-Message-State: AOAM531RGu2pXtc7NTRrigR7qoXP5ulLclz0PYQnwVMf6GKbe+0bEvn9 AFVLj1GFNhzpEMDECkK7M9/dHx1otX4= X-Google-Smtp-Source: ABdhPJytxg/ZcTcnXj8DiyRCbrQXntpmoLZRU0dCV7Ma2WosX74PNBNxWOBBi1WbNvxuthY4To/tYA== X-Received: by 2002:adf:d086:: with SMTP id y6mr3360518wrh.247.1627653540811; Fri, 30 Jul 2021 06:59:00 -0700 (PDT) From: Mahmoud Mandour To: qemu-devel@nongnu.org Subject: [PATCH v4 04/13] plugins/hotblocks: Added correct boolean argument parsing Date: Fri, 30 Jul 2021 15:58:08 +0200 Message-Id: <20210730135817.17816-5-ma.mandourr@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210730135817.17816-1-ma.mandourr@gmail.com> References: <20210730135817.17816-1-ma.mandourr@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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, alex.bennee@linaro.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: 1627653806278100001 Signed-off-by: Mahmoud Mandour Reviewed-by: Alex Benn=C3=A9e --- contrib/plugins/hotblocks.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/contrib/plugins/hotblocks.c b/contrib/plugins/hotblocks.c index 4b08340143..062200a7a4 100644 --- a/contrib/plugins/hotblocks.c +++ b/contrib/plugins/hotblocks.c @@ -133,8 +133,18 @@ QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin_id_t id, const qemu_info_t *info, int argc, char **argv) { - if (argc && strcmp(argv[0], "inline") =3D=3D 0) { - do_inline =3D true; + for (int i =3D 0; i < argc; i++) { + char *opt =3D argv[i]; + g_autofree char **tokens =3D g_strsplit(opt, "=3D", 2); + if (g_strcmp0(tokens[0], "inline") =3D=3D 0) { + if (!qemu_plugin_bool_parse(tokens[0], tokens[1], &do_inline))= { + fprintf(stderr, "boolean argument parsing failed: %s\n", o= pt); + return -1; + } + } else { + fprintf(stderr, "option parsing failed: %s\n", opt); + return -1; + } } =20 plugin_init(); --=20 2.25.1 From nobody Sat May 11 09:15:58 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 1627653743307826.9228586647307; Fri, 30 Jul 2021 07:02:23 -0700 (PDT) Received: from localhost ([::1]:43418 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m9T5g-0000oZ-T3 for importer@patchew.org; Fri, 30 Jul 2021 10:02:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35734) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m9T2Y-0004FA-KE for qemu-devel@nongnu.org; Fri, 30 Jul 2021 09:59:06 -0400 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]:45709) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m9T2W-0006ag-UF for qemu-devel@nongnu.org; Fri, 30 Jul 2021 09:59:06 -0400 Received: by mail-wr1-x435.google.com with SMTP id m12so6661777wru.12 for ; Fri, 30 Jul 2021 06:59:04 -0700 (PDT) Received: from localhost.localdomain ([102.44.217.242]) by smtp.gmail.com with ESMTPSA id h9sm1770277wrw.38.2021.07.30.06.59.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Jul 2021 06:59:02 -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=Zx7cRgd2qwvarLurhWwJmwoKYPf3+B1Nk2x+D7jVjeA=; b=kHz2Oo6zKtEUbF8Lnr1KgBC+HAWvzpS7gt6N+8M0ZlqcYeal5t3hNMgaNAIBUwDjeP fP2aT3Rk/wCC91maakcnlLu/2vdQD1EI5nbNE3qOT96bp3/IQox1J0iEYE/VKSxY25fM BW6K9WkB72Qw1T6DY5ZTnMPgwPknNfcUFI9QML4a60p5DyJpQ8ukeHmHPu+c2IvlubRu l+Ka9b1DDUCuaTpGmyvnqFy3jUt84AtyUQdWvo6m+OsTV1BKscYod+gO2kb2QuR8F45F a56bs9LSZXUfqrDOB6mMIWGDGYsCyGm70ip19Z6ZvnH1BH5dXY+UsfC1CoAaEj+s1Pdl NkhQ== 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=Zx7cRgd2qwvarLurhWwJmwoKYPf3+B1Nk2x+D7jVjeA=; b=o00H8yUtMuk2JjUJ8mnZq4l1d+RQRzW0gmPG9Yiava2f9CdWLTyrwnN/hqZExt2BYV Qpb0QVGlSA4c4qz2FmMHD6KQDcxd+Z7dbvCSf9pFAYMc4b2nJQC69m55k2jS9IApHGS/ F/Un7ssmFzXM7/Hye5wkex6KYMuRY2RMm1KI2egP3uRGUet9AFbbCZhlN6c1WXu8Vf1C TrRX264Qw0oNsDX5F8CJbY71rjmN8G/xDtdsTkNasrC4VbXb4d9CRUxS7UZc5D77QXHD qOaYJj4kDepHIgMFWpikenG7pl8hnA7837JTyJyuHuH84ypxJJeG1rU9XbDu4ndbf/wt uqpg== X-Gm-Message-State: AOAM533graOhGj/1oGgzQq6kV+ptEu2O/N0cyzRPYxZzkJOaishY+45G 0OHTBZpBm/8//dPAkT+ObpChNKD7RSU= X-Google-Smtp-Source: ABdhPJw192pGLqwXjyXfXIw+WEhVjfprg3rQ7LWih/RwojTmGxA1mqyBosIPe6GXehbErKYBQNkdqQ== X-Received: by 2002:adf:f485:: with SMTP id l5mr3153886wro.8.1627653543320; Fri, 30 Jul 2021 06:59:03 -0700 (PDT) From: Mahmoud Mandour To: qemu-devel@nongnu.org Subject: [PATCH v4 05/13] plugins/lockstep: make socket path not positional & parse bool arg Date: Fri, 30 Jul 2021 15:58:09 +0200 Message-Id: <20210730135817.17816-6-ma.mandourr@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210730135817.17816-1-ma.mandourr@gmail.com> References: <20210730135817.17816-1-ma.mandourr@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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, alex.bennee@linaro.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: 1627653749154100001 Signed-off-by: Mahmoud Mandour Reviewed-by: Alex Benn=C3=A9e --- contrib/plugins/lockstep.c | 31 ++++++++++++++++++++++--------- docs/devel/tcg-plugins.rst | 2 +- 2 files changed, 23 insertions(+), 10 deletions(-) diff --git a/contrib/plugins/lockstep.c b/contrib/plugins/lockstep.c index 7fd35eb669..a41ffe83fa 100644 --- a/contrib/plugins/lockstep.c +++ b/contrib/plugins/lockstep.c @@ -319,22 +319,35 @@ QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugi= n_id_t id, int argc, char **argv) { int i; - - if (!argc || !argv[0]) { - qemu_plugin_outs("Need a socket path to talk to other instance."); - return -1; - } + g_autofree char *sock_path =3D NULL; =20 for (i =3D 0; i < argc; i++) { char *p =3D argv[i]; - if (strcmp(p, "verbose") =3D=3D 0) { - verbose =3D true; - } else if (!setup_unix_socket(argv[0])) { - qemu_plugin_outs("Failed to setup socket for communications."); + g_autofree char **tokens =3D g_strsplit(p, "=3D", 2); + + if (g_strcmp0(tokens[0], "verbose") =3D=3D 0) { + if (!qemu_plugin_bool_parse(tokens[0], tokens[1], &verbose)) { + fprintf(stderr, "boolean argument parsing failed: %s\n", p= ); + return -1; + } + } else if (g_strcmp0(tokens[0], "sockpath") =3D=3D 0) { + sock_path =3D tokens[1]; + } else { + fprintf(stderr, "option parsing failed: %s\n", p); return -1; } } =20 + if (sock_path =3D=3D NULL) { + fprintf(stderr, "Need a socket path to talk to other instance.\n"); + return -1; + } + + if (!setup_unix_socket(sock_path)) { + fprintf(stderr, "Failed to setup socket for communications.\n"); + return -1; + } + our_id =3D id; =20 qemu_plugin_register_vcpu_tb_trans_cb(id, vcpu_tb_trans); diff --git a/docs/devel/tcg-plugins.rst b/docs/devel/tcg-plugins.rst index 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 11 09:15:58 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 162765394389232.692823861805664; Fri, 30 Jul 2021 07:05:43 -0700 (PDT) Received: from localhost ([::1]:53852 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m9T8w-0007zf-C6 for importer@patchew.org; Fri, 30 Jul 2021 10:05:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35754) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m9T2a-0004Nv-RM for qemu-devel@nongnu.org; Fri, 30 Jul 2021 09:59:08 -0400 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]:36808) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m9T2Y-0006bn-Sh for qemu-devel@nongnu.org; Fri, 30 Jul 2021 09:59:08 -0400 Received: by mail-wm1-x32a.google.com with SMTP id o7-20020a05600c5107b0290257f956e02dso2843547wms.1 for ; Fri, 30 Jul 2021 06:59:06 -0700 (PDT) Received: from localhost.localdomain ([102.44.217.242]) by smtp.gmail.com with ESMTPSA id h9sm1770277wrw.38.2021.07.30.06.59.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Jul 2021 06:59:04 -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=ag9XoMuZ18MJafN2tGZyI+ytcUITu22gjl2a5tYGEBw9BR5B02pcypl0YxOeXX7skV G+MJUkv/gUrf1jbmBB8LCQLI5HIOOgxadFxRoDN7ojtq8DNbDvtjm8NDs7luHGcr1cI0 QmaBl5KevRU1dz9aCK5qYSKVG9jbV1itC8k/fP8P6eG89OGnaGB5xsuuuNiO+BKwdAHh i7ctto0nkecwOR0bPlU3N81lgM7rSGsKpJLBbxa/D6RrbXxcmGx8DtuyfJZ7Gp1lTMjh GXiu0vf1FHzjI63FbRno1YjFOnIFHWVtiRx9jt4ZzOEiw8VpkATZRVTk7s7uentaDj/A iY2w== 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=ZrB6+oIcIwXVfSOXAQnY6HydfMRhpP1dWsU6vN8v3XF7QMZN7H8766ISLTyHD9kcGb DMoRqCjzl2tG7WvykreUp8IpJFBBIyVqG6NkNY3RRxLLxj04lYRT8Srz8E06JRQ0nlOK h9URCo0W2CQM4Y7vWl7vp1M4fLLa70nTi282gCs27sVJi9jp1u0P06hWMKfvsY2xBfbh W2UJ73wL9P5D37ZCc/MFLN4ndm3VM1NuareOi3l5D8nPPFsj4BY+PoJd7xOPfb/VRafN nuSlseVflZXi+NRi6vrwXVUGG9nv7gLj1Nsb2BztrWTtt2cGKl2ZLkWHd2DBPQPZoddy lu3w== X-Gm-Message-State: AOAM532Lye0HEP4gCgumH5C+pMn2aZUHaRiv9+OgfkUl1CweJGDyn5mU bxjiHH94z2oqzlIqKTDLCaESQA2odBc= X-Google-Smtp-Source: ABdhPJzitF4nbNqV+2qjvjj2EyJDVMaPNCAgHOaEBryaiN3Vc2NxzHFfJfT5trQxEFIBcT1NuYgNQw== X-Received: by 2002:a05:600c:354e:: with SMTP id i14mr3071937wmq.96.1627653545193; Fri, 30 Jul 2021 06:59:05 -0700 (PDT) From: Mahmoud Mandour To: qemu-devel@nongnu.org Subject: [PATCH v4 06/13] plugins/hwprofile: adapt to the new plugin arguments scheme Date: Fri, 30 Jul 2021 15:58:10 +0200 Message-Id: <20210730135817.17816-7-ma.mandourr@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210730135817.17816-1-ma.mandourr@gmail.com> References: <20210730135817.17816-1-ma.mandourr@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=ma.mandourr@gmail.com; helo=mail-wm1-x32a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mahmoud Mandour , cota@braap.org, alex.bennee@linaro.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: 1627653945066100001 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 Reviewed-by: Alex Benn=C3=A9e Tested-by: Alex Benn=C3=A9e --- 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 11 09:15:58 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 1627653841605652.4340808039033; Fri, 30 Jul 2021 07:04:01 -0700 (PDT) Received: from localhost ([::1]:50134 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m9T7I-0005SR-8M for importer@patchew.org; Fri, 30 Jul 2021 10:04:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35786) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m9T2d-0004XN-5a for qemu-devel@nongnu.org; Fri, 30 Jul 2021 09:59:11 -0400 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]:36516) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m9T2b-0006do-DA for qemu-devel@nongnu.org; Fri, 30 Jul 2021 09:59:10 -0400 Received: by mail-wr1-x42b.google.com with SMTP id b13so587997wrs.3 for ; Fri, 30 Jul 2021 06:59:09 -0700 (PDT) Received: from localhost.localdomain ([102.44.217.242]) by smtp.gmail.com with ESMTPSA id h9sm1770277wrw.38.2021.07.30.06.59.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Jul 2021 06:59: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=OWUqr/cDoSvVuOfI9ktQQ3wXRuH6l69RWUr3q0ufGYc=; b=N/WU5RrISn62GQp41IqMt4iBsCk0j3usSmwRsOzKl6bUXsyWDBA6qgPCa8Qi2z6OZI f6tu9OpxFApv5F13nrh322/f9wWOTrshAx5GFOnGMqfZDQDz2Ti/9svbX/vrTmQnzSNo +cPdNKI28DIjzBO0k6Pygyg7e+00jqIe/XJEaSa9LfIeayuH/5k9S6LboSeZHQ+VhtmX aYjmYsUos5dbM5oP98ZMvwGiptmrJZ0Qx0U0r1lT+k6d4NxS9qQmkbpjjVm0zj52PtqJ B6+/7zBWnBx1Wg2jwS3SwMeHlzQDDNDB7XhCqwl3WPBJZEJaqAbnwDUvwqymvB3XdbY9 4txA== 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=OWUqr/cDoSvVuOfI9ktQQ3wXRuH6l69RWUr3q0ufGYc=; b=QvULYu2viHpy39HUc2CFBt82UFRE1MoE23AGStTvrSK/1CQuYLHc2P271lS6iZJVxO o1eYUbUahanFSeerI6Pgq7po4mVljnI8TbsN0blWOYU3sDrkpFGo6A4snSafy63mKvkG uoUcyaOLpTmTm1zNYg52cYyzSFH9z7QOjUwh/RVnELlNTmETcsf3K536UVbg95mtqvdR 88amgIh5LzKcTRpBptDQPtQTf0Ra4Ji3z1PXAj7PSETARxnChleYoKGZ3ZUz4KeuLCVT fZsc93HLX0Jqe7OsQWuFoMyxGwIHhhjK1ES89s+/NBdLR6NunErH74zvkTZSjlzVO1En Nnog== X-Gm-Message-State: AOAM531eHCUrVYyCqAx46JaoLev/qeXO7fot51F1u23//C1LCQfLjqbN 6SS3oG9izAp81AP7+GuW+9rew9VbibA= X-Google-Smtp-Source: ABdhPJyk8GMvMblWj35D6tcu4yOX1jgTUgCbQfW4ImHyDNKv2J6KGxsxKUB8biqeQL/IC0Kzf/Uaug== X-Received: by 2002:adf:e9ca:: with SMTP id l10mr3291630wrn.37.1627653547874; Fri, 30 Jul 2021 06:59:07 -0700 (PDT) From: Mahmoud Mandour To: qemu-devel@nongnu.org Subject: [PATCH v4 07/13] plugins/howvec: adapting to the new argument passing scheme Date: Fri, 30 Jul 2021 15:58:11 +0200 Message-Id: <20210730135817.17816-8-ma.mandourr@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210730135817.17816-1-ma.mandourr@gmail.com> References: <20210730135817.17816-1-ma.mandourr@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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, alex.bennee@linaro.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: 1627653843024100001 Correctly parsing plugin argument since they now must be provided as full-form boolean parameters, e.g.: -plugin ./contrib/plugins/libhowvec.so,verbose=3Don,inline=3Don Also, introduced the argument "count" that accepts one opt to count individually at a time. Signed-off-by: Mahmoud Mandour Reviewed-by: Alex Benn=C3=A9e Tested-by: Alex Benn=C3=A9e --- contrib/plugins/howvec.c | 27 +++++++++++++++++++-------- docs/devel/tcg-plugins.rst | 10 +++++----- 2 files changed, 24 insertions(+), 13 deletions(-) diff --git a/contrib/plugins/howvec.c b/contrib/plugins/howvec.c index 600f7facc1..4a5ec3d936 100644 --- a/contrib/plugins/howvec.c +++ b/contrib/plugins/howvec.c @@ -333,23 +333,34 @@ QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugi= n_id_t id, =20 for (i =3D 0; i < argc; i++) { char *p =3D argv[i]; - if (strcmp(p, "inline") =3D=3D 0) { - do_inline =3D true; - } else if (strcmp(p, "verbose") =3D=3D 0) { - verbose =3D true; - } else { + g_autofree char **tokens =3D g_strsplit(p, "=3D", -1); + if (g_strcmp0(tokens[0], "inline") =3D=3D 0) { + if (!qemu_plugin_bool_parse(tokens[0], tokens[1], &do_inline))= { + fprintf(stderr, "boolean argument parsing failed: %s\n", p= ); + return -1; + } + } else if (g_strcmp0(tokens[0], "verbose") =3D=3D 0) { + if (!qemu_plugin_bool_parse(tokens[0], tokens[1], &verbose)) { + fprintf(stderr, "boolean argument parsing failed: %s\n", p= ); + return -1; + } + } else if (g_strcmp0(tokens[0], "count") =3D=3D 0) { + char *value =3D tokens[1]; int j; CountType type =3D COUNT_INDIVIDUAL; - if (*p =3D=3D '!') { + if (*value =3D=3D '!') { type =3D COUNT_NONE; - p++; + value++; } for (j =3D 0; j < class_table_sz; j++) { - if (strcmp(p, class_table[j].opt) =3D=3D 0) { + if (strcmp(value, class_table[j].opt) =3D=3D 0) { class_table[j].what =3D type; break; } } + } else { + fprintf(stderr, "option parsing failed: %s\n", p); + return -1; } } =20 diff --git a/docs/devel/tcg-plugins.rst b/docs/devel/tcg-plugins.rst index 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 11 09:15:58 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 1627653990552755.9176318669571; Fri, 30 Jul 2021 07:06:30 -0700 (PDT) Received: from localhost ([::1]:56514 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m9T9h-0001Sd-Df for importer@patchew.org; Fri, 30 Jul 2021 10:06:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35798) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m9T2e-0004dM-Uh for qemu-devel@nongnu.org; Fri, 30 Jul 2021 09:59:13 -0400 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]:36812) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m9T2d-0006eu-AD for qemu-devel@nongnu.org; Fri, 30 Jul 2021 09:59:12 -0400 Received: by mail-wm1-x32e.google.com with SMTP id o7-20020a05600c5107b0290257f956e02dso2843672wms.1 for ; Fri, 30 Jul 2021 06:59:10 -0700 (PDT) Received: from localhost.localdomain ([102.44.217.242]) by smtp.gmail.com with ESMTPSA id h9sm1770277wrw.38.2021.07.30.06.59.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Jul 2021 06:59: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=XqcqpJ3EX39A/hojXpAe5Ae+aFtZNNkN4lpjG68BV+g=; b=nw2yrIA8tOH++53awL2lniQZ2ZCfyjFSN6WRcmKHmmzbGLeAFgL0rQI3yl0hUuAo+E H+QQfsqgvHD9IGKbuILjftPqjYZoqDRrMgKiD/Wg4okYvsfcMzr5TE0BFph51jo4VEvw bLGDommnfh8QwzKB6F/wK6TR0wlE0cdgZr96LA+dLWhab5Wi0rzH9KEsSIH54cHgoP/G YTniBVnClGLJu305lYelIOEcq4/i+EIgojgkerfcHssEkEyq7gBMtH0hErW3CJ2cqZXh fWI5kHdGJ5cMKmer2rx5SkWNRLdQwfpB/Dq/u/E0rIJjFhpGiofb9/3+jxku3mQ0JoQY La3g== 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=XqcqpJ3EX39A/hojXpAe5Ae+aFtZNNkN4lpjG68BV+g=; b=MTBmqUY0ivdKQVc59Zfh9/intnVsV9D+YWv0qUxwg2F1ZK9vKaWoeGCVrBj+l5sYND m+C7jkcMt76Jjk/yqo8MPdotfT27p/ESmVolaJO8hkYyODT4vNmvA6TV4oSngHZwikaH Au3duTX9VH3I6IUULGLjyqg22U4fFw/iqPSm8mDSDLrl/o4c86S0Hl/RG+Qbl3ngdFhq itvyuSax5kR8guSgTSv+LetPOyXxkaNrJuvuqocJxrRz3cqA1+aBPpv/1OH3bH/UWTv5 CEwumJxfNo8+4ZfMjGQ7eYIgCWgVNiewn8SIRvn50CHEnnZpKVji/5XLSfEmX6sR4Ka3 6Rww== X-Gm-Message-State: AOAM531lYX+9NxEy15u/gRbC9H2JAFcNNKgvnC5wsZhPUIRJHDgHTbN5 MLBD/pchWyqxo+hIMUsc+4C92yZsTsg= X-Google-Smtp-Source: ABdhPJyJy1/tYEH7kMRL5igeouQb7S8GnOCm7hqLzSJFCImqxeUHDZkDrFy+PWsxDsoCo1cetO2Lmg== X-Received: by 2002:a7b:c92f:: with SMTP id h15mr1763738wml.20.1627653549724; Fri, 30 Jul 2021 06:59:09 -0700 (PDT) From: Mahmoud Mandour To: qemu-devel@nongnu.org Subject: [PATCH v4 08/13] docs/tcg-plugins: new passing parameters scheme for cache docs Date: Fri, 30 Jul 2021 15:58:12 +0200 Message-Id: <20210730135817.17816-9-ma.mandourr@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210730135817.17816-1-ma.mandourr@gmail.com> References: <20210730135817.17816-1-ma.mandourr@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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::32e; envelope-from=ma.mandourr@gmail.com; helo=mail-wm1-x32e.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, alex.bennee@linaro.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: 1627653991308100001 Signed-off-by: Mahmoud Mandour Reviewed-by: Alex Benn=C3=A9e --- docs/devel/tcg-plugins.rst | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/devel/tcg-plugins.rst b/docs/devel/tcg-plugins.rst index 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 11 09:15:58 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 16276540931271000.6542980902012; Fri, 30 Jul 2021 07:08:13 -0700 (PDT) Received: from localhost ([::1]:33162 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m9TBL-0004kd-U2 for importer@patchew.org; Fri, 30 Jul 2021 10:08:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35820) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m9T2h-0004ky-4L for qemu-devel@nongnu.org; Fri, 30 Jul 2021 09:59:15 -0400 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]:44666) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m9T2f-0006gF-F0 for qemu-devel@nongnu.org; Fri, 30 Jul 2021 09:59:14 -0400 Received: by mail-wr1-x430.google.com with SMTP id z4so11455725wrv.11 for ; Fri, 30 Jul 2021 06:59:13 -0700 (PDT) Received: from localhost.localdomain ([102.44.217.242]) by smtp.gmail.com with ESMTPSA id h9sm1770277wrw.38.2021.07.30.06.59.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Jul 2021 06:59: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=6s/hh8/s2nyZqNr3a/RAcx7sX2YweNlw0nNeN1vHD9w=; b=S38cMTnegYn3V5li9CvxXHaS/UxMtYCyIp0LJIDQ4tMrADgVsigKbtISkxA3tI6W8A UgDo6TCIwEHgRwxycwPRFhHZ1pDhgXA18iSFCqCNB44bNXLuLzzi3mt0bG+WIDzbZYHg K3cMCCGNtW2288SFLLS2wLDJrKF5QTzR3BpI0yv6YLW1486OQZg7LJMWw4qCr/77c/eA +4pp4DNnLYZ0WNM7YXM0IE+7/C1D7KvN2jHzFNXEn2u3lt1fNc+Tpn6ctmGGIcPEyyos KQOs1ENeXbHsuE3IBfpsPMF4qMnAjl5Y7/2sq1XJ0+nkZ9hzeoWoBYkvt4l1GUTyNpTz pJVQ== 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=6s/hh8/s2nyZqNr3a/RAcx7sX2YweNlw0nNeN1vHD9w=; b=MLLumLov+/XWCntb352riQXnWM9VYFJ+S6D0fmDy2fGzPXQ+Dsi35f0SREim6QUHBa gTzWxg/uyldC8JFiJw6b4dvvJL0g88VFpAJloa/zwmVtwepaiGnd39cYnVnFFvk79pWq U/lG/2whO8cbnI8Th0b61OKzbkdYNleS14IwNtn2eTviG090EA394eWj7SZX411jA1m7 X1qyegdrCg5MIsG2ORXQiQXz7dVx4kFUrUnculddTJhkyjIMP3MfK/ny4q/3fvyk9awW ADFwlBfxkSTyjZ7PTsCsptTnDufU5dlQWk1FhkzZ+FPjbQrBA6HIenyPJBj2/f+rciQ2 7l4w== X-Gm-Message-State: AOAM532iBKhO/m5NVcIT60l6HpRGbhQqBzIR6V7TVCfUueLWWXUHw5K8 EfUYT8oQVdm39TPhiTKkXM7Y/n9Savo= X-Google-Smtp-Source: ABdhPJw2ofriIIqGHWntTSSBT6GpzpkLWGFzGL4ZFHB2AviRGsUVzYnBqfZdo42iZtKu4SjwTVaViQ== X-Received: by 2002:a05:6000:189:: with SMTP id p9mr3211191wrx.137.1627653551892; Fri, 30 Jul 2021 06:59:11 -0700 (PDT) From: Mahmoud Mandour To: qemu-devel@nongnu.org Subject: [PATCH v4 09/13] tests/plugins/bb: adapt to the new arg passing scheme Date: Fri, 30 Jul 2021 15:58:13 +0200 Message-Id: <20210730135817.17816-10-ma.mandourr@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210730135817.17816-1-ma.mandourr@gmail.com> References: <20210730135817.17816-1-ma.mandourr@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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, alex.bennee@linaro.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: 1627654095735100001 Signed-off-by: Mahmoud Mandour Reviewed-by: Alex Benn=C3=A9e --- tests/plugin/bb.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/tests/plugin/bb.c b/tests/plugin/bb.c index de09bdde4e..7d470a1011 100644 --- a/tests/plugin/bb.c +++ b/tests/plugin/bb.c @@ -104,10 +104,17 @@ QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugi= n_id_t id, =20 for (i =3D 0; i < argc; i++) { char *opt =3D argv[i]; - if (g_strcmp0(opt, "inline") =3D=3D 0) { - do_inline =3D true; - } else if (g_strcmp0(opt, "idle") =3D=3D 0) { - idle_report =3D true; + g_autofree char **tokens =3D g_strsplit(opt, "=3D", 2); + if (g_strcmp0(tokens[0], "inline") =3D=3D 0) { + if (!qemu_plugin_bool_parse(tokens[0], tokens[1], &do_inline))= { + fprintf(stderr, "boolean argument parsing failed: %s\n", o= pt); + return -1; + } + } else if (g_strcmp0(tokens[0], "idle") =3D=3D 0) { + if (!qemu_plugin_bool_parse(tokens[0], tokens[1], &idle_report= )) { + fprintf(stderr, "boolean argument parsing failed: %s\n", o= pt); + return -1; + } } else { fprintf(stderr, "option parsing failed: %s\n", opt); return -1; --=20 2.25.1 From nobody Sat May 11 09:15:58 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 162765416354887.85894024339291; Fri, 30 Jul 2021 07:09:23 -0700 (PDT) Received: from localhost ([::1]:37886 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m9TCU-0007tM-It for importer@patchew.org; Fri, 30 Jul 2021 10:09:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35830) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m9T2i-0004r4-IC for qemu-devel@nongnu.org; Fri, 30 Jul 2021 09:59:16 -0400 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]:53966) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m9T2g-0006h2-SO for qemu-devel@nongnu.org; Fri, 30 Jul 2021 09:59:16 -0400 Received: by mail-wm1-x32a.google.com with SMTP id k4so6046080wms.3 for ; Fri, 30 Jul 2021 06:59:14 -0700 (PDT) Received: from localhost.localdomain ([102.44.217.242]) by smtp.gmail.com with ESMTPSA id h9sm1770277wrw.38.2021.07.30.06.59.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Jul 2021 06:59: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=zxLw37g0p1U+vj1vQs/yt69khicQeemW6AG3k8dnQrE=; b=vRW3SfBXxyzz6/OFuIaK2o2W695xbn9jWnWWG5V/42Hu3Pb6ginIjnv6fAb1OzuRtd 4/9uSYZMJz67hOMOvXqXXiGRq8igvejsHH1NVSlCZ/3PKMum+WjA17BCGNPXjnyZwlUE pc54D1T+1xxmIIptMgzwaZ2LdxhqeLxzH77hno9USafenN6kt3EeYZqCC+LXRD39+57m n3ac712eufWg5BOhKiMaZPbpEG+oNm6PMswbCl6i6GR6Jr0XrP8i5v/mUzeV10MJoyhI 2ZzgrqPhos0xmJ06pKsYrBaOleAElmwme7NzzNxBaAUhBWvR59fN6hxqduqiuWjIdwld JAiA== 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=zxLw37g0p1U+vj1vQs/yt69khicQeemW6AG3k8dnQrE=; b=rpgZi+7LDU9w++9HiVekzbb12cJ1s8EfupLkMpelOxs1g1tZxLAFR7DcltnqYbTxWk Zfp0gsuZK/b0Is/vAfrY7Hn8Cu20sNM5bfJprTXAyNJK/fz0lPJufO52qNGmZoZQ7MT9 7bJMj7RofHwGgWGa9/Y/gWhPdqEj87ZAqvp55BYowrQWgnMVc0jV5iJnWqZkHiuyxb9h VZ0STw540acTrHSZbOlQgOeW7a5Y/+UnvaWMVb5e891APx9ggm7j1yfi0z+rH/AfjbeN m7dOhdfopudffKIBl9O3n59DLwoxUyPpn4/rTxdS/wIxBXE/PgHRxV0s5a06dyS4phnf YuIA== X-Gm-Message-State: AOAM530nvjZuVmFVrKqoiho/HUryQPWaU8oBXONxYYXnjzxjkfSdQsmW UF9Cgc6Q1mt1DwZuiov4dG/AlaH79wU= X-Google-Smtp-Source: ABdhPJzcpx/jj0afxzSqBSguLIcN4Kv0CeXH6kK4mh3HyUWWlj4qdSeZPLbViMZueB1t1H/sukH9tA== X-Received: by 2002:a7b:c5d2:: with SMTP id n18mr3239283wmk.97.1627653553313; Fri, 30 Jul 2021 06:59:13 -0700 (PDT) From: Mahmoud Mandour To: qemu-devel@nongnu.org Subject: [PATCH v4 10/13] tests/plugins/insn: made arg inline not positional and parse it as bool Date: Fri, 30 Jul 2021 15:58:14 +0200 Message-Id: <20210730135817.17816-11-ma.mandourr@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210730135817.17816-1-ma.mandourr@gmail.com> References: <20210730135817.17816-1-ma.mandourr@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=ma.mandourr@gmail.com; helo=mail-wm1-x32a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mahmoud Mandour , cota@braap.org, alex.bennee@linaro.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: 1627654165448100002 Made argument "inline" not positional, this has two benefits. First is that we adhere to how QEMU passes args generally, by taking the last value of an argument and drop the others. And the second is that this sets up a framework for potentially adding new args easily. Signed-off-by: Mahmoud Mandour Reviewed-by: Alex Benn=C3=A9e --- tests/plugin/insn.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tests/plugin/insn.c b/tests/plugin/insn.c index c253980ec8..0f6a1938c1 100644 --- a/tests/plugin/insn.c +++ b/tests/plugin/insn.c @@ -62,8 +62,18 @@ QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin_i= d_t id, const qemu_info_t *info, int argc, char **argv) { - if (argc && !strcmp(argv[0], "inline")) { - do_inline =3D true; + for (int i =3D 0; i < argc; i++) { + char *opt =3D argv[i]; + g_autofree char **tokens =3D g_strsplit(opt, "=3D", 2); + if (g_strcmp0(tokens[0], "inline") =3D=3D 0) { + if (!qemu_plugin_bool_parse(tokens[0], tokens[1], &do_inline))= { + fprintf(stderr, "boolean argument parsing failed: %s\n", o= pt); + return -1; + } + } else { + fprintf(stderr, "option parsing failed: %s\n", opt); + return -1; + } } =20 qemu_plugin_register_vcpu_tb_trans_cb(id, vcpu_tb_trans); --=20 2.25.1 From nobody Sat May 11 09:15:58 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 1627653934427320.92870316831034; Fri, 30 Jul 2021 07:05:34 -0700 (PDT) Received: from localhost ([::1]:53370 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m9T8m-0007gV-PC for importer@patchew.org; Fri, 30 Jul 2021 10:05:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35844) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m9T2k-0004vC-63 for qemu-devel@nongnu.org; Fri, 30 Jul 2021 09:59:18 -0400 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]:52806) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m9T2i-0006iY-IZ for qemu-devel@nongnu.org; Fri, 30 Jul 2021 09:59:17 -0400 Received: by mail-wm1-x32f.google.com with SMTP id n11so6050156wmd.2 for ; Fri, 30 Jul 2021 06:59:16 -0700 (PDT) Received: from localhost.localdomain ([102.44.217.242]) by smtp.gmail.com with ESMTPSA id h9sm1770277wrw.38.2021.07.30.06.59.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Jul 2021 06:59: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=j2bcYufkvfsmpiC13AyXKhfn6hctOEG8Yo4KBaOoajc=; b=uBELWrMa+/GJmPSX2W6wyxuK62gTVkBEBoRHuW6cSlsn1dYoHxE2DvQvUJMi7H8uyp BeZGjMF4mLIbvBCO/fnpCkx+LZ/ikovJtB/ZOI5H9WqE4BFfepOUvtfrW75GQyfBjNZE NGLOhmdgaGvdbpHJamf1BftOAnJOgYMOTlTStoiyfjE9meP93ZRdWOHl9TeSq0G0yN+M Vkqekwh4vw0GgsUA4G8ZIwSlmX/sBHciHOKbJyJZngQEWI7ntvazbfF4wV6+wroBqzux 3U6svnfVTcMx+k/s7dtv2pn/p/MRVV5gCe6aOPCaObXixAL1lCBvRtqBlowLtQeT2O+G /Uzw== 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=j2bcYufkvfsmpiC13AyXKhfn6hctOEG8Yo4KBaOoajc=; b=OFi0KJFQSr40kitrBG6S02Wkxj/MzBRK/Gxyu7i2LZ7y8zZMxY1BZaQBhl7K/7yU15 +hzePvYTRWmj+Lhjwnmq4XqTs/h+4t9+Wa8qLevGWTvxPoZdLc+YsJ7xiKZ/KwPuTngX 1L5KLeH03c9qjRltyNhYv67wQxCotaAiIAgtXSYFdyFfLOGiICDl32MtuSb2vvtkk8dR LwzN/cc34jPiaGgCvIudJXm2uW+TVGdVOwcN/Qekmt6InmjgArdGTtuoKd4EEM+NPKjU s85EczpozyuiZqqI+hMDAAn8zc+onlveoK5jGAC1ZbNCNChGjIwrG1LNeWa8rEOfWbMD fDpg== X-Gm-Message-State: AOAM531lfpJKNd/LRc3cYYaO0dUJWCPEpwi+QczZ9tJf2rpzBY9KSVVf apAwTodY/ICPYEUv1UErhbyb3sF7y6M= X-Google-Smtp-Source: ABdhPJymWTxooNX6iAPpYBP/mf8CIyu0aXhYAPQZijtqv+IOws93uTsJPYjvZ3y8i/1+/gKUCYIXyw== X-Received: by 2002:a1c:4b04:: with SMTP id y4mr3114082wma.133.1627653554989; Fri, 30 Jul 2021 06:59:14 -0700 (PDT) From: Mahmoud Mandour To: qemu-devel@nongnu.org Subject: [PATCH v4 11/13] tests/plugins/mem: introduce "track" arg and make args not positional Date: Fri, 30 Jul 2021 15:58:15 +0200 Message-Id: <20210730135817.17816-12-ma.mandourr@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210730135817.17816-1-ma.mandourr@gmail.com> References: <20210730135817.17816-1-ma.mandourr@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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::32f; envelope-from=ma.mandourr@gmail.com; helo=mail-wm1-x32f.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, alex.bennee@linaro.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: 1627653935516100001 This commit makes the plugin adhere to the new plugins arg-passing scheme by expecting full-form boolean args instead of short-form booleans. This necessitates that we introduce a new argument, here "track", to accept "r", "w", or "rw". Also, it makes arguments not positional and we only care about the last value specified for a certain argument. callback/inline args are now supplied separately as bool arguments so that both can be enabled individually. Signed-off-by: Mahmoud Mandour Reviewed-by: Alex Benn=C3=A9e --- tests/plugin/mem.c | 47 ++++++++++++++++++++++++++++------------------ 1 file changed, 29 insertions(+), 18 deletions(-) diff --git a/tests/plugin/mem.c b/tests/plugin/mem.c index afd1d27e5c..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 11 09:15:58 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 1627654051065939.3684158938028; Fri, 30 Jul 2021 07:07:31 -0700 (PDT) Received: from localhost ([::1]:59274 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m9TAf-0003Jn-VZ for importer@patchew.org; Fri, 30 Jul 2021 10:07:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35854) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m9T2l-0004zp-E0 for qemu-devel@nongnu.org; Fri, 30 Jul 2021 09:59:19 -0400 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]:38441) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m9T2j-0006jN-TG for qemu-devel@nongnu.org; Fri, 30 Jul 2021 09:59:19 -0400 Received: by mail-wr1-x430.google.com with SMTP id l18so11454042wrv.5 for ; Fri, 30 Jul 2021 06:59:17 -0700 (PDT) Received: from localhost.localdomain ([102.44.217.242]) by smtp.gmail.com with ESMTPSA id h9sm1770277wrw.38.2021.07.30.06.59.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Jul 2021 06:59: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=3nmUEZ6fsiaaAzFrMlJ9P6ABRodgQbIf6UW0T/fpo6M=; b=sqLPlywEGfLzKSNsMIJyxA+k9hi7EgoIS2hwgMmuKLqcBSpQ327wABVkQdodofoE2H CGRMkdLVrInTPgDlyxoRr1Wk+r32VKwgdd5whyYnAwQh349Z4I9FMQHtU/wVx3yiwAxs 4A1UFUnmbWIYjGRycx2cXuekgU3t5wJ7yw7u5Q0Y7bbkIW/p83FNrxzPxrnIWMHjLr/7 Xd+c37j34lzjglXP0dihrww/OZZGFsXaIg/fKqt6CFBwmVof0KQoESDHwe7O7k0WXzbD S/UaJSIuVa8rmS38GK5exTxOlpuLLlyGqb/LcsmzNWbPqgjucJ6pemtbiZvYO/u4AX9O sxHA== 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=3nmUEZ6fsiaaAzFrMlJ9P6ABRodgQbIf6UW0T/fpo6M=; b=KIyrRLZTd3BQiYMM82xhXGCELYdQEDHs3JaRzAtQUrTTdKGg20c5nYXSfSQSPks5hY 4FkgGewnM1qlI1Ck/JGvFgmvwg9oYa7j6cNomLzrcaGwWC8w0SonwlznihuosfZCZqog a2ylRIJiyxpf+3xRcELlwR9t5PS5cq3DUnV9uoSO+HXAOCPp38d2LMjkU/8WHJ63MTj9 aNZqxI5GPn4g92Ru890Dys513InoiNkingg3yTKBtmYw7yWU46wywLqraR+bE0QNiMnF pve0FtJbfa8uCdWSJxgexmGo8+IcMKZN0cfyXHGthMeHBM/GngF2h2LnhCd8SFyZjAj+ AHEg== X-Gm-Message-State: AOAM5325DOFLwhlAEFK+YQfASKYKzBXIu3pT2AzBP/OJ+zidyh6nRuij aT7CROircm8orCYFgRP+l5/TRnuQ1q8= X-Google-Smtp-Source: ABdhPJxi/Gr8RPZR/c1S/9qT3c7rP22j6Ypf5OexhQu/HkErXgt5YXiMcS7AFN7Gw2a5f7AkEn4A6w== X-Received: by 2002:adf:fc0c:: with SMTP id i12mr3209494wrr.373.1627653556510; Fri, 30 Jul 2021 06:59:16 -0700 (PDT) From: Mahmoud Mandour To: qemu-devel@nongnu.org Subject: [PATCH v4 12/13] tests/plugins/syscalls: adhere to new arg-passing scheme Date: Fri, 30 Jul 2021 15:58:16 +0200 Message-Id: <20210730135817.17816-13-ma.mandourr@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210730135817.17816-1-ma.mandourr@gmail.com> References: <20210730135817.17816-1-ma.mandourr@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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, alex.bennee@linaro.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: 1627654052774100001 Signed-off-by: Mahmoud Mandour Reviewed-by: Alex Benn=C3=A9e --- tests/plugin/syscall.c | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/tests/plugin/syscall.c b/tests/plugin/syscall.c index 6dd71092e1..484b48de49 100644 --- a/tests/plugin/syscall.c +++ b/tests/plugin/syscall.c @@ -119,17 +119,26 @@ QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugi= n_id_t id, const qemu_info_t *info, int argc, char **argv) { - if (argc =3D=3D 0) { - statistics =3D g_hash_table_new_full(NULL, g_direct_equal, NULL, g= _free); - } else { - for (int i =3D 0; i < argc; i++) { - if (g_strcmp0(argv[i], "print") !=3D 0) { - fprintf(stderr, "unsupported argument: %s\n", argv[i]); - return -1; + bool do_print =3D false; + + for (int i =3D 0; i < argc; i++) { + char *opt =3D argv[i]; + g_autofree char **tokens =3D g_strsplit(opt, "=3D", 2); + + if (g_strcmp0(tokens[0], "print") =3D=3D 0) { + if (!qemu_plugin_bool_parse(tokens[0], tokens[1], &do_print)) { + fprintf(stderr, "boolean argument parsing failed: %s\n", o= pt); } + } else { + fprintf(stderr, "unsupported argument: %s\n", argv[i]); + return -1; } } =20 + if (!do_print) { + statistics =3D g_hash_table_new_full(NULL, g_direct_equal, NULL, g= _free); + } + qemu_plugin_register_vcpu_syscall_cb(id, vcpu_syscall); qemu_plugin_register_vcpu_syscall_ret_cb(id, vcpu_syscall_ret); qemu_plugin_register_atexit_cb(id, plugin_exit, NULL); --=20 2.25.1 From nobody Sat May 11 09:15:58 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 1627653585129809.0737889022523; Fri, 30 Jul 2021 06:59:45 -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-71-A1GOCDRMPry9LSE5YMmFpQ-1; Fri, 30 Jul 2021 09:59:41 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3C087871805; Fri, 30 Jul 2021 13:59:33 +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 5BF5D5D6A1; Fri, 30 Jul 2021 13:59:30 +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 2673718087F1; Fri, 30 Jul 2021 13:59:27 +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 16UDxO5R019861 for ; Fri, 30 Jul 2021 09:59:24 -0400 Received: by smtp.corp.redhat.com (Postfix) id 56A3B1067DB7; Fri, 30 Jul 2021 13:59:24 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast02.extmail.prod.ext.rdu2.redhat.com [10.11.55.18]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 51BA61067DB4 for ; Fri, 30 Jul 2021 13:59:21 +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 B84BA8007B1 for ; Fri, 30 Jul 2021 13:59:21 +0000 (UTC) Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-52-RAYZYeACPSmdikqOATUkKw-1; Fri, 30 Jul 2021 09:59:19 -0400 Received: by mail-wm1-f51.google.com with SMTP id h24-20020a1ccc180000b029022e0571d1a0so6490096wmb.5 for ; Fri, 30 Jul 2021 06:59:19 -0700 (PDT) Received: from localhost.localdomain ([102.44.217.242]) by smtp.gmail.com with ESMTPSA id h9sm1770277wrw.38.2021.07.30.06.59.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Jul 2021 06:59:17 -0700 (PDT) X-MC-Unique: A1GOCDRMPry9LSE5YMmFpQ-1 X-MC-Unique: RAYZYeACPSmdikqOATUkKw-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=sw3UPvxnV853vw95FLuvZOYp8RKQBupowmaMJ/+v9VJWQ1SrsSub3UIVu1ABt8Z5LO pVeoxdHSQC4QYkAZh3g8yHV5Plt3rKnJypFurj5DXPb1xNJ2YUuUVv0Ov4TsGgHPZlLj zha/8qwCurtoZbd3+Vdsc9T5j7ET9wWDMbMco+V2dtXu3jOAOJM7ZqHVMuYt+gZ9LQwM fbNuqX4haOPPr2LzFCH7WDO6PZIb/FGc1vZFiTUmdvQWIDkWkKlMULk7vk7Irq1+FHEH NowHvFzWz6fAYXAqF/IDsMoMe6VAawSMZEm5Xe2GxctsS6diyJObKTgeStIjhYB4smp6 qMMA== X-Gm-Message-State: AOAM532BjDwVw+XrwgwnJvlWMlomuN+KtJ3YjcIs8UiONj1bGcE2hARd 4wDefl8ezaKBTyDylyPN2xc= X-Google-Smtp-Source: ABdhPJw7ZRPg6y1I1pv06fhSYbIzrKakYdZ/vNe6ADf/4o1h7oTYixYUjsnGsuDAPhaJERvFC1DFhA== X-Received: by 2002:a7b:ce99:: with SMTP id q25mr3184032wmj.4.1627653558255; Fri, 30 Jul 2021 06:59:18 -0700 (PDT) From: Mahmoud Mandour To: qemu-devel@nongnu.org Subject: [PATCH v4 13/13] docs/deprecated: deprecate passing plugin args through `arg=` Date: Fri, 30 Jul 2021 15:58:17 +0200 Message-Id: <20210730135817.17816-14-ma.mandourr@gmail.com> In-Reply-To: <20210730135817.17816-1-ma.mandourr@gmail.com> References: <20210730135817.17816-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, alex.bennee@linaro.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.15 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: 1627653587924100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Mahmoud Mandour Reviewed-by: Alex Benn=C3=A9e --- 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