kdevops.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Luis Chamberlain <mcgrof@kernel.org>
To: fan.ni@gmx.us, kdevops@lists.linux.dev
Cc: nmtadam.samsung@gmail.com, fan.ni@samsung.com
Subject: Re: [kdevops PATCH] qemu-build: Add a configuration option for enabling qemu debug
Date: Thu, 24 Aug 2023 14:29:04 -0700	[thread overview]
Message-ID: <ZOfLoAZzJAfYjwLN@bombadil.infradead.org> (raw)
In-Reply-To: <20230824210805.2232980-1-fan.ni@gmx.us>

On Thu, Aug 24, 2023 at 02:08:05PM -0700, fan.ni@gmx.us wrote:
> From: Fan Ni <fan.ni@gmx.us>
> 
> Currently, qemu will always be compiled without enabling debug, however,
> enabling qemu debug is important for debug purpose. A new Kconfig
> option is added to allow user to enable debug when configuring qemu. By
> default, it is disabled.
> 
> Signed-off-by: Fan Ni <fan.ni@samsung.com>
> ---

Thanks Fan, I've Cc'd kdevops@lists.linux.dev. Please use that
mailing list for future patches. My review 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 += qemu_target="ppc64-softmmu"
>  endif
> 
> +ifeq (y,$(CONFIG_QEMU_WITH_DEBUG_ENABLED))
> +QEMU_BUILD_SETUP_ARGS += qemu_debug="--enable-debug"
> +endif

This is a build debug thing.

> +
>  qemu: $(KDEVOPS_EXTRA_VARS)
>  	@$(Q)ansible-playbook $(ANSIBLE_VERBOSE) --connection=local \
>  		--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

> diff --git a/playbooks/roles/build_qemu/tasks/main.yml b/playbooks/roles/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={{ qemu_target }} --disable-download"
> +  command: "./configure --target-list={{ qemu_target }} --disable-download {{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

> +	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

       reply	other threads:[~2023-08-24 21:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20230824210805.2232980-1-fan.ni@gmx.us>
2023-08-24 21:29 ` Luis Chamberlain [this message]
2023-08-24 21:37   ` [kdevops PATCH] qemu-build: Add a configuration option for enabling qemu debug Fan Ni

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZOfLoAZzJAfYjwLN@bombadil.infradead.org \
    --to=mcgrof@kernel.org \
    --cc=fan.ni@gmx.us \
    --cc=fan.ni@samsung.com \
    --cc=kdevops@lists.linux.dev \
    --cc=nmtadam.samsung@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).