From: Daniel Bristot de Oliveira <bristot@kernel.org>
To: linux-trace-devel@vger.kernel.org, Steven Rostedt <rostedt@goodmis.org>
Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
Juri Lelli <juri.lelli@redhat.com>,
William White <chwhite@redhat.com>,
Daniel Bristot de Oliveira <bristot@kernel.org>,
Masami Hiramatsu <mhiramat@kernel.org>,
Jonathan Corbet <corbet@lwn.net>
Subject: [PATCH 7/8] rtla: Start the tracers after creating all instances
Date: Thu, 11 May 2023 20:04:25 +0200 [thread overview]
Message-ID: <26d837baec9e9e261a1352fba6ffe9be8967ba25.1683827510.git.bristot@kernel.org> (raw)
In-Reply-To: <cover.1683827510.git.bristot@kernel.org>
Group all start tracing after finishing creating all instances.
The tracing instance starts first for the case of hitting a stop
tracing while enabling other instances. The trace instance is the
one with most valuable information.
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Daniel Bristot de Oliveira <bristot@kernel.org>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Daniel Bristot de Oliveira <bristot@kernel.org>
---
tools/tracing/rtla/src/osnoise_hist.c | 14 +++++++++++---
tools/tracing/rtla/src/osnoise_top.c | 13 ++++++++++---
tools/tracing/rtla/src/timerlat_hist.c | 17 ++++++++++++-----
tools/tracing/rtla/src/timerlat_top.c | 19 +++++++++++++------
4 files changed, 46 insertions(+), 17 deletions(-)
diff --git a/tools/tracing/rtla/src/osnoise_hist.c b/tools/tracing/rtla/src/osnoise_hist.c
index dfbcb5ca7ecb..8f81fa007364 100644
--- a/tools/tracing/rtla/src/osnoise_hist.c
+++ b/tools/tracing/rtla/src/osnoise_hist.c
@@ -870,8 +870,6 @@ int osnoise_hist_main(int argc, char *argv[])
}
}
- trace_instance_start(trace);
-
if (params->trace_output) {
record = osnoise_init_trace_tool("osnoise");
if (!record) {
@@ -885,9 +883,19 @@ int osnoise_hist_main(int argc, char *argv[])
goto out_hist;
}
- trace_instance_start(&record->trace);
}
+ /*
+ * Start the tracer here, after having set all instances.
+ *
+ * Let the trace instance start first for the case of hitting a stop
+ * tracing while enabling other instances. The trace instance is the
+ * one with most valuable information.
+ */
+ if (params->trace_output)
+ trace_instance_start(&record->trace);
+ trace_instance_start(trace);
+
tool->start_time = time(NULL);
osnoise_hist_set_signals(params);
diff --git a/tools/tracing/rtla/src/osnoise_top.c b/tools/tracing/rtla/src/osnoise_top.c
index 0833537bb2eb..85abba568faf 100644
--- a/tools/tracing/rtla/src/osnoise_top.c
+++ b/tools/tracing/rtla/src/osnoise_top.c
@@ -697,8 +697,6 @@ int osnoise_top_main(int argc, char **argv)
}
}
- trace_instance_start(trace);
-
if (params->trace_output) {
record = osnoise_init_trace_tool("osnoise");
if (!record) {
@@ -711,9 +709,18 @@ int osnoise_top_main(int argc, char **argv)
if (retval)
goto out_top;
}
+ }
+ /*
+ * Start the tracer here, after having set all instances.
+ *
+ * Let the trace instance start first for the case of hitting a stop
+ * tracing while enabling other instances. The trace instance is the
+ * one with most valuable information.
+ */
+ if (params->trace_output)
trace_instance_start(&record->trace);
- }
+ trace_instance_start(trace);
tool->start_time = time(NULL);
osnoise_top_set_signals(params);
diff --git a/tools/tracing/rtla/src/timerlat_hist.c b/tools/tracing/rtla/src/timerlat_hist.c
index e720c8908906..f431cf43246c 100644
--- a/tools/tracing/rtla/src/timerlat_hist.c
+++ b/tools/tracing/rtla/src/timerlat_hist.c
@@ -922,8 +922,6 @@ int timerlat_hist_main(int argc, char *argv[])
}
}
- trace_instance_start(trace);
-
if (params->trace_output) {
record = osnoise_init_trace_tool("timerlat");
if (!record) {
@@ -936,8 +934,6 @@ int timerlat_hist_main(int argc, char *argv[])
if (retval)
goto out_hist;
}
-
- trace_instance_start(&record->trace);
}
if (!params->no_aa) {
@@ -956,9 +952,20 @@ int timerlat_hist_main(int argc, char *argv[])
err_msg("Failed to enable timerlat tracer\n");
goto out_hist;
}
+ }
+ /*
+ * Start the tracers here, after having set all instances.
+ *
+ * Let the trace instance start first for the case of hitting a stop
+ * tracing while enabling other instances. The trace instance is the
+ * one with most valuable information.
+ */
+ if (params->trace_output)
+ trace_instance_start(&record->trace);
+ if (!params->no_aa)
trace_instance_start(&aa->trace);
- }
+ trace_instance_start(trace);
tool->start_time = time(NULL);
timerlat_hist_set_signals(params);
diff --git a/tools/tracing/rtla/src/timerlat_top.c b/tools/tracing/rtla/src/timerlat_top.c
index d6b5a382569e..02cff4948981 100644
--- a/tools/tracing/rtla/src/timerlat_top.c
+++ b/tools/tracing/rtla/src/timerlat_top.c
@@ -743,8 +743,6 @@ int timerlat_top_main(int argc, char *argv[])
}
}
- trace_instance_start(trace);
-
if (params->trace_output) {
record = osnoise_init_trace_tool("timerlat");
if (!record) {
@@ -757,8 +755,6 @@ int timerlat_top_main(int argc, char *argv[])
if (retval)
goto out_top;
}
-
- trace_instance_start(&record->trace);
}
if (!params->no_aa) {
@@ -785,11 +781,22 @@ int timerlat_top_main(int argc, char *argv[])
err_msg("Failed to enable timerlat tracer\n");
goto out_top;
}
-
- trace_instance_start(&aa->trace);
}
}
+ /*
+ * Start the tracers here, after having set all instances.
+ *
+ * Let the trace instance start first for the case of hitting a stop
+ * tracing while enabling other instances. The trace instance is the
+ * one with most valuable information.
+ */
+ if (params->trace_output)
+ trace_instance_start(&record->trace);
+ if (!params->no_aa && aa != top)
+ trace_instance_start(&aa->trace);
+ trace_instance_start(trace);
+
top->start_time = time(NULL);
timerlat_top_set_signals(params);
--
2.38.1
next prev parent reply other threads:[~2023-05-11 18:06 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-11 18:04 [PATCH 0/8] rtla improvements Daniel Bristot de Oliveira
2023-05-11 18:04 ` [PATCH 1/8] rtla: Add -C cgroup support Daniel Bristot de Oliveira
2023-05-11 18:04 ` [PATCH 2/8] rtla: Add --house-keeping option Daniel Bristot de Oliveira
2023-05-11 18:04 ` [PATCH 3/8] rtla: Change monitored_cpus from char * to cpu_set_t Daniel Bristot de Oliveira
2023-05-11 18:04 ` [PATCH 4/8] rtla: Automatically move rtla to a house-keeping cpu Daniel Bristot de Oliveira
2023-05-11 18:04 ` [PATCH 5/8] rtla/timerlat: Give timerlat auto-analysis its own instance Daniel Bristot de Oliveira
2023-05-11 18:04 ` [PATCH 6/8] rtla/timerlat_hist: Add auto-analysis support Daniel Bristot de Oliveira
2023-05-11 18:04 ` Daniel Bristot de Oliveira [this message]
2023-05-11 18:04 ` [PATCH 8/8] rtla/hwnoise: Reduce runtime to 75% Daniel Bristot de Oliveira
2023-05-11 18:04 ` 0001-rtla-Add-C-cgroup-support.patch Daniel Bristot de Oliveira
2023-05-11 18:08 ` 0001-rtla-Add-C-cgroup-support.patch Daniel Bristot de Oliveira
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=26d837baec9e9e261a1352fba6ffe9be8967ba25.1683827510.git.bristot@kernel.org \
--to=bristot@kernel.org \
--cc=chwhite@redhat.com \
--cc=corbet@lwn.net \
--cc=juri.lelli@redhat.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-trace-devel@vger.kernel.org \
--cc=mhiramat@kernel.org \
--cc=rostedt@goodmis.org \
/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
all inboxes | Powered by JetHome®