From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mout.gmx.net (mout.gmx.net [212.227.15.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3556779EE for ; Thu, 24 Aug 2023 21:37:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.us; s=s31663417; t=1692913066; x=1693517866; i=fan.ni@gmx.us; bh=/6r7tjSEYLpnHaZHfoI/2fuRN9Gd910ZrHI8ZPjTlnc=; h=X-UI-Sender-Class:Date:From:To:Cc:Subject:References:In-Reply-To; b=oL7yV/q7Sk8W7qUPWFhD2aYjKz31f3U6QPPeEmQ+9CF6Nzd2DTS4hnNZ7jMSvAcc2IIq5qg P2bbBaf8OiQO4wGlcmX9Fq5H0ad4CqgOZFny1KRJhAk7ktqgQ3TkxT0TUURgJ9LDUefoPA0A3 m4M7DZSaorrxc8EG2MfAZ4p6Gb1sedAqRajH4BkmF0xnUI4W0BnA83Jc5XyyWfeRPstKurxjA D10l+ukMmLeNBQsuTxGg0F7Xpduj14dL3V8ag05PrxJC8Pok5AWCnmB9NCSLW5Rv7Qg+CNm/V H+YLVqkp+Fg4SmJUVfHB3NLaaeJDvH6AbLw2bmFu/xpK6jZyhw5g== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from debian ([99.13.228.231]) by mail.gmx.net (mrgmx004 [212.227.17.184]) with ESMTPSA (Nemesis) id 1Mw9Q6-1phBMs11z2-00s3d6; Thu, 24 Aug 2023 23:37:46 +0200 Date: Thu, 24 Aug 2023 14:37:37 -0700 From: Fan Ni To: Luis Chamberlain Cc: kdevops@lists.linux.dev, nmtadam.samsung@gmail.com, fan.ni@samsung.com Subject: Re: [kdevops PATCH] qemu-build: Add a configuration option for enabling qemu debug Message-ID: References: <20230824210805.2232980-1-fan.ni@gmx.us> Precedence: bulk X-Mailing-List: kdevops@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Provags-ID: V03:K1:8ye5sg/SRPXv0GG/C4//cQ3ypLrIQiblWk0HX1980Mh19wP7fpX gDT/WspJxkw9Y8O9Y72s6mT0dE5wWPNoyY7c+ngrUtUxZHF4HJw9BXkknYHrZemDRzC16uj w7tBqkIaUxx3OtWQs6lXoOPAa9HL1A/JpO/HqU1OhoIm/RrjYY+YtmjPdmMI5W9iDv7SGz5 w2XDqH468ZDOaMezRoa7g== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:SIewtbZsdYs=;lmZf7+JD68zxyd4B6fWdvWyCNEi 74Glf0Mkqkur1zt7oNq8hyBcJn7u5U7g0XISudM+jORep9jdhbarfJmQk2DW1IMjr92Vaaer/ 9dO7xOx1Eyo+7AF8vv/ceqpeAfVHt97HbVyvGPWd5fwY3ei2tkWV9Ps9sVOsAQcBfGTWkyYzC M2x/8qNIbJmd/fsNdsx5FC5hn0jUpCbARiTrs487cRjTFgk+thEmLEf8r/gNLx/AYL2R8IHDr QuE3g+/c6MRN6SnLFykqEgcf0HJfYDjLoLReNY60+B9l6gLZpiExqX917myPeuiNTaaC3e6o7 Dt/ByfQETVyPDw2k85X7AIXbSaSUNFzSkD2KF3krr92uYBcAWg0XIxt2kDqQpTfEdfyf9BC6j H512BkQo0O3HzNXaBfwyFqwTX0JJM4HgKwROeFmpFnOQtbnP6FjVG18cI81pc9s5Q1/6Ki3FB AeQmW3PYz4+TGdvNBTHogGNX6BdXqgbgz0wxvq7hJ0CTNRPnKw9NJwKJjqejIpkvhW5RAxEfM 3u8olAlHo3WGlknkfK6kUA+k3fZCxZOntWhM7gaw2GJLHpjOE5o1niHZOm9qQW+yKD2TGfapX 93k0+hiQskwvIISld5chsHSgaTQKG/m0C1Iql7EAESPg1x8v3DGL7JDOJx+lf5XOCoChEaxT/ 3GDeRBmTyvJtjcCdj2nx+TetVChG4aF0epYPGOTZ9mYkWSrJPBm1L7dPcJ9Z/RKIDV1tt9uZy dAtvfuE6OcZvbSoCesiL6PhzQFmEbJIewyuOboKjNmw682CyWwUpRnS1x8elX1vpOAEKj6bEJ DJ8b6Q1O0saz/sSfpH44JCRqhlV7MQiyCH6c7jqXx9e6sfpogdF/zrw2Nq2ylzRB8kU10S6ee UDL6Dj05o0SqacXwaz/HupcHsKrhHc2daoYEahAhM4pRIu1kZ36fXlSzVYEUsBFe6xULmMiQf BT/4hel/7nYcCgOGRROfhE5ISQc= Content-Transfer-Encoding: quoted-printable On Thu, Aug 24, 2023 at 02:29:04PM -0700, Luis Chamberlain wrote: > On Thu, Aug 24, 2023 at 02:08:05PM -0700, fan.ni@gmx.us wrote: > > From: Fan Ni > > > > Currently, qemu will always be compiled without enabling debug, howeve= r, > > enabling qemu debug is important for debug purpose. A new Kconfig > > option is added to allow user to enable debug when configuring qemu. B= y > > default, it is disabled. > > > > Signed-off-by: Fan Ni > > --- > > Thanks Fan, I've Cc'd kdevops@lists.linux.dev. Please use that > mailing list for future patches. My review below. > Thaks Luis for the review. See below. > > Makefile.build_qemu | 4 ++++ > > playbooks/roles/build_qemu/defaults/main.yml | 1 + > > playbooks/roles/build_qemu/tasks/main.yml | 2 +- > > vagrant/Kconfig | 7 +++++++ > > 4 files changed, 13 insertions(+), 1 deletion(-) > > > > diff --git a/Makefile.build_qemu b/Makefile.build_qemu > > index 7addd2f0..3f50f949 100644 > > --- a/Makefile.build_qemu > > +++ b/Makefile.build_qemu > > @@ -19,6 +19,10 @@ ifeq (y,$(CONFIG_TARGET_ARCH_PPC64LE)) > > QEMU_BUILD_SETUP_ARGS +=3D qemu_target=3D"ppc64-softmmu" > > endif > > > > +ifeq (y,$(CONFIG_QEMU_WITH_DEBUG_ENABLED)) > > +QEMU_BUILD_SETUP_ARGS +=3D qemu_debug=3D"--enable-debug" > > +endif > > This is a build debug thing. Will fix in the next version. > > > + > > qemu: $(KDEVOPS_EXTRA_VARS) > > @$(Q)ansible-playbook $(ANSIBLE_VERBOSE) --connection=3Dlocal \ > > --inventory localhost, \ > > diff --git a/playbooks/roles/build_qemu/defaults/main.yml b/playbooks/= roles/build_qemu/defaults/main.yml > > index 006d669c..c8e12759 100644 > > --- a/playbooks/roles/build_qemu/defaults/main.yml > > +++ b/playbooks/roles/build_qemu/defaults/main.yml > > @@ -12,3 +12,4 @@ qemu_git: "https://github.com/qemu/qemu.git" > > qemu_version: "v7.2.0-rc4" > > qemu_build_dir: "{{ qemu_data }}/build" > > qemu_target: "x86_64-softmmu" > > +qemu_debug: False > > this should be qemu_build_debug Will fix in the next version. > > > diff --git a/playbooks/roles/build_qemu/tasks/main.yml b/playbooks/rol= es/build_qemu/tasks/main.yml > > index 448714b2..a4b4bba9 100644 > > --- a/playbooks/roles/build_qemu/tasks/main.yml > > +++ b/playbooks/roles/build_qemu/tasks/main.yml > > @@ -74,7 +74,7 @@ > > - build_qemu_now|bool > > > > - name: Run configure for QEMU > > - command: "./configure --target-list=3D{{ qemu_target }} --disable-d= ownload" > > + command: "./configure --target-list=3D{{ qemu_target }} --disable-d= ownload {{qemu_debug}}" > > tags: [ 'qemu', 'configure' ] > > args: > > chdir: "{{ qemu_data }}" > > diff --git a/vagrant/Kconfig b/vagrant/Kconfig > > index 68b14a0b..68986295 100644 > > --- a/vagrant/Kconfig > > +++ b/vagrant/Kconfig > > @@ -266,6 +266,13 @@ endif # !QEMU_BUILD > > > > if QEMU_BUILD > > > > +config QEMU_WITH_DEBUG_ENABLED > > And so this should be QEMU_BUILD_WITH_DEBUG_ENABLED Will fix in the next version. > > > + bool "enable debug for qemu" > > + default n > > + help > > + Enable this will add "--enable-debug" option when configuring qemu= . This > > + is useful for debugging and testing qemu code. > > This should clarify when it's useful. Is it only a build thing? > > Are there options for runtime debug? Is that also useful to you? > Could those be added dynamically, so that perhaps one could enable them > on the fly ? If so check DYNAMIC_RUNTIME_VARS on > workflows/fstests/Makefile for an exmaple of how one can for example for > example add specific arguments at the end of a make target to extend > variables dynamically. Likewise we have the use of ANSIBLE_VERBOSE which > might help for run time things too. > > In so far as dynamic run time though, running qemu though is done > through vagrant and that just sets up and uses libvirt, but I suppose > the above might still be useful somehow if one perhaps wanted to somehow > extend debug dynamic parameters somewhere. > > Luis Yes, this is a build thing. Currently, qemu is built without debug, which means we cannot use gdb for debugging the qemu code. Once its compiled and installed, we cannot dynamically enable it. I just use the change to debug qemu and locate a bug in qemu. Fan