diff options
-rw-r--r-- | kernel/trace/ftrace.c | 7 | ||||
-rw-r--r-- | kernel/trace/trace.c | 3 | ||||
-rw-r--r-- | kernel/trace/trace.h | 1 |
3 files changed, 10 insertions, 1 deletions
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index 0b90364d1a2c..02d2de9d08ba 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c | |||
@@ -2599,6 +2599,13 @@ ftrace_graph_probe_sched_switch(struct rq *__rq, struct task_struct *prev, | |||
2599 | unsigned long long timestamp; | 2599 | unsigned long long timestamp; |
2600 | int index; | 2600 | int index; |
2601 | 2601 | ||
2602 | /* | ||
2603 | * Does the user want to count the time a function was asleep. | ||
2604 | * If so, do not update the time stamps. | ||
2605 | */ | ||
2606 | if (trace_flags & TRACE_ITER_SLEEP_TIME) | ||
2607 | return; | ||
2608 | |||
2602 | timestamp = trace_clock_local(); | 2609 | timestamp = trace_clock_local(); |
2603 | 2610 | ||
2604 | prev->ftrace_timestamp = timestamp; | 2611 | prev->ftrace_timestamp = timestamp; |
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index f0e1337b1ebd..67c6a21dd427 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c | |||
@@ -255,7 +255,7 @@ static DECLARE_WAIT_QUEUE_HEAD(trace_wait); | |||
255 | 255 | ||
256 | /* trace_flags holds trace_options default values */ | 256 | /* trace_flags holds trace_options default values */ |
257 | unsigned long trace_flags = TRACE_ITER_PRINT_PARENT | TRACE_ITER_PRINTK | | 257 | unsigned long trace_flags = TRACE_ITER_PRINT_PARENT | TRACE_ITER_PRINTK | |
258 | TRACE_ITER_ANNOTATE | TRACE_ITER_CONTEXT_INFO; | 258 | TRACE_ITER_ANNOTATE | TRACE_ITER_CONTEXT_INFO | TRACE_ITER_SLEEP_TIME; |
259 | 259 | ||
260 | /** | 260 | /** |
261 | * trace_wake_up - wake up tasks waiting for trace input | 261 | * trace_wake_up - wake up tasks waiting for trace input |
@@ -316,6 +316,7 @@ static const char *trace_options[] = { | |||
316 | "context-info", | 316 | "context-info", |
317 | "latency-format", | 317 | "latency-format", |
318 | "global-clock", | 318 | "global-clock", |
319 | "sleep-time", | ||
319 | NULL | 320 | NULL |
320 | }; | 321 | }; |
321 | 322 | ||
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h index 7cfb741be200..d7410bbb9a80 100644 --- a/kernel/trace/trace.h +++ b/kernel/trace/trace.h | |||
@@ -683,6 +683,7 @@ enum trace_iterator_flags { | |||
683 | TRACE_ITER_CONTEXT_INFO = 0x20000, /* Print pid/cpu/time */ | 683 | TRACE_ITER_CONTEXT_INFO = 0x20000, /* Print pid/cpu/time */ |
684 | TRACE_ITER_LATENCY_FMT = 0x40000, | 684 | TRACE_ITER_LATENCY_FMT = 0x40000, |
685 | TRACE_ITER_GLOBAL_CLK = 0x80000, | 685 | TRACE_ITER_GLOBAL_CLK = 0x80000, |
686 | TRACE_ITER_SLEEP_TIME = 0x100000, | ||
686 | }; | 687 | }; |
687 | 688 | ||
688 | /* | 689 | /* |