* [PATCH 0/4] cyclictest: improve running under trace-cmd
@ 2016-02-25 16:29 Luiz Capitulino
2016-02-25 16:29 ` [PATCH 1/4] cyclictest: tracing(): check for notrace Luiz Capitulino
` (4 more replies)
0 siblings, 5 replies; 10+ messages in thread
From: Luiz Capitulino @ 2016-02-25 16:29 UTC (permalink / raw)
To: linux-rt-users; +Cc: jkacur, williams
This is just a repost of my RFC posting with no changes.
I have tested it a bit more and I think it's good
for inclusion.
Original intro:
In short, this series allows you to run cyclictest under
trace-cmd and still get trace marks when the latency
specified with -b is execeded. More details in patch 4/4.
This series is RFC because I'm not completely sure this
is the right thing to do. I'm wondering if we shouldn't
ditch all tracing support from cyclictest...
Luiz Capitulino (4):
cyclictest: tracing(): check for notrace
cyclictest: move debugfs init code to its own function
cyclictest: move tracemark_fd handling to its own function
cyclictest: add --tracemark option
src/cyclictest/cyclictest.c | 62 ++++++++++++++++++++++++++++++++++-----------
1 file changed, 47 insertions(+), 15 deletions(-)
--
2.1.0
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 1/4] cyclictest: tracing(): check for notrace
2016-02-25 16:29 [PATCH 0/4] cyclictest: improve running under trace-cmd Luiz Capitulino
@ 2016-02-25 16:29 ` Luiz Capitulino
2016-02-25 16:29 ` [PATCH 2/4] cyclictest: move debugfs init code to its own function Luiz Capitulino
` (3 subsequent siblings)
4 siblings, 0 replies; 10+ messages in thread
From: Luiz Capitulino @ 2016-02-25 16:29 UTC (permalink / raw)
To: linux-rt-users; +Cc: jkacur, williams
If you pass -b and --notrace to cyclictest today, it will
write to tracing_on when -b latency is reached.
Fix this by making tracing() check notrace.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
---
src/cyclictest/cyclictest.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/cyclictest/cyclictest.c b/src/cyclictest/cyclictest.c
index 34053c5..54fc033 100644
--- a/src/cyclictest/cyclictest.c
+++ b/src/cyclictest/cyclictest.c
@@ -444,6 +444,9 @@ static void tracemark(char *fmt, ...)
void tracing(int on)
{
+ if (notrace)
+ return;
+
if (on) {
switch (kernelversion) {
case KV_26_LT18: gettimeofday(0,(struct timezone *)1); break;
@@ -1634,7 +1637,7 @@ static void sighand(int sig)
shutdown = 1;
if (refresh_on_max)
pthread_cond_signal(&refresh_on_max_cond);
- if (tracelimit && !notrace)
+ if (tracelimit)
tracing(0);
}
@@ -2164,7 +2167,7 @@ int main(int argc, char **argv)
}
out:
/* ensure that the tracer is stopped */
- if (tracelimit && !notrace)
+ if (tracelimit)
tracing(0);
--
2.1.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 2/4] cyclictest: move debugfs init code to its own function
2016-02-25 16:29 [PATCH 0/4] cyclictest: improve running under trace-cmd Luiz Capitulino
2016-02-25 16:29 ` [PATCH 1/4] cyclictest: tracing(): check for notrace Luiz Capitulino
@ 2016-02-25 16:29 ` Luiz Capitulino
2016-02-25 16:29 ` [PATCH 3/4] cyclictest: move tracemark_fd handling " Luiz Capitulino
` (2 subsequent siblings)
4 siblings, 0 replies; 10+ messages in thread
From: Luiz Capitulino @ 2016-02-25 16:29 UTC (permalink / raw)
To: linux-rt-users; +Cc: jkacur, williams
A function added by a future commit will want to call
this code too.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
---
src/cyclictest/cyclictest.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/src/cyclictest/cyclictest.c b/src/cyclictest/cyclictest.c
index 54fc033..f543c34 100644
--- a/src/cyclictest/cyclictest.c
+++ b/src/cyclictest/cyclictest.c
@@ -479,11 +479,8 @@ static int settracer(char *tracer)
return -1;
}
-static void setup_tracer(void)
+static void debugfs_prepare(void)
{
- if (!tracelimit || notrace)
- return;
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 3/4] cyclictest: move tracemark_fd handling to its own function
2016-02-25 16:29 [PATCH 0/4] cyclictest: improve running under trace-cmd Luiz Capitulino
2016-02-25 16:29 ` [PATCH 1/4] cyclictest: tracing(): check for notrace Luiz Capitulino
2016-02-25 16:29 ` [PATCH 2/4] cyclictest: move debugfs init code to its own function Luiz Capitulino
@ 2016-02-25 16:29 ` Luiz Capitulino
2016-02-25 16:29 ` [PATCH 4/4] cyclictest: add --tracemark option Luiz Capitulino
2016-03-16 21:23 ` [PATCH 0/4] cyclictest: improve running under trace-cmd Luiz Capitulino
4 siblings, 0 replies; 10+ messages in thread
From: Luiz Capitulino @ 2016-02-25 16:29 UTC (permalink / raw)
To: linux-rt-users; +Cc: jkacur, williams
A function added by the next commit will want to call
this code too.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
---
src/cyclictest/cyclictest.c | 22 ++++++++++++++--------
1 file changed, 14 insertions(+), 8 deletions(-)
diff --git a/src/cyclictest/cyclictest.c b/src/cyclictest/cyclictest.c
index f543c34..e35088b 100644
--- a/src/cyclictest/cyclictest.c
+++ b/src/cyclictest/cyclictest.c
@@ -497,6 +497,19 @@ static void debugfs_prepare(void)
fileprefix = procfileprefix;
}
+static void open_tracemark_fd(void)
+{
+ char path[MAX_PATH];
+
+ if (tracemark_fd >= 0)
+ return;
+
+ sprintf(path, "%s/%s", fileprefix, "trace_marker");
+ tracemark_fd = open(path, O_WRONLY);
+ if (tracemark_fd < 0)
+ warn("unable to open trace_marker file: %s\n", path);
+}
+
static void setup_tracer(void)
{
if (!tracelimit || notrace)
@@ -612,14 +625,7 @@ static void setup_tracer(void)
fatal("unable to open %s for tracing", path);
}
- /* open the tracemark file descriptor */
- if (tracemark_fd == -1) {
- char path[MAX_PATH];
- strcat(strcpy(path, fileprefix), "trace_marker");
- if ((tracemark_fd = open(path, O_WRONLY)) == -1)
- warn("unable to open trace_marker file: %s\n", path);
- }
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 4/4] cyclictest: add --tracemark option
2016-02-25 16:29 [PATCH 0/4] cyclictest: improve running under trace-cmd Luiz Capitulino
` (2 preceding siblings ...)
2016-02-25 16:29 ` [PATCH 3/4] cyclictest: move tracemark_fd handling " Luiz Capitulino
@ 2016-02-25 16:29 ` Luiz Capitulino
2016-03-16 21:23 ` [PATCH 0/4] cyclictest: improve running under trace-cmd Luiz Capitulino
4 siblings, 0 replies; 10+ messages in thread
From: Luiz Capitulino @ 2016-02-25 16:29 UTC (permalink / raw)
To: linux-rt-users; +Cc: jkacur, williams
cyclictest will only write to /sys/kernel/debug/tracing/trace_maker
if it's also setup to do tracing. This conflicts with
running cyclictest under trace-cmd.
The --tracemark option tells cyclictest to write to the
trace_marker file even when it's not doing tracing.
It's can be used like this:
# trace-cmd record [...] cyclictest [...] -bX --tracemark --notrace
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
---
src/cyclictest/cyclictest.c | 20 +++++++++++++++++++-
1 file changed, 19 insertions(+), 1 deletion(-)
diff --git a/src/cyclictest/cyclictest.c b/src/cyclictest/cyclictest.c
index e35088b..5a261e2 100644
--- a/src/cyclictest/cyclictest.c
+++ b/src/cyclictest/cyclictest.c
@@ -167,6 +167,7 @@ struct thread_stat {
static int shutdown;
static int tracelimit = 0;
static int notrace = 0;
+static int trace_marker = 0;
static int ftrace = 0;
static int kernelversion;
static int verbose = 0;
@@ -510,6 +511,18 @@ static void open_tracemark_fd(void)
warn("unable to open trace_marker file: %s\n", path);
}
+static void enable_trace_mark(void)
+{
+ if (!trace_marker)
+ return;
+
+ if (!tracelimit)
+ fatal("--tracemark requires -b\n");
+
+ debugfs_prepare();
+ open_tracemark_fd();
+}
+
static void setup_tracer(void)
{
if (!tracelimit || notrace)
@@ -1234,7 +1247,7 @@ enum option_values {
OPT_QUIET, OPT_PRIOSPREAD, OPT_RELATIVE, OPT_RESOLUTION, OPT_SYSTEM,
OPT_SMP, OPT_THREADS, OPT_TRACER, OPT_UNBUFFERED, OPT_NUMA, OPT_VERBOSE,
OPT_WAKEUP, OPT_WAKEUPRT, OPT_DBGCYCLIC, OPT_POLICY, OPT_HELP, OPT_NUMOPTS,
- OPT_ALIGNED, OPT_LAPTOP, OPT_SECALIGNED,
+ OPT_ALIGNED, OPT_LAPTOP, OPT_SECALIGNED, OPT_TRACEMARK,
};
/* Process commandline options */
@@ -1285,6 +1298,7 @@ static void process_options (int argc, char *argv[], int max_cpus)
{"system", no_argument, NULL, OPT_SYSTEM },
{"smp", no_argument, NULL, OPT_SMP },
{"threads", optional_argument, NULL, OPT_THREADS },
+ {"tracemark", no_argument, NULL, OPT_TRACEMARK },
{"tracer", required_argument, NULL, OPT_TRACER },
{"unbuffered", no_argument, NULL, OPT_UNBUFFERED },
{"numa", no_argument, NULL, OPT_NUMA },
@@ -1509,6 +1523,8 @@ static void process_options (int argc, char *argv[], int max_cpus)
ct_debug = 1; break;
case OPT_LAPTOP:
laptop = 1; break;
+ case OPT_TRACEMARK:
+ trace_marker = 1; break;
}
}
@@ -1850,6 +1866,8 @@ int main(int argc, char **argv)
setup_tracer();
+ enable_trace_mark();
+
if (check_timer())
warn("High resolution timers not available\n");
--
2.1.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH 0/4] cyclictest: improve running under trace-cmd
2016-02-25 16:29 [PATCH 0/4] cyclictest: improve running under trace-cmd Luiz Capitulino
` (3 preceding siblings ...)
2016-02-25 16:29 ` [PATCH 4/4] cyclictest: add --tracemark option Luiz Capitulino
@ 2016-03-16 21:23 ` Luiz Capitulino
2016-03-16 22:37 ` John Kacur
4 siblings, 1 reply; 10+ messages in thread
From: Luiz Capitulino @ 2016-03-16 21:23 UTC (permalink / raw)
To: linux-rt-users; +Cc: jkacur, williams
On Thu, 25 Feb 2016 11:29:13 -0500
Luiz Capitulino <lcapitulino@redhat.com> wrote:
>
> This is just a repost of my RFC posting with no changes.
> I have tested it a bit more and I think it's good
> for inclusion.
ping?
>
> Original intro:
>
> In short, this series allows you to run cyclictest under
> trace-cmd and still get trace marks when the latency
> specified with -b is execeded. More details in patch 4/4.
>
> This series is RFC because I'm not completely sure this
> is the right thing to do. I'm wondering if we shouldn't
> ditch all tracing support from cyclictest...
>
> Luiz Capitulino (4):
> cyclictest: tracing(): check for notrace
> cyclictest: move debugfs init code to its own function
> cyclictest: move tracemark_fd handling to its own function
> cyclictest: add --tracemark option
>
> src/cyclictest/cyclictest.c | 62 ++++++++++++++++++++++++++++++++++-----------
> 1 file changed, 47 insertions(+), 15 deletions(-)
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 0/4] cyclictest: improve running under trace-cmd
2016-03-16 21:23 ` [PATCH 0/4] cyclictest: improve running under trace-cmd Luiz Capitulino
@ 2016-03-16 22:37 ` John Kacur
2016-03-17 13:48 ` Luiz Capitulino
0 siblings, 1 reply; 10+ messages in thread
From: John Kacur @ 2016-03-16 22:37 UTC (permalink / raw)
To: Luiz Capitulino; +Cc: linux-rt-users, williams
On Wed, 16 Mar 2016, Luiz Capitulino wrote:
> On Thu, 25 Feb 2016 11:29:13 -0500
> Luiz Capitulino <lcapitulino@redhat.com> wrote:
>
> >
> > This is just a repost of my RFC posting with no changes.
> > I have tested it a bit more and I think it's good
> > for inclusion.
>
> ping?
>
> >
> > Original intro:
> >
> > In short, this series allows you to run cyclictest under
> > trace-cmd and still get trace marks when the latency
> > specified with -b is execeded. More details in patch 4/4.
> >
> > This series is RFC because I'm not completely sure this
> > is the right thing to do. I'm wondering if we shouldn't
> > ditch all tracing support from cyclictest...
> >
> > Luiz Capitulino (4):
> > cyclictest: tracing(): check for notrace
> > cyclictest: move debugfs init code to its own function
> > cyclictest: move tracemark_fd handling to its own function
> > cyclictest: add --tracemark option
> >
> > src/cyclictest/cyclictest.c | 62 ++++++++++++++++++++++++++++++++++-----------
> > 1 file changed, 47 insertions(+), 15 deletions(-)
> >
>
> --
I'll have a closer look tomorrow, but these look okay.
John
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 0/4] cyclictest: improve running under trace-cmd
2016-03-16 22:37 ` John Kacur
@ 2016-03-17 13:48 ` Luiz Capitulino
0 siblings, 0 replies; 10+ messages in thread
From: Luiz Capitulino @ 2016-03-17 13:48 UTC (permalink / raw)
To: John Kacur; +Cc: linux-rt-users, williams
On Wed, 16 Mar 2016 23:37:21 +0100 (CET)
John Kacur <jkacur@redhat.com> wrote:
>
>
> On Wed, 16 Mar 2016, Luiz Capitulino wrote:
>
> > On Thu, 25 Feb 2016 11:29:13 -0500
> > Luiz Capitulino <lcapitulino@redhat.com> wrote:
> >
> > >
> > > This is just a repost of my RFC posting with no changes.
> > > I have tested it a bit more and I think it's good
> > > for inclusion.
> >
> > ping?
> >
> > >
> > > Original intro:
> > >
> > > In short, this series allows you to run cyclictest under
> > > trace-cmd and still get trace marks when the latency
> > > specified with -b is execeded. More details in patch 4/4.
> > >
> > > This series is RFC because I'm not completely sure this
> > > is the right thing to do. I'm wondering if we shouldn't
> > > ditch all tracing support from cyclictest...
> > >
> > > Luiz Capitulino (4):
> > > cyclictest: tracing(): check for notrace
> > > cyclictest: move debugfs init code to its own function
> > > cyclictest: move tracemark_fd handling to its own function
> > > cyclictest: add --tracemark option
> > >
> > > src/cyclictest/cyclictest.c | 62 ++++++++++++++++++++++++++++++++++-----------
> > > 1 file changed, 47 insertions(+), 15 deletions(-)
> > >
> >
> > --
>
> I'll have a closer look tomorrow, but these look okay.
There's a small conflict due to the older repo I was using. I'll
rebase it, re-test and re-post.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 2/4] cyclictest: move debugfs init code to its own function
2016-03-17 18:30 [PATCH v2 " Luiz Capitulino
@ 2016-03-17 18:30 ` Luiz Capitulino
2016-03-22 14:40 ` John Kacur
0 siblings, 1 reply; 10+ messages in thread
From: Luiz Capitulino @ 2016-03-17 18:30 UTC (permalink / raw)
To: linux-rt-users; +Cc: jkacur, williams
A function added by a future commit will want to call
this code too.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
---
src/cyclictest/cyclictest.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/src/cyclictest/cyclictest.c b/src/cyclictest/cyclictest.c
index 6070457..4e80831 100644
--- a/src/cyclictest/cyclictest.c
+++ b/src/cyclictest/cyclictest.c
@@ -514,11 +514,8 @@ static int settracer(char *tracer)
return -1;
}
-static void setup_tracer(void)
+static void debugfs_prepare(void)
{
- if (!tracelimit || notrace)
- return;
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH 2/4] cyclictest: move debugfs init code to its own function
2016-03-17 18:30 ` [PATCH 2/4] cyclictest: move debugfs init code to its own function Luiz Capitulino
@ 2016-03-22 14:40 ` John Kacur
0 siblings, 0 replies; 10+ messages in thread
From: John Kacur @ 2016-03-22 14:40 UTC (permalink / raw)
To: Luiz Capitulino; +Cc: linux-rt-users, williams
On Thu, 17 Mar 2016, Luiz Capitulino wrote:
> A function added by a future commit will want to call
> this code too.
>
> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
> ---
> src/cyclictest/cyclictest.c | 13 +++++++++----
> 1 file changed, 9 insertions(+), 4 deletions(-)
>
> diff --git a/src/cyclictest/cyclictest.c b/src/cyclictest/cyclictest.c
> index 6070457..4e80831 100644
> --- a/src/cyclictest/cyclictest.c
> +++ b/src/cyclictest/cyclictest.c
> @@ -514,11 +514,8 @@ static int settracer(char *tracer)
> return -1;
> }
>
> -static void setup_tracer(void)
> +static void debugfs_prepare(void)
> {
> - if (!tracelimit || notrace)
> - return;
> -
> if (mount_debugfs(NULL))
> fatal("could not mount debugfs");
>
> @@ -533,6 +530,14 @@ static void setup_tracer(void)
> "TRACERs not configured?\n", testname);
> } else
> fileprefix = procfileprefix;
> +}
> +
> +static void setup_tracer(void)
> +{
> + if (!tracelimit || notrace)
> + return;
> +
> + debugfs_prepare();
>
> if (kernelversion >= KV_26_33) {
> int ret;
> --
> 2.1.0
>
> --
Signed-off-by: John Kacur <jkacur@redhat.com>
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2016-03-22 14:40 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-25 16:29 [PATCH 0/4] cyclictest: improve running under trace-cmd Luiz Capitulino
2016-02-25 16:29 ` [PATCH 1/4] cyclictest: tracing(): check for notrace Luiz Capitulino
2016-02-25 16:29 ` [PATCH 2/4] cyclictest: move debugfs init code to its own function Luiz Capitulino
2016-02-25 16:29 ` [PATCH 3/4] cyclictest: move tracemark_fd handling " Luiz Capitulino
2016-02-25 16:29 ` [PATCH 4/4] cyclictest: add --tracemark option Luiz Capitulino
2016-03-16 21:23 ` [PATCH 0/4] cyclictest: improve running under trace-cmd Luiz Capitulino
2016-03-16 22:37 ` John Kacur
2016-03-17 13:48 ` Luiz Capitulino
-- strict thread matches above, loose matches on Subject: below --
2016-03-17 18:30 [PATCH v2 " Luiz Capitulino
2016-03-17 18:30 ` [PATCH 2/4] cyclictest: move debugfs init code to its own function Luiz Capitulino
2016-03-22 14:40 ` John Kacur
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).