From: "Tzvetomir Stoyanov (VMware)" <tz.stoyanov@gmail.com>
To: rostedt@goodmis.org
Cc: linux-trace-devel@vger.kernel.org
Subject: [PATCH 3/4] trace-cmd: Create ftrace instances before using them.
Date: Thu, 30 Apr 2020 15:22:21 +0300 [thread overview]
Message-ID: <20200430122222.101276-4-tz.stoyanov@gmail.com> (raw)
In-Reply-To: <20200430122222.101276-1-tz.stoyanov@gmail.com>
Ftrace instances should be created physically in the tracefs, before
trying to access its files. In record_trace() function, the call to
make_instances() should be before the logic which reads the instance's
tracing file.
Signed-off-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com>
---
tracecmd/trace-record.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tracecmd/trace-record.c b/tracecmd/trace-record.c
index d8c24ebf..1e4d38fa 100644
--- a/tracecmd/trace-record.c
+++ b/tracecmd/trace-record.c
@@ -6222,6 +6222,8 @@ static void record_trace(int argc, char **argv,
if (!ctx->output)
ctx->output = DEFAULT_INPUT_FILE;
+ make_instances();
+
/* Save the state of tracing_on before starting */
for_all_instances(instance) {
instance->output_file = strdup(ctx->output);
@@ -6236,8 +6238,6 @@ static void record_trace(int argc, char **argv,
instance->tracing_on_init_val = 1;
}
- make_instances();
-
if (ctx->events)
expand_event_list();
--
2.25.4
next prev parent reply other threads:[~2020-04-30 12:22 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-30 12:22 [PATCH 0/4] Few small trace-cmd fixes Tzvetomir Stoyanov (VMware)
2020-04-30 12:22 ` [PATCH 1/4] trace-cmd: Fix trace-cmd report crash while displaying trace.dat in specific use case Tzvetomir Stoyanov (VMware)
2020-04-30 12:22 ` [PATCH 2/4] trace-cmd: Add "main" in the output of trace-cmd stat when displaying main instance Tzvetomir Stoyanov (VMware)
2020-04-30 12:22 ` Tzvetomir Stoyanov (VMware) [this message]
2020-04-30 12:22 ` [PATCH 4/4] trace-cmd: Do not try to update parent's memory from a fork()-ed child Tzvetomir Stoyanov (VMware)
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=20200430122222.101276-4-tz.stoyanov@gmail.com \
--to=tz.stoyanov@gmail.com \
--cc=linux-trace-devel@vger.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;
as well as URLs for NNTP newsgroup(s).