@@ -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),
@@ -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)
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(+)