diff options
| author | Ingo Molnar <mingo@elte.hu> | 2012-03-05 03:20:08 -0500 |
|---|---|---|
| committer | Ingo Molnar <mingo@elte.hu> | 2012-03-05 03:20:08 -0500 |
| commit | 737f24bda723fdf89ecaacb99fa2bf5683c32799 (patch) | |
| tree | 35495fff3e9956679cb5468e74e6814c8e44ee66 /include/trace | |
| parent | 8eedce996556d7d06522cd3a0e6069141c8dffe0 (diff) | |
| parent | b7c924274c456499264d1cfa3d44063bb11eb5db (diff) | |
Merge branch 'perf/urgent' into perf/core
Conflicts:
tools/perf/builtin-record.c
tools/perf/builtin-top.c
tools/perf/perf.h
tools/perf/util/top.h
Merge reason: resolve these cherry-picking conflicts.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/trace')
| -rw-r--r-- | include/trace/events/sched.h | 50 | ||||
| -rw-r--r-- | include/trace/events/writeback.h | 7 |
2 files changed, 5 insertions, 52 deletions
diff --git a/include/trace/events/sched.h b/include/trace/events/sched.h index e61ddfe8fe9e..fbc7b1ad929b 100644 --- a/include/trace/events/sched.h +++ b/include/trace/events/sched.h | |||
| @@ -397,56 +397,6 @@ TRACE_EVENT(sched_stat_runtime, | |||
| 397 | (unsigned long long)__entry->vruntime) | 397 | (unsigned long long)__entry->vruntime) |
| 398 | ); | 398 | ); |
| 399 | 399 | ||
| 400 | #ifdef CREATE_TRACE_POINTS | ||
| 401 | static inline u64 trace_get_sleeptime(struct task_struct *tsk) | ||
| 402 | { | ||
| 403 | #ifdef CONFIG_SCHEDSTATS | ||
| 404 | u64 block, sleep; | ||
| 405 | |||
| 406 | block = tsk->se.statistics.block_start; | ||
| 407 | sleep = tsk->se.statistics.sleep_start; | ||
| 408 | tsk->se.statistics.block_start = 0; | ||
| 409 | tsk->se.statistics.sleep_start = 0; | ||
| 410 | |||
| 411 | return block ? block : sleep ? sleep : 0; | ||
| 412 | #else | ||
| 413 | return 0; | ||
| 414 | #endif | ||
| 415 | } | ||
| 416 | #endif | ||
| 417 | |||
| 418 | /* | ||
| 419 | * Tracepoint for accounting sleeptime (time the task is sleeping | ||
| 420 | * or waiting for I/O). | ||
| 421 | */ | ||
| 422 | TRACE_EVENT(sched_stat_sleeptime, | ||
| 423 | |||
| 424 | TP_PROTO(struct task_struct *tsk, u64 now), | ||
| 425 | |||
| 426 | TP_ARGS(tsk, now), | ||
| 427 | |||
| 428 | TP_STRUCT__entry( | ||
| 429 | __array( char, comm, TASK_COMM_LEN ) | ||
| 430 | __field( pid_t, pid ) | ||
| 431 | __field( u64, sleeptime ) | ||
| 432 | ), | ||
| 433 | |||
| 434 | TP_fast_assign( | ||
| 435 | memcpy(__entry->comm, tsk->comm, TASK_COMM_LEN); | ||
| 436 | __entry->pid = tsk->pid; | ||
| 437 | __entry->sleeptime = trace_get_sleeptime(tsk); | ||
| 438 | __entry->sleeptime = __entry->sleeptime ? | ||
| 439 | now - __entry->sleeptime : 0; | ||
| 440 | ) | ||
| 441 | TP_perf_assign( | ||
| 442 | __perf_count(__entry->sleeptime); | ||
| 443 | ), | ||
| 444 | |||
| 445 | TP_printk("comm=%s pid=%d sleeptime=%Lu [ns]", | ||
| 446 | __entry->comm, __entry->pid, | ||
| 447 | (unsigned long long)__entry->sleeptime) | ||
| 448 | ); | ||
| 449 | |||
| 450 | /* | 400 | /* |
| 451 | * Tracepoint for showing priority inheritance modifying a tasks | 401 | * Tracepoint for showing priority inheritance modifying a tasks |
| 452 | * priority. | 402 | * priority. |
diff --git a/include/trace/events/writeback.h b/include/trace/events/writeback.h index 8588a8918023..5973410e8f8c 100644 --- a/include/trace/events/writeback.h +++ b/include/trace/events/writeback.h | |||
| @@ -47,7 +47,10 @@ DECLARE_EVENT_CLASS(writeback_work_class, | |||
| 47 | __field(int, reason) | 47 | __field(int, reason) |
| 48 | ), | 48 | ), |
| 49 | TP_fast_assign( | 49 | TP_fast_assign( |
| 50 | strncpy(__entry->name, dev_name(bdi->dev), 32); | 50 | struct device *dev = bdi->dev; |
| 51 | if (!dev) | ||
| 52 | dev = default_backing_dev_info.dev; | ||
| 53 | strncpy(__entry->name, dev_name(dev), 32); | ||
| 51 | __entry->nr_pages = work->nr_pages; | 54 | __entry->nr_pages = work->nr_pages; |
| 52 | __entry->sb_dev = work->sb ? work->sb->s_dev : 0; | 55 | __entry->sb_dev = work->sb ? work->sb->s_dev : 0; |
| 53 | __entry->sync_mode = work->sync_mode; | 56 | __entry->sync_mode = work->sync_mode; |
| @@ -426,7 +429,7 @@ DECLARE_EVENT_CLASS(writeback_single_inode_template, | |||
| 426 | 429 | ||
| 427 | TP_fast_assign( | 430 | TP_fast_assign( |
| 428 | strncpy(__entry->name, | 431 | strncpy(__entry->name, |
| 429 | dev_name(inode->i_mapping->backing_dev_info->dev), 32); | 432 | dev_name(inode_to_bdi(inode)->dev), 32); |
| 430 | __entry->ino = inode->i_ino; | 433 | __entry->ino = inode->i_ino; |
| 431 | __entry->state = inode->i_state; | 434 | __entry->state = inode->i_state; |
| 432 | __entry->dirtied_when = inode->dirtied_when; | 435 | __entry->dirtied_when = inode->dirtied_when; |
