qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PULL v2 0/2] Tracing patches
@ 2020-10-26 16:02 Stefan Hajnoczi
  2020-10-26 16:02 ` [PULL v2 1/2] trace/simple: Enable tracing on startup only if the user specifies a trace option Stefan Hajnoczi
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Stefan Hajnoczi @ 2020-10-26 16:02 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Stefan Hajnoczi

The following changes since commit 4c5b97bfd0dd54dc27717ae8d1cd10e14eef1430:

  Merge remote-tracking branch 'remotes/kraxel/tags/modules-20201022-pull-request' into staging (2020-10-22 12:33:21 +0100)

are available in the Git repository at:

  https://gitlab.com/stefanha/qemu.git tags/tracing-pull-request

for you to fetch changes up to 1e8ebf1116a7023b4dd1919d31af8b4e17321da4:

  Add execute bit back to scripts/tracetool.py (2020-10-26 13:22:36 +0000)

----------------------------------------------------------------
Pull request

----------------------------------------------------------------

Anthony PERARD via (1):
  Add execute bit back to scripts/tracetool.py

Josh DuBois (1):
  trace/simple: Enable tracing on startup only if the user specifies a
    trace option

 trace/control.c      | 6 +++++-
 scripts/tracetool.py | 0
 2 files changed, 5 insertions(+), 1 deletion(-)
 mode change 100644 => 100755 scripts/tracetool.py

-- 
2.26.2


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

* [PULL v2 1/2] trace/simple: Enable tracing on startup only if the user specifies a trace option
  2020-10-26 16:02 [PULL v2 0/2] Tracing patches Stefan Hajnoczi
@ 2020-10-26 16:02 ` Stefan Hajnoczi
  2020-10-26 16:02 ` [PULL v2 2/2] Add execute bit back to scripts/tracetool.py Stefan Hajnoczi
  2020-10-26 16:59 ` [PULL v2 0/2] Tracing patches Philippe Mathieu-Daudé
  2 siblings, 0 replies; 5+ messages in thread
From: Stefan Hajnoczi @ 2020-10-26 16:02 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Josh DuBois, Stefan Hajnoczi

From: Josh DuBois <josh@joshdubois.com>

Tracing can be enabled at the command line or via the
monitor. Command-line trace options are recorded during
trace_opt_parse(), but tracing is not enabled until the various
front-ends later call trace_init_file(). If the user passes a trace
option on the command-line, remember that and enable tracing during
trace_init_file().  Otherwise, trace_init_file() should record the
trace file specified by the frontend and avoid enabling traces
until the user requests them via the monitor.

This fixes 1b7157be3a8c4300fc8044d40f4b2e64a152a1b4 and also
db25d56c014aa1a96319c663e0a60346a223b31e, by allowing the user
to enable traces on the command line and also avoiding
unwanted trace-<pid> files when the user has not asked for them.

Fixes: 1b7157be3a8c4300fc8044d40f4b2e64a152a1b4
Signed-off-by: Josh DuBois <josh@joshdubois.com>
Message-id: 20200816174610.20253-1-josh@joshdubois.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 trace/control.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/trace/control.c b/trace/control.c
index b35e512dce..5669db7eea 100644
--- a/trace/control.c
+++ b/trace/control.c
@@ -39,6 +39,7 @@ static TraceEventGroup *event_groups;
 static size_t nevent_groups;
 static uint32_t next_id;
 static uint32_t next_vcpu_id;
+static bool init_trace_on_startup;
 
 QemuOptsList qemu_trace_opts = {
     .name = "trace",
@@ -225,7 +226,9 @@ void trace_init_file(const char *file)
 {
 #ifdef CONFIG_TRACE_SIMPLE
     st_set_trace_file(file);
-    st_set_trace_file_enabled(true);
+    if (init_trace_on_startup) {
+        st_set_trace_file_enabled(true);
+    }
 #elif defined CONFIG_TRACE_LOG
     /*
      * If both the simple and the log backends are enabled, "--trace file"
@@ -299,6 +302,7 @@ char *trace_opt_parse(const char *optarg)
     }
     trace_init_events(qemu_opt_get(opts, "events"));
     trace_file = g_strdup(qemu_opt_get(opts, "file"));
+    init_trace_on_startup = true;
     qemu_opts_del(opts);
 
     return trace_file;
-- 
2.26.2


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

* [PULL v2 2/2] Add execute bit back to scripts/tracetool.py
  2020-10-26 16:02 [PULL v2 0/2] Tracing patches Stefan Hajnoczi
  2020-10-26 16:02 ` [PULL v2 1/2] trace/simple: Enable tracing on startup only if the user specifies a trace option Stefan Hajnoczi
@ 2020-10-26 16:02 ` Stefan Hajnoczi
  2020-10-26 16:59 ` [PULL v2 0/2] Tracing patches Philippe Mathieu-Daudé
  2 siblings, 0 replies; 5+ messages in thread
From: Stefan Hajnoczi @ 2020-10-26 16:02 UTC (permalink / raw)
  To: qemu-devel
  Cc: Anthony PERARD, Peter Maydell, Philippe Mathieu-Daudé,
	Daniel P . Berrangé,
	Stefan Hajnoczi

From: Anthony PERARD via <qemu-devel@nongnu.org>

Commit a81df1b68b65 ("libqemuutil, qapi, trace: convert to meson")
removed it without explanation and it is useful to be able to run a
script without having to figure out which interpreter to use.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20200923103620.1980151-1-anthony.perard@citrix.com>
---
 scripts/tracetool.py | 0
 1 file changed, 0 insertions(+), 0 deletions(-)
 mode change 100644 => 100755 scripts/tracetool.py

diff --git a/scripts/tracetool.py b/scripts/tracetool.py
old mode 100644
new mode 100755
-- 
2.26.2


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

* Re: [PULL v2 0/2] Tracing patches
  2020-10-26 16:02 [PULL v2 0/2] Tracing patches Stefan Hajnoczi
  2020-10-26 16:02 ` [PULL v2 1/2] trace/simple: Enable tracing on startup only if the user specifies a trace option Stefan Hajnoczi
  2020-10-26 16:02 ` [PULL v2 2/2] Add execute bit back to scripts/tracetool.py Stefan Hajnoczi
@ 2020-10-26 16:59 ` Philippe Mathieu-Daudé
  2020-10-26 17:06   ` Stefan Hajnoczi
  2 siblings, 1 reply; 5+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-10-26 16:59 UTC (permalink / raw)
  To: Stefan Hajnoczi, qemu-devel; +Cc: Peter Maydell

Hi Stefan,

On 10/26/20 5:02 PM, Stefan Hajnoczi wrote:
> The following changes since commit 4c5b97bfd0dd54dc27717ae8d1cd10e14eef1430:
> 
>    Merge remote-tracking branch 'remotes/kraxel/tags/modules-20201022-pull-request' into staging (2020-10-22 12:33:21 +0100)
> 
> are available in the Git repository at:
> 
>    https://gitlab.com/stefanha/qemu.git tags/tracing-pull-request
> 
> for you to fetch changes up to 1e8ebf1116a7023b4dd1919d31af8b4e17321da4:
> 
>    Add execute bit back to scripts/tracetool.py (2020-10-26 13:22:36 +0000)
> 
> ----------------------------------------------------------------
> Pull request
> 
> ----------------------------------------------------------------
> 
> Anthony PERARD via (1):
>    Add execute bit back to scripts/tracetool.py

Author email is incorrect: Anthony PERARD via <qemu-devel@nongnu.org>

> 
> Josh DuBois (1):
>    trace/simple: Enable tracing on startup only if the user specifies a
>      trace option
> 
>   trace/control.c      | 6 +++++-
>   scripts/tracetool.py | 0
>   2 files changed, 5 insertions(+), 1 deletion(-)
>   mode change 100644 => 100755 scripts/tracetool.py
> 



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

* Re: [PULL v2 0/2] Tracing patches
  2020-10-26 16:59 ` [PULL v2 0/2] Tracing patches Philippe Mathieu-Daudé
@ 2020-10-26 17:06   ` Stefan Hajnoczi
  0 siblings, 0 replies; 5+ messages in thread
From: Stefan Hajnoczi @ 2020-10-26 17:06 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé; +Cc: Peter Maydell, qemu-devel, Stefan Hajnoczi

On Mon, Oct 26, 2020 at 5:03 PM Philippe Mathieu-Daudé
<philmd@redhat.com> wrote:
> On 10/26/20 5:02 PM, Stefan Hajnoczi wrote:
> > The following changes since commit 4c5b97bfd0dd54dc27717ae8d1cd10e14eef1430:
> >
> >    Merge remote-tracking branch 'remotes/kraxel/tags/modules-20201022-pull-request' into staging (2020-10-22 12:33:21 +0100)
> >
> > are available in the Git repository at:
> >
> >    https://gitlab.com/stefanha/qemu.git tags/tracing-pull-request
> >
> > for you to fetch changes up to 1e8ebf1116a7023b4dd1919d31af8b4e17321da4:
> >
> >    Add execute bit back to scripts/tracetool.py (2020-10-26 13:22:36 +0000)
> >
> > ----------------------------------------------------------------
> > Pull request
> >
> > ----------------------------------------------------------------
> >
> > Anthony PERARD via (1):
> >    Add execute bit back to scripts/tracetool.py
>
> Author email is incorrect: Anthony PERARD via <qemu-devel@nongnu.org>

Thank you, sending v2.

Stefan


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

end of thread, other threads:[~2020-10-26 17:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-26 16:02 [PULL v2 0/2] Tracing patches Stefan Hajnoczi
2020-10-26 16:02 ` [PULL v2 1/2] trace/simple: Enable tracing on startup only if the user specifies a trace option Stefan Hajnoczi
2020-10-26 16:02 ` [PULL v2 2/2] Add execute bit back to scripts/tracetool.py Stefan Hajnoczi
2020-10-26 16:59 ` [PULL v2 0/2] Tracing patches Philippe Mathieu-Daudé
2020-10-26 17:06   ` Stefan Hajnoczi

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).