From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 08546C001E0 for ; Wed, 16 Aug 2023 15:06:44 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qWI54-0006GZ-9w; Wed, 16 Aug 2023 11:05:06 -0400 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 1qWI4z-00065G-VO for qemu-devel@nongnu.org; Wed, 16 Aug 2023 11:05:03 -0400 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qWI4u-0004Or-Pj for qemu-devel@nongnu.org; Wed, 16 Aug 2023 11:05:00 -0400 Received: by mail-pl1-x62b.google.com with SMTP id d9443c01a7336-1bdeb022738so19487375ad.0 for ; Wed, 16 Aug 2023 08:04:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20221208.gappssmtp.com; s=20221208; t=1692198295; x=1692803095; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=spCUFVdjDT/l80JdlzLeqn0kF7ADg+0QZ3H7hNfAWdc=; b=nYSVqIQIMq0Bjo+CIrgdDde3EJPJuj/MJ9uTwbDZ6RyfEyxCU7M4X7UBFiGs9qcrMC VeoxXj9CK5JBYNjr8yerHF/vFCd7Ojr5q3tGrYvYLPmJmtxfk9krsjYHD7JYjJyADOid HxzTpMBO7TucX0pjBONox8wJqz2c7WGZotTTOqiup/9oIna6tF0JVMFHqj1S8H9TMWaC d+yBzLYyU88We5hYKlsegfpWmKQbi1wnv83N1wjNSGA4sxHfGS3PnnWEYxSriceQgWQu ddHFa9+TucrohYT71IsRI0v3nQyHm8SMePXDc+4muaZvX9FxaZjVKfCbozWAffO0z8+T VWFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692198295; x=1692803095; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=spCUFVdjDT/l80JdlzLeqn0kF7ADg+0QZ3H7hNfAWdc=; b=dWNNPIx/XbzzbNsnJA2Xv+z0QBXitgsfyyIWcfnDiv+wG8YrMBnqNtYv8yJ/1b/bfj mjix/eA/9lx51Oa0JvLf3ljGkWxv45WLBjLMfQS0DMCHj/VLgcPwlnDtXYFpV1iWj0gK itwWsgrbXK3gXx5wSEBUWLm49ycHvAHKYCzIhBUKnEjRchF2ejDmjPU4V6puaD/HXxhu j+HZCwHKJGzpz8wQc9NBnduEECPeE+mMqRGaycrMtqYkTviypqLWRJSByrAqOZovpB99 5Op1t6z2ZrSRMIrWWWbN9yRe8CwyVR6Flnuc5cUY8qIHmnOyCLNLfG97fzz1ZUigmkrN KLtQ== X-Gm-Message-State: AOJu0Yyxm4Gx6XkCULMLw0FYbKrjVBBUP8bU0F8ozR17bwbVkCkEvU4J moTLMq40/Etv3t+N0MdUOKpZYA== X-Google-Smtp-Source: AGHT+IGqXgAIw6g805RTzCsYUKME2etnxfetoohdotLB6/EfbqsYWmEFcmJOdy2UTTkeqcKF6VxSbg== X-Received: by 2002:a17:90a:648e:b0:268:3ca4:6152 with SMTP id h14-20020a17090a648e00b002683ca46152mr3023992pjj.15.1692198295212; Wed, 16 Aug 2023 08:04:55 -0700 (PDT) Received: from ?IPV6:2400:4050:a840:1e00:78d2:b862:10a7:d486? ([2400:4050:a840:1e00:78d2:b862:10a7:d486]) by smtp.gmail.com with ESMTPSA id b22-20020a17090a8c9600b0026d034f6badsm691307pjo.38.2023.08.16.08.04.46 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 16 Aug 2023 08:04:54 -0700 (PDT) Message-ID: <1e77c6b2-646d-42de-9ed5-df60a3c7d3b8@daynix.com> Date: Thu, 17 Aug 2023 00:04:44 +0900 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC PATCH 24/24] contrib/plugins: Add cc plugin Content-Language: en-US To: =?UTF-8?Q?Alex_Benn=C3=A9e?= Cc: Paolo Bonzini , Thomas Huth , Alexandre Iooss , Mahmoud Mandour , Eduardo Habkost , Marcel Apfelbaum , =?UTF-8?Q?Philippe_Mathieu-Daud=C3=A9?= , Yanan Wang , Richard Henderson , =?UTF-8?Q?Marc-Andr=C3=A9_Lureau?= , =?UTF-8?Q?Daniel_P=2E_Berrang=C3=A9?= , John Snow , Cleber Rosa , Peter Maydell , Michael Rolnik , "Edgar E. Iglesias" , Brian Cain , Song Gao , Xiaojuan Yang , Laurent Vivier , Aurelien Jarno , Jiaxun Yang , Aleksandar Rikalo , Chris Wulff , Marek Vasut , Stafford Horne , Daniel Henrique Barboza , =?UTF-8?Q?C=C3=A9dric_Le_Goater?= , David Gibson , Greg Kurz , Nicholas Piggin , Palmer Dabbelt , Alistair Francis , Bin Meng , Weiwei Li , Liu Zhiwei , Yoshinori Sato , David Hildenbrand , Ilya Leoshkevich , Mark Cave-Ayland , Artyom Tarasenko , Bastian Koppelmann , Max Filippov , qemu-devel@nongnu.org, qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-riscv@nongnu.org, qemu-s390x@nongnu.org References: <20230731084354.115015-1-akihiko.odaki@daynix.com> <20230731084354.115015-25-akihiko.odaki@daynix.com> <87pm3pprv8.fsf@linaro.org> From: Akihiko Odaki In-Reply-To: <87pm3pprv8.fsf@linaro.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Received-SPF: none client-ip=2607:f8b0:4864:20::62b; envelope-from=akihiko.odaki@daynix.com; helo=mail-pl1-x62b.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=unavailable 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org On 2023/08/15 0:23, Alex Bennée wrote: > > Akihiko Odaki writes: > >> This demonstrates how to write a plugin in C++. >> >> Signed-off-by: Akihiko Odaki >> --- >> docs/devel/tcg-plugins.rst | 8 ++++++++ >> configure | 15 ++++++++++++--- >> contrib/plugins/Makefile | 5 +++++ >> contrib/plugins/cc.cc | 15 +++++++++++++++ >> tests/tcg/Makefile.target | 3 +++ >> 5 files changed, 43 insertions(+), 3 deletions(-) >> create mode 100644 contrib/plugins/cc.cc >> >> diff --git a/docs/devel/tcg-plugins.rst b/docs/devel/tcg-plugins.rst >> index c9f8b27590..0a11f8036c 100644 >> --- a/docs/devel/tcg-plugins.rst >> +++ b/docs/devel/tcg-plugins.rst >> @@ -584,6 +584,14 @@ The plugin has a number of arguments, all of them are optional: >> configuration arguments implies ``l2=on``. >> (default: N = 2097152 (2MB), B = 64, A = 16) >> >> +- contrib/plugins/cc.cc >> + >> +cc plugin demonstrates how to write a plugin in C++. It simply outputs >> +"hello, world" to the plugin log:: >> + >> + $ qemu-system-arm $(QEMU_ARGS) \ >> + -plugin ./contrib/plugins/libcc.so -d plugin >> + > > I'm going to assume this is useful because you have some out of tree C++ > plugins? I'd drop the last two patches for now until there is a slightly > more compelling use case. The out-of-tree plugin is mentioned in the cover letter and available at: https://github.com/shioya-lab/sniper/tree/akihikodaki/bb/frontend/qemu-frontend This plugin emits a trace of execution for use in Sniper simulator. I believe it's useful for other people doing microarchitecture research since processor simulation infrastructure is often written in C++. > > The C++ compiler detection moved into meson in b485458e00 (configure, > meson: move C++ compiler detection to meson.build) so I don't think > there is currently a compelling reason to bring this back into > configure. > It is necessary because TCG tests use Makefile and config-host.mak is emitted by configure. We can remove C++ detection from configure when TCG tests or the config-host.mak generation migrate to Meson.