All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [Bug 1748612] [NEW] qemu-user option -strace -D <file> doesn't work
@ 2018-02-10 12:25 mou
  2018-02-12  9:49 ` [Qemu-devel] [Bug 1748612] " Peter Maydell
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: mou @ 2018-02-10 12:25 UTC (permalink / raw)
  To: qemu-devel

Public bug reported:

I have been trying to access qemu -strace output from a script
The main problem was it was on stderr, the strace output was merged with my program's stderr output.
Then I tried to use the -D option, to log the output to a file.
This didn't work even if the log file was created, but it was empty.

I have looked at the source code and found the print function was not
qemu_log with -strace but gemu_log (to be clear it was GEMU NOT QEMU)


I have then replaced all gemu_log by qemu_log removed declaration of gemu_log and recompiled, it seems to works just fine right now.

removed declaration here and here:
https://github.com/qemu/qemu/blob/master/linux-user/main.c#L108
https://github.com/qemu/qemu/blob/master/linux-user/qemu.h#L203

** Affects: qemu
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1748612

Title:
  qemu-user option -strace -D <file> doesn't work

Status in QEMU:
  New

Bug description:
  I have been trying to access qemu -strace output from a script
  The main problem was it was on stderr, the strace output was merged with my program's stderr output.
  Then I tried to use the -D option, to log the output to a file.
  This didn't work even if the log file was created, but it was empty.

  I have looked at the source code and found the print function was not
  qemu_log with -strace but gemu_log (to be clear it was GEMU NOT QEMU)

  
  I have then replaced all gemu_log by qemu_log removed declaration of gemu_log and recompiled, it seems to works just fine right now.

  removed declaration here and here:
  https://github.com/qemu/qemu/blob/master/linux-user/main.c#L108
  https://github.com/qemu/qemu/blob/master/linux-user/qemu.h#L203

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1748612/+subscriptions

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Qemu-devel] [Bug 1748612] Re: qemu-user option -strace -D <file> doesn't work
  2018-02-10 12:25 [Qemu-devel] [Bug 1748612] [NEW] qemu-user option -strace -D <file> doesn't work mou
@ 2018-02-12  9:49 ` Peter Maydell
  2018-02-12 10:04 ` mou
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Peter Maydell @ 2018-02-12  9:49 UTC (permalink / raw)
  To: qemu-devel

This is intentional, more or less. The -D logfile is for the debug logs
enabled with -d, not for strace. I think if we wanted to support
redirecting strace output to a file we might need to have an extra
argument, to avoid breaking existing users.

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1748612

Title:
  qemu-user option -strace -D <file> doesn't work

Status in QEMU:
  New

Bug description:
  I have been trying to access qemu -strace output from a script
  The main problem was it was on stderr, the strace output was merged with my program's stderr output.
  Then I tried to use the -D option, to log the output to a file.
  This didn't work even if the log file was created, but it was empty.

  I have looked at the source code and found the print function was not
  qemu_log with -strace but gemu_log (to be clear it was GEMU NOT QEMU)

  
  I have then replaced all gemu_log by qemu_log removed declaration of gemu_log and recompiled, it seems to works just fine right now.

  removed declaration here and here:
  https://github.com/qemu/qemu/blob/master/linux-user/main.c#L108
  https://github.com/qemu/qemu/blob/master/linux-user/qemu.h#L203

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1748612/+subscriptions

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Qemu-devel] [Bug 1748612] Re: qemu-user option -strace -D <file> doesn't work
  2018-02-10 12:25 [Qemu-devel] [Bug 1748612] [NEW] qemu-user option -strace -D <file> doesn't work mou
  2018-02-12  9:49 ` [Qemu-devel] [Bug 1748612] " Peter Maydell
@ 2018-02-12 10:04 ` mou
  2018-02-12 10:38 ` Peter Maydell
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: mou @ 2018-02-12 10:04 UTC (permalink / raw)
  To: qemu-devel

If this is not for strace, then why when I launch qemu as subprocess (example: from a python script)
with option -strace -D <file> it creates a log file called <file>-strace? Seems like a bug to me.
Anyway, I understand you don't want to break the current behavior, is there any chance this gets added in the near future?

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1748612

Title:
  qemu-user option -strace -D <file> doesn't work

Status in QEMU:
  New

Bug description:
  I have been trying to access qemu -strace output from a script
  The main problem was it was on stderr, the strace output was merged with my program's stderr output.
  Then I tried to use the -D option, to log the output to a file.
  This didn't work even if the log file was created, but it was empty.

  I have looked at the source code and found the print function was not
  qemu_log with -strace but gemu_log (to be clear it was GEMU NOT QEMU)

  
  I have then replaced all gemu_log by qemu_log removed declaration of gemu_log and recompiled, it seems to works just fine right now.

  removed declaration here and here:
  https://github.com/qemu/qemu/blob/master/linux-user/main.c#L108
  https://github.com/qemu/qemu/blob/master/linux-user/qemu.h#L203

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1748612/+subscriptions

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Qemu-devel] [Bug 1748612] Re: qemu-user option -strace -D <file> doesn't work
  2018-02-10 12:25 [Qemu-devel] [Bug 1748612] [NEW] qemu-user option -strace -D <file> doesn't work mou
  2018-02-12  9:49 ` [Qemu-devel] [Bug 1748612] " Peter Maydell
  2018-02-12 10:04 ` mou
@ 2018-02-12 10:38 ` Peter Maydell
  2018-02-12 10:48 ` mou
  2020-11-23  9:56 ` Thomas Huth
  4 siblings, 0 replies; 6+ messages in thread
From: Peter Maydell @ 2018-02-12 10:38 UTC (permalink / raw)
  To: qemu-devel

If you use -D <file> it will create a file named <file>, which will
contain any logs created via the qemu_log subsystem (which might be
nothing at all, depending on what the guest does). I don't know where
the "-strace" part would come from unless you specified it as part of
the filename.

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1748612

Title:
  qemu-user option -strace -D <file> doesn't work

Status in QEMU:
  New

Bug description:
  I have been trying to access qemu -strace output from a script
  The main problem was it was on stderr, the strace output was merged with my program's stderr output.
  Then I tried to use the -D option, to log the output to a file.
  This didn't work even if the log file was created, but it was empty.

  I have looked at the source code and found the print function was not
  qemu_log with -strace but gemu_log (to be clear it was GEMU NOT QEMU)

  
  I have then replaced all gemu_log by qemu_log removed declaration of gemu_log and recompiled, it seems to works just fine right now.

  removed declaration here and here:
  https://github.com/qemu/qemu/blob/master/linux-user/main.c#L108
  https://github.com/qemu/qemu/blob/master/linux-user/qemu.h#L203

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1748612/+subscriptions

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Qemu-devel] [Bug 1748612] Re: qemu-user option -strace -D <file> doesn't work
  2018-02-10 12:25 [Qemu-devel] [Bug 1748612] [NEW] qemu-user option -strace -D <file> doesn't work mou
                   ` (2 preceding siblings ...)
  2018-02-12 10:38 ` Peter Maydell
@ 2018-02-12 10:48 ` mou
  2020-11-23  9:56 ` Thomas Huth
  4 siblings, 0 replies; 6+ messages in thread
From: mou @ 2018-02-12 10:48 UTC (permalink / raw)
  To: qemu-devel

I will check that again, pretty sure I saw that.
Anyway any chance there is an option/fix for that?
Today it is impossible to differentiate strace output with program's stderr output, and it is causing trouble while used in scripts.

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1748612

Title:
  qemu-user option -strace -D <file> doesn't work

Status in QEMU:
  New

Bug description:
  I have been trying to access qemu -strace output from a script
  The main problem was it was on stderr, the strace output was merged with my program's stderr output.
  Then I tried to use the -D option, to log the output to a file.
  This didn't work even if the log file was created, but it was empty.

  I have looked at the source code and found the print function was not
  qemu_log with -strace but gemu_log (to be clear it was GEMU NOT QEMU)

  
  I have then replaced all gemu_log by qemu_log removed declaration of gemu_log and recompiled, it seems to works just fine right now.

  removed declaration here and here:
  https://github.com/qemu/qemu/blob/master/linux-user/main.c#L108
  https://github.com/qemu/qemu/blob/master/linux-user/qemu.h#L203

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1748612/+subscriptions

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug 1748612] Re: qemu-user option -strace -D <file> doesn't work
  2018-02-10 12:25 [Qemu-devel] [Bug 1748612] [NEW] qemu-user option -strace -D <file> doesn't work mou
                   ` (3 preceding siblings ...)
  2018-02-12 10:48 ` mou
@ 2020-11-23  9:56 ` Thomas Huth
  4 siblings, 0 replies; 6+ messages in thread
From: Thomas Huth @ 2020-11-23  9:56 UTC (permalink / raw)
  To: qemu-devel

I think this has been fixed here:
https://git.qemu.org/?p=qemu.git;a=commitdiff;h=4b25a50674de41e72f6b3003

** Changed in: qemu
       Status: New => Fix Released

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1748612

Title:
  qemu-user option -strace -D <file> doesn't work

Status in QEMU:
  Fix Released

Bug description:
  I have been trying to access qemu -strace output from a script
  The main problem was it was on stderr, the strace output was merged with my program's stderr output.
  Then I tried to use the -D option, to log the output to a file.
  This didn't work even if the log file was created, but it was empty.

  I have looked at the source code and found the print function was not
  qemu_log with -strace but gemu_log (to be clear it was GEMU NOT QEMU)

  
  I have then replaced all gemu_log by qemu_log removed declaration of gemu_log and recompiled, it seems to works just fine right now.

  removed declaration here and here:
  https://github.com/qemu/qemu/blob/master/linux-user/main.c#L108
  https://github.com/qemu/qemu/blob/master/linux-user/qemu.h#L203

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1748612/+subscriptions


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-11-23 10:12 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-10 12:25 [Qemu-devel] [Bug 1748612] [NEW] qemu-user option -strace -D <file> doesn't work mou
2018-02-12  9:49 ` [Qemu-devel] [Bug 1748612] " Peter Maydell
2018-02-12 10:04 ` mou
2018-02-12 10:38 ` Peter Maydell
2018-02-12 10:48 ` mou
2020-11-23  9:56 ` Thomas Huth

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.