* [PATCH 0/2] Enhancements of the "trace-cmd stat" command
@ 2020-04-16 7:22 Tzvetomir Stoyanov (VMware)
2020-04-16 7:22 ` [PATCH 1/2] trace-cmd: Update tarce-cmd stat man page with instances list Tzvetomir Stoyanov (VMware)
2020-04-16 7:22 ` [PATCH 2/2] trace-cmd: Add error_log dump to trace-cmd stat command Tzvetomir Stoyanov (VMware)
0 siblings, 2 replies; 3+ messages in thread
From: Tzvetomir Stoyanov (VMware) @ 2020-04-16 7:22 UTC (permalink / raw)
To: rostedt; +Cc: linux-trace-devel
"error_log" dump is added to the trace-cmd stat command.
Man page is updated.
Tzvetomir Stoyanov (VMware) (2):
trace-cmd: Update tarce-cmd stat man page with instances list
trace-cmd: Add error_log dump to trace-cmd stat command
Documentation/trace-cmd-stat.1.txt | 4 ++++
tracecmd/trace-stat.c | 17 +++++++++++++++++
2 files changed, 21 insertions(+)
--
2.25.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 1/2] trace-cmd: Update tarce-cmd stat man page with instances list
2020-04-16 7:22 [PATCH 0/2] Enhancements of the "trace-cmd stat" command Tzvetomir Stoyanov (VMware)
@ 2020-04-16 7:22 ` Tzvetomir Stoyanov (VMware)
2020-04-16 7:22 ` [PATCH 2/2] trace-cmd: Add error_log dump to trace-cmd stat command Tzvetomir Stoyanov (VMware)
1 sibling, 0 replies; 3+ messages in thread
From: Tzvetomir Stoyanov (VMware) @ 2020-04-16 7:22 UTC (permalink / raw)
To: rostedt; +Cc: linux-trace-devel
Recently, the "tarce-cmd stat" command was enhanced to list all
configured ftrace instances. However, the man page was not updated
with this new output.
Signed-off-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com>
---
Documentation/trace-cmd-stat.1.txt | 2 ++
1 file changed, 2 insertions(+)
diff --git a/Documentation/trace-cmd-stat.1.txt b/Documentation/trace-cmd-stat.1.txt
index 4a29b143..004fbaa5 100644
--- a/Documentation/trace-cmd-stat.1.txt
+++ b/Documentation/trace-cmd-stat.1.txt
@@ -14,6 +14,8 @@ DESCRIPTION
The trace-cmd(1) stat displays the various status of the tracing (ftrace)
system. The status that it shows is:
+*Instances:* List all configured ftrace instances.
+
*Tracer:* if one of the tracers (like function_graph) is active. Otherwise
nothing is displayed.
--
2.25.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 2/2] trace-cmd: Add error_log dump to trace-cmd stat command
2020-04-16 7:22 [PATCH 0/2] Enhancements of the "trace-cmd stat" command Tzvetomir Stoyanov (VMware)
2020-04-16 7:22 ` [PATCH 1/2] trace-cmd: Update tarce-cmd stat man page with instances list Tzvetomir Stoyanov (VMware)
@ 2020-04-16 7:22 ` Tzvetomir Stoyanov (VMware)
1 sibling, 0 replies; 3+ messages in thread
From: Tzvetomir Stoyanov (VMware) @ 2020-04-16 7:22 UTC (permalink / raw)
To: rostedt; +Cc: linux-trace-devel
In case of a ftrace configuration problem, the description
of the error is printed in the error_log file. It is useful
to dump all recorded errors in "trace-cmd stat" command.
Reported-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=207291
Signed-off-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com>
---
Documentation/trace-cmd-stat.1.txt | 2 ++
tracecmd/trace-stat.c | 17 +++++++++++++++++
2 files changed, 19 insertions(+)
diff --git a/Documentation/trace-cmd-stat.1.txt b/Documentation/trace-cmd-stat.1.txt
index 004fbaa5..2f1a9c8b 100644
--- a/Documentation/trace-cmd-stat.1.txt
+++ b/Documentation/trace-cmd-stat.1.txt
@@ -43,6 +43,8 @@ system. The status that it shows is:
*Uprobes:* Shows any uprobes that are defined for tracing.
+*Error log:* Dump the content of ftrace error_log file.
+
SEE ALSO
--------
trace-cmd(1), trace-cmd-record(1), trace-cmd-report(1), trace-cmd-start(1),
diff --git a/tracecmd/trace-stat.c b/tracecmd/trace-stat.c
index 3f7b3493..c5057978 100644
--- a/tracecmd/trace-stat.c
+++ b/tracecmd/trace-stat.c
@@ -897,6 +897,22 @@ static void report_traceon(struct buffer_instance *instance)
free(str);
}
+static void report_errorlog(struct buffer_instance *instance)
+{
+ char *str;
+
+ if (!tracefs_file_exists(instance->tracefs, "error_log"))
+ return;
+ str = get_instance_file_content(instance, "error_log");
+ if (!str)
+ return;
+
+ if (str[0])
+ printf("\nError log:\n%s\n", str);
+
+ free(str);
+}
+
static void stat_instance(struct buffer_instance *instance)
{
if (instance != &top_instance) {
@@ -920,6 +936,7 @@ static void stat_instance(struct buffer_instance *instance)
report_kprobes(instance);
report_uprobes(instance);
report_traceon(instance);
+ report_errorlog(instance);
}
void trace_stat (int argc, char **argv)
--
2.25.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-04-16 7:22 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-16 7:22 [PATCH 0/2] Enhancements of the "trace-cmd stat" command Tzvetomir Stoyanov (VMware)
2020-04-16 7:22 ` [PATCH 1/2] trace-cmd: Update tarce-cmd stat man page with instances list Tzvetomir Stoyanov (VMware)
2020-04-16 7:22 ` [PATCH 2/2] trace-cmd: Add error_log dump to trace-cmd stat command Tzvetomir Stoyanov (VMware)
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).