From patchwork Wed Nov 6 17:09:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 841066 Delivered-To: patch@linaro.org Received: by 2002:a5d:6307:0:b0:381:e71e:8f7b with SMTP id i7csp638384wru; Wed, 6 Nov 2024 09:09:58 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCW9gB81iNzR9GYSY95P0ZweB8z8vAjk4ybuhfY9GfSL9kstznP6V5VV2ukd9zim944eDXGtzA==@linaro.org X-Google-Smtp-Source: AGHT+IExfPEalPKzYQIWWIlBBztAzJwEtRvO0N09jvcM5xyNym7jOWAhpiNRptrf6lJekiyt5BBR X-Received: by 2002:a05:6122:218f:b0:50d:69a8:f5d6 with SMTP id 71dfb90a1353d-5105d0c852cmr28067611e0c.8.1730912998107; Wed, 06 Nov 2024 09:09:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1730912998; cv=none; d=google.com; s=arc-20240605; b=RrssxEmk5iUz9AhfkQrmI/9Itf0LjzAJ9BiLnSLHg3c3Reuc33VJLIgyMKXmV1M2Sv 3npQ6sDFpiayvusv6cIwwhG/UtcKePt3IMbtNrwnZPYE3lMN5LiHdoR97qf3/ydLojUm YBNkgv6pEbLn636WGTcijSnqKnvLScvmTn+rgq39rzHWENUHbxImudaLJtlde3/Rd+VC likaE6fXVnFg/3e0lVuMm216zoQvOyNJ/T9mfdwBQLjqJFqpbv2p6viYJqijmvhFcvTV QG2BRKqBl/rKRgmE0XWWeTF5aTMIN2iO0poNwtetrQHY/ENovBlz8khK4e2PNzjbzEmk CGSQ== 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=jFMOToFM7n//AqY47n7Sud5Qo4126HBKrKGECoH/qNQ=; b=KMPaU139V61MjDA0qGkZxFyhQKdOLrlPMtK3fSh1niJCIOOZnBpBPhjN+wRkJs2Hvf p4VU5HYxB2TY7/eFt/P0q6ZeyynQF3U78Bd7Nda+Zpl8diimE/9XeTnNoP5VjMNJPkiy 47nKts0fVpsl2qf7sUvFdWjwjY0R8mr731BtoKRuWEQQmfmpmLjvFtoRqqHTx2ygCkUb 6TV++8C6noyW0mw9Z1gkkY2ydLAXaBI9PRFQ0MKzhi7lFk5LQMMkVsh79vL3eWdZWEyW H8N8Dwd927hHSAYiU2j0F6XYEBFKFWQ0nkAzjGGwZ8gQU5Uyvu17MN7whDQu6eqdT+ZC CGaA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HYtXn5Pz; 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 ada2fe7eead31-4a957490436si3533382137.210.2024.11.06.09.09.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 06 Nov 2024 09:09:58 -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=HYtXn5Pz; 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 1t8jXP-0004ox-AQ; Wed, 06 Nov 2024 12:09:47 -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 1t8jXM-0004l3-Gr for qemu-devel@nongnu.org; Wed, 06 Nov 2024 12:09:44 -0500 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t8jXK-0004ZH-Ta for qemu-devel@nongnu.org; Wed, 06 Nov 2024 12:09:44 -0500 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-37d4fd00574so51373f8f.0 for ; Wed, 06 Nov 2024 09:09:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1730912981; x=1731517781; 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=HYtXn5Pzduuj92zX5OTAoDfe74B2Zphhk+LfTUeDmZL+FmB1a8L0/GhRmTdQZW7O4R yWUSbp62zzZWOFF8PACPT8ASoomsnnhNBgJK78wPKPg8yIviyyodFfb7Rbnt7+S/Jnj5 s1LAkFYHNX0EezhnwIPXlTvsI7XgqoSB+RUhNWLhEHB3NwzBbJv+RICtT5G201LKwPvm puFmuOzRX2F73iPdfo9a4WSaDrT82SZ6mI6eVMp8iJlFpNpD5HmqNHUhQwvyHIjBR+eT rrGYleZc+KIl/mHOLXauk509vjJ1QQeW2q2nvQu7SnjLVnEzaEfpATpsZCPjuJEPi1ze 8dHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730912981; x=1731517781; 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=ogHmelDkF4hLqREbuGCWl3TrHsn0GQ8m1PlMpfOFTmcL4s6ZlCIKj+S6iIi7eP1x6O 7VoJ3Pp4oVz3Jipndcm7SLI75gvU+cPKs/T4nyvA8r59U5mwmVxCpHgo1HdpcTye4Mkx TGAB/2H8A1+DePqoaKZGiqu9f0UDCbMfmHhHNceZd2wrknfOBZKGxBJXIMSbOkjS0hme 2ubGHZwmieI3cx344blFWOUYPnEVilOZeE8T0YXcirpU9KticZtDH4TKjWiz31Aek1A+ /CegNyhKET2+luN5ekjQx1uvGqP8keygVKcqKVqAEmkHyevlhMQG6Pfgvihtdrag28rQ eCKA== X-Gm-Message-State: AOJu0Yw7j8JQM+tRr+U4BO4ds/LUyNOasZci+dDae7zNrRF5wmTeX/R9 P2gpK2RRYJzFi1Z3WJnw3ZjK20vK0CXvuVpm8oBuMXGKw2qTq9tzsJ64IFAFBrNw58r5Fa0JPvU CfzmDwOY3 X-Received: by 2002:a5d:59ab:0:b0:37d:43a8:dee0 with SMTP id ffacd0b85a97d-381e81cf361mr2871422f8f.17.1730912980679; Wed, 06 Nov 2024 09:09:40 -0800 (PST) Received: from linaro.. ([193.32.126.165]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-432aa6b2d13sm28918935e9.12.2024.11.06.09.09.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Nov 2024 09:09:40 -0800 (PST) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Pierrick Bouvier , Alexandre Iooss , =?utf-8?q?Alex_Benn=C3=A9e?= , Cleber Rosa , Mahmoud Mandour , John Snow , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v3 1/3] plugins: add missing export for qemu_plugin_num_vcpus Date: Wed, 6 Nov 2024 09:09:21 -0800 Message-Id: <20241106170923.2976750-2-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241106170923.2976750-1-pierrick.bouvier@linaro.org> References: <20241106170923.2976750-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42e; envelope-from=pierrick.bouvier@linaro.org; helo=mail-wr1-x42e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, 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 Wed Nov 6 17:09: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: 841068 Delivered-To: patch@linaro.org Received: by 2002:a5d:6307:0:b0:381:e71e:8f7b with SMTP id i7csp638915wru; Wed, 6 Nov 2024 09:10:50 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVdUcWb8M99v1w2zRXMuVJ5kOQK+YxY1thxbAyOs7BMLBL9/nxbrfwpqfAf97jh4cWsPy47bg==@linaro.org X-Google-Smtp-Source: AGHT+IEIJF1Yg+zf4S03b3E4Rp0Qm5uMarAi4VhmZu93w11mPhtfiqd7lsob3WEnC8AQm3qIs0kS X-Received: by 2002:a05:6902:c01:b0:e2e:4ea8:16e7 with SMTP id 3f1490d57ef6-e3087b666d3mr39344546276.24.1730913050046; Wed, 06 Nov 2024 09:10:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1730913050; cv=none; d=google.com; s=arc-20240605; b=HkwwUpRPe9yA+PWwCJEAWz7TOM7nnWyK2JyJF0ZNWvkAjoDKz5YHPQR2k/dNsKVR1i y0ZcrVdhUnwErcejuafRMuxPA8kB7mYkSGuoBFQVGYV6RL4Mb18bbsUyZ5uuBlo2UWZ2 U1xsPumOlaeZjTGklkShmjP1eIRftZbUbwI6s9Zcn2kQkbwY6DuXJi30ejd9/eoeXTcY pu7vu+GhSa32+le+2EubQxTDK6WlDfH4C6Rs/YLMjFL87lXlSUPc03wxVoMqHXKO9R2w yhn1kAQpWK/zzQA180UUAAGsB6p8kFnfH3Dv0mjyf3uyzBnvw8tj+SWq9zua2cjmGzWo WAow== 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=ZPA8Cc1mdZFWuTHCl3i+/VHbdFpR2xccyaZdsIZIIaM=; fh=kefGR/PxK0iBDZEnfpvvNpEVnVXz3lrrL9SbbVSg2B0=; b=EgRXVKElaaBSXyY6BDL6f3kLMSQq3r11cjaBOf+k8oGQLUwQRXIff8hcl8apo9rwOg 9fVFyw9Pcw2afUhO+lR2g7B1dqiXBjpXhm2RiVFlOgTx7Q0dE5TMtOe35fwqZxNzGcpb Kbi4iwy0squ1nVWljwaZC4J0imn2IOiCxp3izrMA28E2skZxUsfuHyjzr3lo0Tnph1bb Y7hfJXm2Vut4OQxp3B6diogdk+1wtWBXscYKXFzmxM/LCLaKeUCWyzl+rzM5LESVGh1O KLUbByW7fITTpMMtVO18Hu2HG3zAuzJoR/xNaQKtUpt3eEM/2sseZ+VtpE50YquBOkuR n9Cg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="WzFGC/bB"; 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 3f1490d57ef6-e3317c83a79si7659979276.33.2024.11.06.09.10.49 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 06 Nov 2024 09:10:50 -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="WzFGC/bB"; 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 1t8jXR-0004r5-8o; Wed, 06 Nov 2024 12:09:49 -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 1t8jXO-0004oF-J5 for qemu-devel@nongnu.org; Wed, 06 Nov 2024 12:09:46 -0500 Received: from mail-lf1-x12f.google.com ([2a00:1450:4864:20::12f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t8jXM-0004ZZ-Mn for qemu-devel@nongnu.org; Wed, 06 Nov 2024 12:09:46 -0500 Received: by mail-lf1-x12f.google.com with SMTP id 2adb3069b0e04-539f84907caso7687279e87.3 for ; Wed, 06 Nov 2024 09:09:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1730912983; x=1731517783; 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=ZPA8Cc1mdZFWuTHCl3i+/VHbdFpR2xccyaZdsIZIIaM=; b=WzFGC/bB5DdPciU2yk986DGoqqvUV7+/CFU1rgjRvcj1wmS/XQP2B4eVyK+00N16ti W5yQYADOQOtTMRWiXd7rc+uEmyyVyaZ2YCZYPOEfPJpqA0ZCvaPQSE4hO5FaS1LzPT58 GvnUoZ+REwSvflaxp5FxqgGpkzbEYSg3+eydkJylx6aH0b0uNldJEdtYVZxM5V6m+FZk 8g7RKu+hKYKEzeGpKNL0E9n25vRfjkTOJstwt4jhHvgCHmvQLM2FR3vmOigx9L3wzm9f OtPWH3sUXVwL9/zqHwYnwXeihAPviojvjH0CK8R+RtzIZi7xsLbmRxGZE4o5FNc/hU/E vKXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730912983; x=1731517783; 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=ZPA8Cc1mdZFWuTHCl3i+/VHbdFpR2xccyaZdsIZIIaM=; b=vyRc4Zx1C7CNQNcxqqc7WBfabIwAvMtk6w2EAu0saUJsY8BV5ailqGiP9z7qA6d1GV hIryKcoidFmC7qHX/EskkEiwwnJTya94xe62TdncYqWU8K7u+tMoN0/2v5xDRHsy+IkS fA6AFOvz9DEii56JncYDLIycwOQLlVknS1AEuKhFEfl+08kRQnMqaJiuOtrlnaen2kYN +6VlvBRSnCJLEHkNPT8p1zHO63uqxStfAsFBXyv+Xhha2BdouSUvpNlkigfu9hggCpR4 t2vkCo+/iypvuOE+2DCwEKvNerVu8uBm/XYy9Nc4iW4zqaj0ZDmuv5RBiPlSXneW4K8G hPRA== X-Gm-Message-State: AOJu0YxAEo3Ok2sfK5j5g0wWQmGUjFN+QP19U2vGC3nYcwoWLGceqYuC nv1iROXm5y7KUTXPszJ89LZDTL2KELrsiTMgm0zxXPUymkR8p2sjawVVAfZmVngk8Rhp0/OCJa+ B7gYtTfgo X-Received: by 2002:a05:6512:b82:b0:539:e4b5:10e5 with SMTP id 2adb3069b0e04-53b348ec004mr21536432e87.9.1730912982670; Wed, 06 Nov 2024 09:09:42 -0800 (PST) Received: from linaro.. ([193.32.126.165]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-432aa6b2d13sm28918935e9.12.2024.11.06.09.09.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Nov 2024 09:09:42 -0800 (PST) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Pierrick Bouvier , Alexandre Iooss , =?utf-8?q?Alex_Benn=C3=A9e?= , Cleber Rosa , Mahmoud Mandour , John Snow Subject: [PATCH v3 2/3] plugins: detect qemu plugin API symbols from header Date: Wed, 6 Nov 2024 09:09:22 -0800 Message-Id: <20241106170923.2976750-3-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241106170923.2976750-1-pierrick.bouvier@linaro.org> References: <20241106170923.2976750-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::12f; envelope-from=pierrick.bouvier@linaro.org; helo=mail-lf1-x12f.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 0844f5da196..022e9f0f57f 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -3746,6 +3746,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 51297582f93..d60be2a4d6d 100644 --- a/plugins/meson.build +++ b/plugins/meson.build @@ -2,11 +2,17 @@ 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@']) @@ -15,7 +21,7 @@ if not enable_modules # LLVM/lld does not support exporting specific symbols. However, it works # out of the box with dllexport/dllimport attribute we set in the code. 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 @@ -24,7 +30,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 Wed Nov 6 17:09:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 841067 Delivered-To: patch@linaro.org Received: by 2002:a5d:6307:0:b0:381:e71e:8f7b with SMTP id i7csp638410wru; Wed, 6 Nov 2024 09:10:01 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUgMhnAVJnLp6n+OLxLvn4cm1xjKOJfmX+GX/EcQq93usv4PdSQjXOdAyuT6Ev86G3XIM/8HA==@linaro.org X-Google-Smtp-Source: AGHT+IHTD3Hr4GlqO9pYVjcTg90b91e+AuwAAXOGFh8AnV5TT0nh4zXrDgbFD6JsB6XYMGQOOMiQ X-Received: by 2002:a05:6122:a02:b0:50c:eb10:9792 with SMTP id 71dfb90a1353d-513e3264589mr2441601e0c.4.1730912997532; Wed, 06 Nov 2024 09:09:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1730912997; cv=none; d=google.com; s=arc-20240605; b=AZxo9ufOElA85RhB9D1MgTGT1KxewN6h4FwwXZNuWKzWjXXCIX2ziIb9U93hJN7HGV d8ueD+2m4dCDE8yoYjvvGWIOrP4dRhZ/Nwqx809q1hjF401kPiKaPRbvha7z0oczEMSy XSbtABYrGiP78V9Ykw3mVkEByfhl00GHfxPXfTj6pVwsDtrNJfH2zzNlJ8+M1fX1GP6A VrwKYz7VRN5C25PiV9mEtwaoXUcrN9TE5wsUpSUK1UR8/0bPLR+Ps74scsD4RiY8cRk+ ho94kxFzbpdGc6ISIHLSC2r05zpmfTJI71OKpG6tE+voM1Fr+aMU2QFfpp9ObjCJHdrE MzWQ== 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=kefGR/PxK0iBDZEnfpvvNpEVnVXz3lrrL9SbbVSg2B0=; b=MZst6HSBrNl5EjZ83/qPPjxqsTInPy+wbMJKSWCkgQyyJxaaifzx0mtuK/crSa9tLV gQh1TnfRmqelTPUh8DSBRsG8DznfsB5lgz/p35q1vP/UsyHtfm48r6QnK3xVbOCARRK8 cdvyIKjDZcywDFqQBaSqjXI4UlmBdLqHC2qIeH+YXRBsd8HQflzD5Nd/in2fKY83VNPg Hh9SYZoeO6XyKg/Bbok+/s/kkQ0w0N03sKCihnwUXU03yXSVBWjnCHu3kP6vhJm6bVlH h/SE5gTVst16Y7ltnyzisGRUiEO4Jbgdn5CboM61714gC83HS2mE0RFCRjwjzA+37kQ6 FD3w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="S/N6um8A"; 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 71dfb90a1353d-5106f3968e9si3295124e0c.142.2024.11.06.09.09.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 06 Nov 2024 09:09:57 -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="S/N6um8A"; 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 1t8jXR-0004r4-4J; Wed, 06 Nov 2024 12:09:49 -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 1t8jXP-0004qL-VR for qemu-devel@nongnu.org; Wed, 06 Nov 2024 12:09:47 -0500 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t8jXO-0004a6-CI for qemu-devel@nongnu.org; Wed, 06 Nov 2024 12:09:47 -0500 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-43152b79d25so368215e9.1 for ; Wed, 06 Nov 2024 09:09:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1730912984; x=1731517784; 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=S/N6um8AiJUOZRiMLhkjWSxDuENORR3Ev7KGFGhSFDnNM2NakxvoB4/CAg6sMhyMj4 hX4eYx561IfoE7v5OMgl3r5TrOiG59al2VQACNT6bN29S5byHoDRb4ddecuRACjSdlqh /z3vOzLU0BpcRi+FSQ8dihejddRgHTjX44Qf6oVitBtX3znd90CRu/Oh3vHomZgU60G7 QhVF3pTli20UYzm7zivZXnJVFzbhSAFDqA0mFusFn+KXeum1JNr3d4967y5xHiPxDlXE ntb7WOaQOmTND+IyZ7aLhK5U1M6rQjh9MBdh3ym6FrJMk3GJI/OcPAE/I3HbdvZIDgSu rvIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730912985; x=1731517785; 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=Au8S27NMtWyiRg7pB2uhxOqVzPr8tX3nVpPujxM3QR/5ClojUojnfKRRZZWpv224VZ zAkx6HKgOkqGCXUOpjxgTjnUEbeBYW1EvWaBWFcpNI7c9z2bP5I65BXw2EBCNlRjc5vI RtyRJaazQYmrsljAGdkVrxSWnFee7rHdBiXI9UJDvusTROETrmBT6nFvrnfxg3SAnppP CWo7Bw29/ZhgeinJedqu0o9NY7eAwZoxtwJe4oZV/KqBNXI5Z7ZroIvLQtAjMsB/tdve K5agxsFNivTc+LJKwLn9J/ZH0TN2bfgxMpeklJF9E3GV73pVvNzVGJ5wpk9tDS/eUBH7 Ov3g== X-Gm-Message-State: AOJu0YxlsndCvchltq0YqZLYaUIuCWX4BkhBJzPGdQUFaTNTpBJzwK7z YwQZ+VbEtmM2NNpuT4+U5gMu93RI1cbEtc1p3dxjHVFEQjnngh2/XdDPrmp8/9nc3q/4wZtZ4r2 VRbPQUBpu X-Received: by 2002:a05:600c:3514:b0:431:5863:4240 with SMTP id 5b1f17b1804b1-4327b7ea586mr204699745e9.24.1730912984668; Wed, 06 Nov 2024 09:09:44 -0800 (PST) Received: from linaro.. ([193.32.126.165]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-432aa6b2d13sm28918935e9.12.2024.11.06.09.09.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Nov 2024 09:09:44 -0800 (PST) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Pierrick Bouvier , Alexandre Iooss , =?utf-8?q?Alex_Benn=C3=A9e?= , Cleber Rosa , Mahmoud Mandour , John Snow Subject: [PATCH v3 3/3] plugins: eradicate qemu-plugins.symbols static file Date: Wed, 6 Nov 2024 09:09:23 -0800 Message-Id: <20241106170923.2976750-4-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241106170923.2976750-1-pierrick.bouvier@linaro.org> References: <20241106170923.2976750-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=pierrick.bouvier@linaro.org; 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, 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; -};