|
@@ -112,6 +112,7 @@ struct trace {
|
|
bool multiple_threads;
|
|
bool multiple_threads;
|
|
bool summary;
|
|
bool summary;
|
|
bool summary_only;
|
|
bool summary_only;
|
|
|
|
+ bool failure_only;
|
|
bool show_comm;
|
|
bool show_comm;
|
|
bool print_sample;
|
|
bool print_sample;
|
|
bool show_tool_stats;
|
|
bool show_tool_stats;
|
|
@@ -1565,7 +1566,7 @@ static int trace__printf_interrupted_entry(struct trace *trace)
|
|
struct thread_trace *ttrace;
|
|
struct thread_trace *ttrace;
|
|
size_t printed;
|
|
size_t printed;
|
|
|
|
|
|
- if (trace->current == NULL)
|
|
|
|
|
|
+ if (trace->failure_only || trace->current == NULL)
|
|
return 0;
|
|
return 0;
|
|
|
|
|
|
ttrace = thread__priv(trace->current);
|
|
ttrace = thread__priv(trace->current);
|
|
@@ -1638,7 +1639,7 @@ static int trace__sys_enter(struct trace *trace, struct perf_evsel *evsel,
|
|
args, trace, thread);
|
|
args, trace, thread);
|
|
|
|
|
|
if (sc->is_exit) {
|
|
if (sc->is_exit) {
|
|
- if (!(trace->duration_filter || trace->summary_only || trace->min_stack)) {
|
|
|
|
|
|
+ if (!(trace->duration_filter || trace->summary_only || trace->failure_only || trace->min_stack)) {
|
|
trace__fprintf_entry_head(trace, thread, 0, false, ttrace->entry_time, trace->output);
|
|
trace__fprintf_entry_head(trace, thread, 0, false, ttrace->entry_time, trace->output);
|
|
fprintf(trace->output, "%-70s)\n", ttrace->entry_str);
|
|
fprintf(trace->output, "%-70s)\n", ttrace->entry_str);
|
|
}
|
|
}
|
|
@@ -1742,7 +1743,7 @@ static int trace__sys_exit(struct trace *trace, struct perf_evsel *evsel,
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- if (trace->summary_only)
|
|
|
|
|
|
+ if (trace->summary_only || (ret >= 0 && trace->failure_only))
|
|
goto out;
|
|
goto out;
|
|
|
|
|
|
trace__fprintf_entry_head(trace, thread, duration, duration_calculated, ttrace->entry_time, trace->output);
|
|
trace__fprintf_entry_head(trace, thread, duration, duration_calculated, ttrace->entry_time, trace->output);
|
|
@@ -3087,6 +3088,8 @@ int cmd_trace(int argc, const char **argv)
|
|
OPT_INCR('v', "verbose", &verbose, "be more verbose"),
|
|
OPT_INCR('v', "verbose", &verbose, "be more verbose"),
|
|
OPT_BOOLEAN('T', "time", &trace.full_time,
|
|
OPT_BOOLEAN('T', "time", &trace.full_time,
|
|
"Show full timestamp, not time relative to first start"),
|
|
"Show full timestamp, not time relative to first start"),
|
|
|
|
+ OPT_BOOLEAN(0, "failure", &trace.failure_only,
|
|
|
|
+ "Show only syscalls that failed"),
|
|
OPT_BOOLEAN('s', "summary", &trace.summary_only,
|
|
OPT_BOOLEAN('s', "summary", &trace.summary_only,
|
|
"Show only syscall summary with statistics"),
|
|
"Show only syscall summary with statistics"),
|
|
OPT_BOOLEAN('S', "with-summary", &trace.summary,
|
|
OPT_BOOLEAN('S', "with-summary", &trace.summary,
|