From patchwork Tue Nov 12 21:26:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 842732 Delivered-To: patch@linaro.org Received: by 2002:a5d:6307:0:b0:381:e71e:8f7b with SMTP id i7csp3797109wru; Tue, 12 Nov 2024 13:27:10 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXuA8rEhezIs1k4vWfuRU4wk7eKVj7405EgoSCz/5+og+iP/m3W2QX7zVKnhEXMuQC7DQ6Xiw==@linaro.org X-Google-Smtp-Source: AGHT+IEELYPM9KUBeqTz+Z9fCjgpa2f66p/j6YpgIZKaokzU9HzVXfjlbt0yV5QrnRQxWTi8u81+ X-Received: by 2002:a05:622a:388:b0:45d:5f8c:8280 with SMTP id d75a77b69052e-4634b538029mr8131831cf.35.1731446829741; Tue, 12 Nov 2024 13:27:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1731446829; cv=none; d=google.com; s=arc-20240605; b=JzV+lTAEAOYnGFw+jzB90PQPSKqb7djyoZXdhHWv56sqqFN3HS6uW7T6l2fIteZObd CwdO3ApqG4mASO4KGg8S1yAEbCTwX+TrKhhg/RMPKSvI7spKsqN2Q7bJVnEP90B90Y+Y rQfd7A8y92T2p8OkqAtICrYErePmzKZFBLPUaN7WBAXAqEvQ1ZVvFnW7cSM3aArpv1eW l3cDEeFDWs7bTd+giOPMogj7qHlI0a4UsmWG7zmQ28shgB0+s62Qlts1uPwLIsgUR0o4 KMJtXEo3WyLQhRNP8Jz5cKz1F/5oRSjhYk+KTjLOJmhBvA0rL7mopKoWgHSzSc633qWh UvIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=3jWErWBIj0F5t4NqhpwMkB48eX+pCqWPGB0s4Lu9mBc=; fh=aVWhm5VpoEE5wj/nuwR58PlkFRmLimwxkJm1Ojog5jA=; b=AeAowt4nk0FTbXmBJfUfSgX8/zitUWpmebUKdQ1J+0JjyliUg5+3ql/XBRXsuwMxLH c71yZvpP1im4H3TScyoZ/8W5pxTjn/ObeLpL4TjaYq6WShr0EP4f0zTOgDjTQsceSdBZ bA2VlZ0N+ujkEV93bvACtH/BYmcPxN27lZzf19jLpzzLizkRR95o78uIny72lXHlEgfN k9yqyRgchH0p+AG/sc0CJ+N4P9KqApLjJfPiZfD369xqLxFZhnE3hlfTP+VwAzBN3Afk GolTAI2CTb8S3ImLfLxz8yyR/zhVucsEOjmoqwWwIZQLdRCoF8m64xo/LOrowEv+kiMm WJqg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xyp+MNUb; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-462ff625bc2si133918821cf.479.2024.11.12.13.27.09 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 12 Nov 2024 13:27:09 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xyp+MNUb; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tAyPS-0003iL-Aa; Tue, 12 Nov 2024 16:26:50 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tAyPI-0003hG-Fz for qemu-devel@nongnu.org; Tue, 12 Nov 2024 16:26:43 -0500 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tAyPG-0004St-Ce for qemu-devel@nongnu.org; Tue, 12 Nov 2024 16:26:40 -0500 Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-37d533b5412so4239171f8f.2 for ; Tue, 12 Nov 2024 13:26:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1731446794; x=1732051594; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=3jWErWBIj0F5t4NqhpwMkB48eX+pCqWPGB0s4Lu9mBc=; b=xyp+MNUbwf9qXis9L0SSnmz1qwbY3IOTJn4Py1GVgdHojmvjkn9WpPLoKRQC35UN4n jIMZi/J6lV952Xe1cLxp27C4Plpl3138jCQHDtjgIxx5FUGJFc2/Qyax4YNK34tInJa2 O93ZC4L+/YlSKjlUSLYLUClb0Cdj4q7XJMuVzmfz8mXqAAQDaN04h5sc4L4SkYKZB7JT hj7E8pfUZbRc7lWutkQUCCTIzc17XP2X4ak2RkHLMeKOCfD0n5igFBUrFGAia83jykYP cze11qucYHQjaTFfT9+n7P/Kowo+qK111Dk9Tdqk7t5OZr4lLTopjH0cEbz/Y1X8/XvP IKlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731446794; x=1732051594; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3jWErWBIj0F5t4NqhpwMkB48eX+pCqWPGB0s4Lu9mBc=; b=vcEtaLydUXwM0iGWqZhElnRXRmTHmFrSPBiywnEAOQnVsjAjq+xG3iZtBQ0E9Wllea sV08nY2GavtgIAwYX+wjoHtvl6YJTXnAW4jNO+8mSsGFp/Lu2dNnXHXjDKQJbx8OxvgD 9RpmLQjI1Oed2Dp+OSZAewX25T8A2E0FK97id2PcSW56P7ztRMiYE1/Uc+jy42kShLqz IJbQ07fTKLrEx2eSg759EbVrjbzn5/CMNuJYAXrVZLR+9xBsydKqaxbTnPfBXkcCw3Oe XbMul6Swq3ISFqM/0UhcK+4zVZU5thDSzsGRrFC1A/gJNExq35l/NH7XHi7M2Q2YC+GL hb0Q== X-Gm-Message-State: AOJu0Yxc39YKXyJsHVzPjnHrGMs0tE4T/N1yXs5M4+D3t4qopLr9AlO5 9Us1So+3AdwScN0ODR7IHn9Vzahnqz+Vu8nSSLV2O0vrXjnKLP1t9ulaqm1ESumvP8fIIT2B4g9 1CY2XDA== X-Received: by 2002:a5d:6c64:0:b0:37d:528d:b8ad with SMTP id ffacd0b85a97d-381f1865423mr16586941f8f.6.1731446794352; Tue, 12 Nov 2024 13:26:34 -0800 (PST) Received: from linaro.. ([193.32.126.214]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-381ed9ec202sm16613515f8f.83.2024.11.12.13.26.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Nov 2024 13:26:34 -0800 (PST) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Pierrick Bouvier , Mahmoud Mandour , =?utf-8?q?Alex_Benn=C3=A9e?= , Alexandre Iooss , Cleber Rosa , John Snow , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v4 1/3] plugins: add missing export for qemu_plugin_num_vcpus Date: Tue, 12 Nov 2024 13:26:20 -0800 Message-Id: <20241112212622.3590693-2-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241112212622.3590693-1-pierrick.bouvier@linaro.org> References: <20241112212622.3590693-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=pierrick.bouvier@linaro.org; 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, 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Fixes: 4a448b148ca ("plugins: add qemu_plugin_num_vcpus function") Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Pierrick Bouvier --- include/qemu/qemu-plugin.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/qemu/qemu-plugin.h b/include/qemu/qemu-plugin.h index 622c9a02327..0fba36ae028 100644 --- a/include/qemu/qemu-plugin.h +++ b/include/qemu/qemu-plugin.h @@ -803,6 +803,7 @@ void qemu_plugin_register_atexit_cb(qemu_plugin_id_t id, qemu_plugin_udata_cb_t cb, void *userdata); /* returns how many vcpus were started at this point */ +QEMU_PLUGIN_API int qemu_plugin_num_vcpus(void); /** From patchwork Tue Nov 12 21:26:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 842733 Delivered-To: patch@linaro.org Received: by 2002:a5d:6307:0:b0:381:e71e:8f7b with SMTP id i7csp3797204wru; Tue, 12 Nov 2024 13:27:27 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUNBZ07YxEMcZlKNKx1ktIPh0Tjb2gKlvDc89iVKXscPggfZWc7gDCM3/tqW+LhNRnNWP2y7A==@linaro.org X-Google-Smtp-Source: AGHT+IE0k5c4WMk8MPJ0WCr4TGRA6mqTF/QQBtnqG3FXnsZe4LcgezejanivT6UvqCZ9Gq8buaBa X-Received: by 2002:a05:622a:1805:b0:461:40f3:75c0 with SMTP id d75a77b69052e-4630945d652mr267999771cf.56.1731446847588; Tue, 12 Nov 2024 13:27:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1731446847; cv=none; d=google.com; s=arc-20240605; b=OIdCbPFDn5Vh6LJJsRWTRwElraXT0nJKQBSKqc9TuUnMSFtzZgfaugt9mU1ICDI3r4 4AhzNkKQFPJcv2pDAet3bRIv6IpK26c9Kckfv3CMGmY4ft+IH50oAHlzVoSwqnSBtAFF RVlueY6vc2HZMN74qOvybuwjh3R14xMW4xJ6OAgNO8lYSIXi/p/WAi3KLkk5lGLwd+Qv BOst2qw564Ly9qbM3Tb6rlvC9tnh5P6Qe7nSJU7h2LIffQGXzNf0ZMNkqSyNHdPthDQs xc6ut+5jClL8gTHWtzyW2//RuHxaFbtAJjygz/ejDXpcjZLrOcLVZbp5ctU7fKMQIS7v 98gA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=/StD3IgdHph1GnsDJB+ee0l75mNWFNIYbQ7+87JHqMU=; fh=ItwzL/z9IWPLPrQVRGFNgmHtsudwx+Rr6O9JZh9myHQ=; b=GpPMl+okrKBD3AkBVWv6ufQb0jaxC/auMEpGd9Ae6OUVWtBAQBBSCxmxG1jPINhLgc R/RoweyLdme3/DP+bHwYm86/uBCSRMs6Ky1D7HskLQof3hpfxZfRCXtJZal9Ttm8+q1a NCRTOdEEpDbb6tdws5H2wp9EK3NSOTm3xg9aw4rh8g7N4vfujcpvr2swTXc21idPZWbA VGntgE6LTIJMz5lEEoYu226nf2d8LK6Vsyg+75F+slz3m3lNnTpzk65LQw+DZj5PRYab j/D0R9D3PqBIJmngBr3KOnfBawVS26XFMtNBG01EA/SvkXFFgRCmk/wF8Jnp1xpaOgJa DXSg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AR3jRnOs; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-462ff667d14si142938101cf.507.2024.11.12.13.27.27 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 12 Nov 2024 13:27:27 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AR3jRnOs; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tAyPQ-0003iD-HC; Tue, 12 Nov 2024 16:26:48 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tAyPI-0003hH-TG for qemu-devel@nongnu.org; Tue, 12 Nov 2024 16:26:43 -0500 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tAyPH-0004TB-2P for qemu-devel@nongnu.org; Tue, 12 Nov 2024 16:26:40 -0500 Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-37d5aedd177so3586315f8f.1 for ; Tue, 12 Nov 2024 13:26:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1731446796; x=1732051596; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=/StD3IgdHph1GnsDJB+ee0l75mNWFNIYbQ7+87JHqMU=; b=AR3jRnOsHCp9x3bCd3u5ggsppdk5oV8s2bpHxMdze0kN7b2rKkAxKfxDLzPgIPsQpy w0a85nza+WHp6+Pe2GpcsQ3g7GaV3mYALd18aGGh4HM0s/NH5u6fKm73txrj2vrQGcda lZ0JkIkwC7Jp+sIg8/e3Yb9q/kgORpg06CrMxUL5TaJcTnIqXAdYZQiT4fTAuRi8221k ne/aKwNqrNyipgQbomHmYr/oZTz5YUl3Y1Z3vq8qDeH0+GlBg9aMqH+uljcVasdNoun2 LL9cCILLBB1vrACGYgAmsztrcYRou0iqfLvQgf6bVcTz5a565YrshXI4mZ9C0FRRyB7n XH2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731446796; x=1732051596; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/StD3IgdHph1GnsDJB+ee0l75mNWFNIYbQ7+87JHqMU=; b=hgbj7sWQ25DapiwSfw1VXwhhhTchqIZnOJEeCgsp93WsiL3kWr3NG9pL8CZaTfGueX 9vLLrOn0p9QVpg8ADSj+9doRxAh2VD5jDjBG9r/cHiiu5fagDiI//Bkr7PyXK2pnfrv1 8RNmoStW8uT3ZmZtVPLv6glnurb7l5Bje7WhBJTlLO/KCUiv5vJn1iBkzULoK0wpI8dZ WIt5EAeb59VofAE6q1n8hTWduNV6QJAKOT35oVJ+aMW4EpAWQS4qgJO4C8p7rZqXWYkf LovqgQQutRFeWDFOxC1Xm7CB+j6iYQqOqEzjVbLw1TovvlrVfDEgm8g4jS+x/HU+fuJy Ux1w== X-Gm-Message-State: AOJu0YxlJ1SJu+Oo/xjbFQdTTNa/JX9A4vvztXrGtFh17I8AqWqeGVH3 2IHOlO2JO9ui3p2WC1QzCPdpZLtSJLGsv+7otHVZv6BpqHQU8olS3CSqzE1G2PZ/Il2aIt3qTbs PKUSk1Q== X-Received: by 2002:a5d:6d89:0:b0:381:ebac:2c5e with SMTP id ffacd0b85a97d-3820df61014mr405994f8f.14.1731446796329; Tue, 12 Nov 2024 13:26:36 -0800 (PST) Received: from linaro.. ([193.32.126.214]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-381ed9ec202sm16613515f8f.83.2024.11.12.13.26.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Nov 2024 13:26:36 -0800 (PST) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Pierrick Bouvier , Mahmoud Mandour , =?utf-8?q?Alex_Benn=C3=A9e?= , Alexandre Iooss , Cleber Rosa , John Snow Subject: [PATCH v4 2/3] plugins: detect qemu plugin API symbols from header Date: Tue, 12 Nov 2024 13:26:21 -0800 Message-Id: <20241112212622.3590693-3-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241112212622.3590693-1-pierrick.bouvier@linaro.org> References: <20241112212622.3590693-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::429; envelope-from=pierrick.bouvier@linaro.org; helo=mail-wr1-x429.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Instead of using a static file (error prone and hard to keep in sync), we generate it using a script. Note: if a symbol is not exported, we'll now notice it when linking for Windows/MacOS platforms. Signed-off-by: Pierrick Bouvier --- MAINTAINERS | 1 + plugins/meson.build | 12 ++++++--- scripts/qemu-plugin-symbols.py | 45 ++++++++++++++++++++++++++++++++++ 3 files changed, 55 insertions(+), 3 deletions(-) create mode 100755 scripts/qemu-plugin-symbols.py diff --git a/MAINTAINERS b/MAINTAINERS index 095420f8b0e..7d6d2bd59e8 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -3747,6 +3747,7 @@ F: plugins/ F: tests/tcg/plugins/ F: tests/functional/test_aarch64_tcg_plugins.py F: contrib/plugins/ +F: scripts/qemu-plugin-symbols.py AArch64 TCG target M: Richard Henderson diff --git a/plugins/meson.build b/plugins/meson.build index 1cc039d29b2..98542e926f8 100644 --- a/plugins/meson.build +++ b/plugins/meson.build @@ -2,17 +2,23 @@ if not get_option('plugins') subdir_done() endif +qemu_plugin_symbols = configure_file( + input: files('../include/qemu/qemu-plugin.h'), + output: 'qemu-plugin.symbols', + capture: true, + command: [files('../scripts/qemu-plugin-symbols.py'), '@INPUT@']) + # Modules need more symbols than just those in plugins/qemu-plugins.symbols if not enable_modules if host_os == 'darwin' configure_file( - input: files('qemu-plugins.symbols'), + input: qemu_plugin_symbols, output: 'qemu-plugins-ld64.symbols', capture: true, command: ['sed', '-ne', 's/^[[:space:]]*\\(qemu_.*\\);/_\\1/p', '@INPUT@']) emulator_link_args += ['-Wl,-exported_symbols_list,plugins/qemu-plugins-ld64.symbols'] else - emulator_link_args += ['-Xlinker', '--dynamic-list=' + (meson.project_source_root() / 'plugins/qemu-plugins.symbols')] + emulator_link_args += ['-Xlinker', '--dynamic-list=' + qemu_plugin_symbols.full_path()] endif endif @@ -23,7 +29,7 @@ if host_os == 'windows' # First, create a .def file listing all the symbols a plugin should expect to have # available in qemu win32_plugin_def = configure_file( - input: files('qemu-plugins.symbols'), + input: qemu_plugin_symbols, output: 'qemu_plugin_api.def', capture: true, command: ['sed', '-e', '0,/^/s//EXPORTS/; s/[{};]//g', '@INPUT@']) diff --git a/scripts/qemu-plugin-symbols.py b/scripts/qemu-plugin-symbols.py new file mode 100755 index 00000000000..e285ebb8f9e --- /dev/null +++ b/scripts/qemu-plugin-symbols.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +# +# Extract QEMU Plugin API symbols from a header file +# +# Copyright 2024 Linaro Ltd +# +# Author: Pierrick Bouvier +# +# This work is licensed under the terms of the GNU GPL, version 2 or later. +# See the COPYING file in the top-level directory. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +import argparse +import re + +def extract_symbols(plugin_header): + with open(plugin_header) as file: + content = file.read() + # Remove QEMU_PLUGIN_API macro definition. + content = content.replace('#define QEMU_PLUGIN_API', '') + expected = content.count('QEMU_PLUGIN_API') + # Find last word between QEMU_PLUGIN_API and (, matching on several lines. + # We use *? non-greedy quantifier. + syms = re.findall(r'QEMU_PLUGIN_API.*?(\w+)\s*\(', content, re.DOTALL) + syms.sort() + # Ensure we found as many symbols as API markers. + assert len(syms) == expected + return syms + +def main() -> None: + parser = argparse.ArgumentParser(description='Extract QEMU plugin symbols') + parser.add_argument('plugin_header', help='Path to QEMU plugin header.') + args = parser.parse_args() + + syms = extract_symbols(args.plugin_header) + + print('{') + for s in syms: + print(" {};".format(s)) + print('};') + +if __name__ == '__main__': + main() From patchwork Tue Nov 12 21:26:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 842734 Delivered-To: patch@linaro.org Received: by 2002:a5d:6307:0:b0:381:e71e:8f7b with SMTP id i7csp3797428wru; Tue, 12 Nov 2024 13:28:03 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUsBwjzcNAqAaYg1wnnCEcPbiIOPJC6iHaEd9VPqjJe5gu8gCxkTgIQ34ER6JZITiPGmzwAOA==@linaro.org X-Google-Smtp-Source: AGHT+IHvTbdeERw1v9hIgI7fFlzipbk4P43VPzJQuJmZYIQVLG1KFpG+OqA2QKcrV373M0Ie5niN X-Received: by 2002:a05:622a:418e:b0:458:2622:808a with SMTP id d75a77b69052e-4634b4d3824mr9029281cf.20.1731446883526; Tue, 12 Nov 2024 13:28:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1731446883; cv=none; d=google.com; s=arc-20240605; b=W6roM28GX6tRqLjKgvA+pTq8nEuy/RzlZ1yIwI+pzjyLVPx/LrlzQaYulbBhWfL49P NhvinzCUe/drpE9AJAQ3NKiVXPwsYG0lH8WyO7aPQb8DgUiBH4lqi1X2oBXxoEpptf0r TKNBCNRRQTMGToODCYW+CilqUC30BUGKJ4+DfeQEywte6GoUIuGXj+KbO0uctLs5fORT /V3Mho8P/1NQQxivn+zyVQ89NKgTHcmg/GFMUSto2ikOKLgVyVMejrLZRwdJD66uRlGM KLWoe7c6nEkmBis7QorU+wiB4S2rHvXJF2RbmBQc7HmcoB/NCEsws6LFiarZ5sVa+f0f /tlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=R6PRNouRIX8nn07oym8VUYNLwY1A8W1UJP1nr46hRjQ=; fh=ItwzL/z9IWPLPrQVRGFNgmHtsudwx+Rr6O9JZh9myHQ=; b=eJ/n+Pbw2WqWi/Ki6tvlxlyRVfQf0Vw3IkzPcoXUiRcDxpSyJDjpRvqzoL0HJR+VhW KZuxtnVRZMPofoiKuIcoofzsmil28ukkCM+viDtJGKlpS+L6HZp0V6Izk0DNBWKRkPiF LzrCroQADKzLP704XThiDhqrVWjcjW1h/IT/M1r2rDaVeAWEPOBA8+EjQwVXp77ZIXqk 2S0NoDHg+2GN9KfVxbq8JK4WHRa6pUb2/LJ2/DA5t7qmuXuhPCRrQUn+ZVgH/RNCGdnY LB5MluMJ2fSgOi43nshxrW8UMhKmJC+HHfdqqNzH+CbzgsIEh2hZCWAuEJ+/hmZbWsGv b1+A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=i+zc2c+P; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-462ff45c0bdsi154187431cf.198.2024.11.12.13.28.03 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 12 Nov 2024 13:28:03 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=i+zc2c+P; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tAyPQ-0003iE-U2; Tue, 12 Nov 2024 16:26:48 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tAyPJ-0003hI-GH for qemu-devel@nongnu.org; Tue, 12 Nov 2024 16:26:43 -0500 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tAyPH-0004TK-To for qemu-devel@nongnu.org; Tue, 12 Nov 2024 16:26:41 -0500 Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-37d447de11dso4573506f8f.1 for ; Tue, 12 Nov 2024 13:26:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1731446798; x=1732051598; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=R6PRNouRIX8nn07oym8VUYNLwY1A8W1UJP1nr46hRjQ=; b=i+zc2c+P05S/FY69IxARJAXm+NaZ39ML0zi0+RIwyTHnezTyOAa5r3biliSYnmSMZV Ih0io6DF84wm+A+99+egp2D9hGdYPiDOIEK8t8JBC0sEnr0CW/sNBbgGn4gq3zOKqwIq fAQVyVTEWCWSktn7psBwed1XWXBX17SJ/LuKmC2nt34Qg8sQPpfB4m7bb4KKr2HVnA1A 6GL6w66IMkuJQx5NTA0MXtrL4k+8+bO9up29FMh52xooUdLI9psnHxSBE5SbVnSnRELq n5Wjr1UKBpPOSlyNRPs8DGhDTn1tgRw6CeTRuHaLMy7GvJe5B2IEbBn2Se7o4ynXEvCa v1Dw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731446798; x=1732051598; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=R6PRNouRIX8nn07oym8VUYNLwY1A8W1UJP1nr46hRjQ=; b=ATsrYYTtYyns+No61zXq+QznNL/1f3wvVKMkGtguYVF2fXvabfY6pAuJ4AAzZ+rvN3 GLjZLa/epQYAdpqxQeeCnsIKAWXXJHq4op6dTnkGaXDd+dy9FqqoEbv9RpSRCwynhEnj r8fbCsTEvTPaR564shCMfeMCFHufU8c5Hz0TjPdL5lEbcdmbrxD2bix0MxXVDuwzPb25 bh2N0P6Y40BGySyerWCYx8RJUku8qMuccC5EA6WwpNrjeYjS+2IdOgMtJLV4vM/v1u0U PNgfVoexhY/ZbwjyYfPrAyBAjJC7cXsgIw8hdKNcRaIlalrhmDaEeFDQIegXxPmPmjpj jIuQ== X-Gm-Message-State: AOJu0YwHeUqUbp4tp4zsioMzi0pmsNi0JR1/op/EZldVFtZkKvekHWc6 J5LZyFolSs0zjAGk7m1U1wku+ljAhoawgFXQtDKMPI1mij2crMEKJmFjBWCHLpva5i82SGH5qdw p83zw8g== X-Received: by 2002:a05:6000:1566:b0:37d:5173:7a54 with SMTP id ffacd0b85a97d-3820df8cc0dmr431056f8f.52.1731446798393; Tue, 12 Nov 2024 13:26:38 -0800 (PST) Received: from linaro.. ([193.32.126.214]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-381ed9ec202sm16613515f8f.83.2024.11.12.13.26.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Nov 2024 13:26:38 -0800 (PST) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Pierrick Bouvier , Mahmoud Mandour , =?utf-8?q?Alex_Benn=C3=A9e?= , Alexandre Iooss , Cleber Rosa , John Snow Subject: [PATCH v4 3/3] plugins: eradicate qemu-plugins.symbols static file Date: Tue, 12 Nov 2024 13:26:22 -0800 Message-Id: <20241112212622.3590693-4-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241112212622.3590693-1-pierrick.bouvier@linaro.org> References: <20241112212622.3590693-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::429; envelope-from=pierrick.bouvier@linaro.org; helo=mail-wr1-x429.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Signed-off-by: Pierrick Bouvier --- plugins/qemu-plugins.symbols | 59 ------------------------------------ 1 file changed, 59 deletions(-) delete mode 100644 plugins/qemu-plugins.symbols diff --git a/plugins/qemu-plugins.symbols b/plugins/qemu-plugins.symbols deleted file mode 100644 index 032661f9ea7..00000000000 --- a/plugins/qemu-plugins.symbols +++ /dev/null @@ -1,59 +0,0 @@ -{ - qemu_plugin_bool_parse; - qemu_plugin_end_code; - qemu_plugin_entry_code; - qemu_plugin_get_hwaddr; - qemu_plugin_get_registers; - qemu_plugin_hwaddr_device_name; - qemu_plugin_hwaddr_is_io; - qemu_plugin_hwaddr_phys_addr; - qemu_plugin_insn_data; - qemu_plugin_insn_disas; - qemu_plugin_insn_haddr; - qemu_plugin_insn_size; - qemu_plugin_insn_symbol; - qemu_plugin_insn_vaddr; - qemu_plugin_mem_get_value; - qemu_plugin_mem_is_big_endian; - qemu_plugin_mem_is_sign_extended; - qemu_plugin_mem_is_store; - qemu_plugin_mem_size_shift; - qemu_plugin_num_vcpus; - qemu_plugin_outs; - qemu_plugin_path_to_binary; - qemu_plugin_read_memory_vaddr; - qemu_plugin_read_register; - qemu_plugin_register_atexit_cb; - qemu_plugin_register_flush_cb; - qemu_plugin_register_vcpu_exit_cb; - qemu_plugin_register_vcpu_idle_cb; - qemu_plugin_register_vcpu_init_cb; - qemu_plugin_register_vcpu_insn_exec_cb; - qemu_plugin_register_vcpu_insn_exec_cond_cb; - qemu_plugin_register_vcpu_insn_exec_inline_per_vcpu; - qemu_plugin_register_vcpu_mem_cb; - qemu_plugin_register_vcpu_mem_inline_per_vcpu; - qemu_plugin_register_vcpu_resume_cb; - qemu_plugin_register_vcpu_syscall_cb; - qemu_plugin_register_vcpu_syscall_ret_cb; - qemu_plugin_register_vcpu_tb_exec_cb; - qemu_plugin_register_vcpu_tb_exec_cond_cb; - qemu_plugin_register_vcpu_tb_exec_inline_per_vcpu; - qemu_plugin_register_vcpu_tb_trans_cb; - qemu_plugin_request_time_control; - qemu_plugin_reset; - qemu_plugin_scoreboard_free; - qemu_plugin_scoreboard_find; - qemu_plugin_scoreboard_new; - qemu_plugin_start_code; - qemu_plugin_tb_get_insn; - qemu_plugin_tb_n_insns; - qemu_plugin_tb_vaddr; - qemu_plugin_u64_add; - qemu_plugin_u64_get; - qemu_plugin_u64_set; - qemu_plugin_u64_sum; - qemu_plugin_uninstall; - qemu_plugin_update_ns; - qemu_plugin_vcpu_for_each; -};