From: Sam Lantinga <slouken@libsdl.org>
To: "Marc-André Lureau" <marcandre.lureau@redhat.com>
Cc: "Philippe Mathieu-Daudé" <philmd@linaro.org>,
qemu-devel@nongnu.org, "Paolo Bonzini" <pbonzini@redhat.com>,
"Thomas Huth" <thuth@redhat.com>,
"Gerd Hoffmann" <kraxel@redhat.com>,
"Daniel P. Berrangé" <berrange@redhat.com>,
"Laurent Vivier" <lvivier@redhat.com>
Subject: Re: [PATCH v2 14/18] ui/sdl: add optional logging when _SDL_DEBUG is set
Date: Thu, 9 Mar 2023 22:10:29 -0800 [thread overview]
Message-ID: <CACC3sbEEc2NhL=vuimH0o2_n0YEBh2Pgb3ii0bRnki_iY2pWdw@mail.gmail.com> (raw)
In-Reply-To: <CAMxuvawJ7WJxH1vnLLswmPdQw7wcYAxhjHjUn5ved1NOMGxQgw@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2508 bytes --]
If you wanted, you could use the SDL hint system, e.g.
if (SDL_GetHintBoolean("QEMU_ENABLE_SDL_LOGGING", SDL_FALSE)) {
SDL_LogSetAllPriority(SDL_LOG_PRIORITY_VERBOSE);
}
Then someone can set that environment variable and it would be using the
SDL mechanisms rather than intruding on QEMU... or, if you want tighter
integration, you can set an SDL log handler that feeds into the QEMU
tracing system.
On Thu, Mar 9, 2023 at 9:18 PM Marc-André Lureau <
marcandre.lureau@redhat.com> wrote:
> Hi
>
> (adding Sam Lantinga, SDL maintainer, in CC. I noticed he worked on QEMU
> SDL backend yesterday! ;)
>
> On Thu, Mar 9, 2023 at 8:40 PM Philippe Mathieu-Daudé <philmd@linaro.org>
> wrote:
>
>> On 7/3/23 12:56, marcandre.lureau@redhat.com wrote:
>> > From: Marc-André Lureau <marcandre.lureau@redhat.com>
>> >
>> > Apparently, there is no environment variable you can set for libsdl to
>> > enable logging.
>>
>> Why not use getenv() in QEMU then?
>>
>
> QEMU has few environment variables. We generally prefer qmp/cmd arguments.
> And that change does not fit with QEMU tracing etc.
>
>
>
>> > (similar to _VNC_DEBUG)
>> >
>> > Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
>> > ---
>> > include/ui/sdl2.h | 2 ++
>> > ui/sdl2.c | 4 ++++
>> > 2 files changed, 6 insertions(+)
>> >
>> > diff --git a/include/ui/sdl2.h b/include/ui/sdl2.h
>> > index 8fb7e08262..6fea36db82 100644
>> > --- a/include/ui/sdl2.h
>> > +++ b/include/ui/sdl2.h
>> > @@ -6,6 +6,8 @@
>> >
>> > #include <SDL.h>
>> >
>> > +/* #define _SDL_DEBUG 1 */
>> > +
>> > /* with Alpine / muslc SDL headers pull in directfb headers
>> > * which in turn trigger warning about redundant decls for
>> > * direct_waitqueue_deinit.
>> > diff --git a/ui/sdl2.c b/ui/sdl2.c
>> > index f259e4c4d1..592eca3e1c 100644
>> > --- a/ui/sdl2.c
>> > +++ b/ui/sdl2.c
>> > @@ -841,6 +841,10 @@ static void sdl2_display_init(DisplayState *ds,
>> DisplayOptions *o)
>> > }
>> > #endif
>> >
>> > +#ifdef _SDL_DEBUG
>> > + SDL_LogSetAllPriority(SDL_LOG_PRIORITY_VERBOSE);
>> > +#endif
>>
>
> Sam, do you suggest a better way to enable SDL debugging when starting
> QEMU? Is there a way to enable it with existing SDL environment variables?
>
> thanks
>
> > +
>> > if (SDL_Init(SDL_INIT_VIDEO)) {
>> > fprintf(stderr, "Could not initialize SDL(%s) - exiting\n",
>> > SDL_GetError());
>>
>>
[-- Attachment #2: Type: text/html, Size: 3991 bytes --]
next prev parent reply other threads:[~2023-03-10 14:16 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-07 11:56 [PATCH v2 00/18] ui: dbus & misc fixes marcandre.lureau
2023-03-07 11:56 ` [PATCH v2 01/18] ui/dbus: initialize cursor_fb marcandre.lureau
2023-03-09 16:30 ` Philippe Mathieu-Daudé
2023-03-07 11:56 ` [PATCH v2 02/18] ui/dbus: unregister clipboard on connection close marcandre.lureau
2023-03-10 9:45 ` Daniel P. Berrangé
2023-03-07 11:56 ` [PATCH v2 03/18] audio/dbus: there are no sender for p2p mode marcandre.lureau
2023-03-10 9:47 ` Daniel P. Berrangé
2023-03-07 11:56 ` [PATCH v2 04/18] ui/dbus: set mouse is-absolute during console creation marcandre.lureau
2023-03-09 16:32 ` Philippe Mathieu-Daudé
2023-03-07 11:56 ` [PATCH v2 05/18] meson: ensure dbus-display generated code is built before other units marcandre.lureau
2023-03-10 9:49 ` Daniel P. Berrangé
2023-03-07 11:56 ` [PATCH v2 06/18] ui: rename cursor_{put->unref} marcandre.lureau
2023-03-10 9:51 ` Daniel P. Berrangé
2023-03-07 11:56 ` [PATCH v2 07/18] ui: rename cursor_{get->ref}, return it marcandre.lureau
2023-03-10 9:52 ` Daniel P. Berrangé
2023-03-07 11:56 ` [PATCH v2 08/18] ui: keep current cursor with QemuConsole marcandre.lureau
2023-03-10 9:54 ` Daniel P. Berrangé
2023-03-07 11:56 ` [PATCH v2 09/18] ui: set cursor upon listener registration marcandre.lureau
2023-03-10 9:57 ` Daniel P. Berrangé
2023-03-07 11:56 ` [PATCH v2 10/18] ui: set cursor position " marcandre.lureau
2023-03-10 9:58 ` Daniel P. Berrangé
2023-03-07 11:56 ` [PATCH v2 11/18] ui/sdl: get the GL context from the window marcandre.lureau
2023-03-10 10:00 ` Daniel P. Berrangé
2023-03-07 11:56 ` [PATCH v2 12/18] ui/shader: fix #version directive must occur on first line marcandre.lureau
2023-03-10 10:00 ` Daniel P. Berrangé
2023-03-07 11:56 ` [PATCH v2 13/18] ui/egl: print EGL error, helping debugging marcandre.lureau
2023-03-09 16:38 ` Philippe Mathieu-Daudé
2023-03-07 11:56 ` [PATCH v2 14/18] ui/sdl: add optional logging when _SDL_DEBUG is set marcandre.lureau
2023-03-09 16:39 ` Philippe Mathieu-Daudé
2023-03-10 5:17 ` Marc-André Lureau
2023-03-10 6:10 ` Sam Lantinga [this message]
2023-03-07 11:56 ` [PATCH v2 15/18] ui/sdl: try to instantiate the matching opengl renderer marcandre.lureau
2023-03-10 10:02 ` Daniel P. Berrangé
2023-03-13 9:42 ` Marc-André Lureau
2023-03-07 11:56 ` [PATCH v2 16/18] ui: introduce egl_init() marcandre.lureau
2023-03-10 10:06 ` Daniel P. Berrangé
2023-03-13 9:59 ` Marc-André Lureau
2023-03-07 11:56 ` [PATCH v2 17/18] ui/dbus: do not require opengl & gbm marcandre.lureau
2023-03-07 13:32 ` Marc-André Lureau
2023-03-07 11:56 ` [PATCH v2 18/18] ui/dbus: restrict opengl to gbm-enabled config marcandre.lureau
2023-03-09 15:51 ` [PATCH v2 00/18] ui: dbus & misc fixes Marc-André Lureau
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='CACC3sbEEc2NhL=vuimH0o2_n0YEBh2Pgb3ii0bRnki_iY2pWdw@mail.gmail.com' \
--to=slouken@libsdl.org \
--cc=berrange@redhat.com \
--cc=kraxel@redhat.com \
--cc=lvivier@redhat.com \
--cc=marcandre.lureau@redhat.com \
--cc=pbonzini@redhat.com \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=thuth@redhat.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 NNTP newsgroup(s).