aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Rostedt (Red Hat) <rostedt@goodmis.org>2016-02-10 15:01:08 -0500
committerSteven Rostedt <rostedt@goodmis.org>2016-02-18 20:11:11 -0500
commitac21d5ebe38d8e1872a7159af8503ed55019c690 (patch)
tree93c090b82fb0b9b87a6a2fe81fdd6f31fad6e9fb
parentee0c607e5582ae4768c0b0fe93fa207974f26a34 (diff)
downloadtrace-cmd-ac21d5ebe38d8e1872a7159af8503ed55019c690.tar.gz
trace-cmd-report: Add -S option to remove softirqs from trace
The -S option in trace-cmd report will not print events if the SOFTIRQ flag is set. It does not affect hard interrupts. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r--Documentation/trace-cmd-report.1.txt4
-rw-r--r--trace-read.c12
-rw-r--r--trace-usage.c1
3 files changed, 14 insertions, 3 deletions
diff --git a/Documentation/trace-cmd-report.1.txt b/Documentation/trace-cmd-report.1.txt
index e3737f77..949cad82 100644
--- a/Documentation/trace-cmd-report.1.txt
+++ b/Documentation/trace-cmd-report.1.txt
@@ -138,6 +138,10 @@ OPTIONS
in interrupt context but were called before the kernel "in interrupt"
flag was set.
+*-S*::
+ Do not print events where the SOFTIRQ latency flag is set.
+ This will filter out most events that are from soft interrupt context.
+
*-v*::
This causes the following filters of *-F* to filter out the matching
events.
diff --git a/trace-read.c b/trace-read.c
index cc0e9962..ccac1816 100644
--- a/trace-read.c
+++ b/trace-read.c
@@ -107,6 +107,7 @@ static int buffer_breaks = 0;
static int debug = 0;
static int no_irqs;
+static int no_softirqs;
static struct format_field *wakeup_task;
static struct format_field *wakeup_success;
@@ -860,9 +861,11 @@ test_filters(struct pevent *pevent, struct filter *event_filters,
int ret = FILTER_NONE;
int flags;
- if (no_irqs) {
+ if (no_irqs || no_softirqs) {
flags = pevent_data_flags(pevent, record);
- if (flags & TRACE_FLAG_HARDIRQ)
+ if (no_irqs && (flags & TRACE_FLAG_HARDIRQ))
+ return FILTER_MISS;
+ if (no_softirqs && (flags & TRACE_FLAG_SOFTIRQ))
return FILTER_MISS;
}
@@ -1439,7 +1442,7 @@ void trace_report (int argc, char **argv)
{NULL, 0, NULL, 0}
};
- c = getopt_long (argc-1, argv+1, "+hIi:H:feGpRr:tPNn:LlEwF:VvTqO:",
+ c = getopt_long (argc-1, argv+1, "+hSIi:H:feGpRr:tPNn:LlEwF:VvTqO:",
long_options, &option_index);
if (c == -1)
break;
@@ -1471,6 +1474,9 @@ void trace_report (int argc, char **argv)
case 'I':
no_irqs = 1;
break;
+ case 'S':
+ no_softirqs = 1;
+ break;
case 'P':
show_printk = 1;
break;
diff --git a/trace-usage.c b/trace-usage.c
index 743e260f..4a0d110e 100644
--- a/trace-usage.c
+++ b/trace-usage.c
@@ -140,6 +140,7 @@ static struct usage_help usage_help[] = {
" -E show event files stored\n"
" -F filter to filter output on\n"
" -I filter out events with the HARDIRQ flag set\n"
+ " -S filter out events with the SOFTIRQ flag set\n"
" -t print out full timestamp. Do not truncate to 6 places.\n"
" -R raw format: ignore print format and only show field data\n"
" -r raw format the events that match the option\n"