diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-12-14 06:34:15 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-12-14 14:31:26 -0500 |
commit | 6c594c21fcb02c662f11c97be4d7d2b73060a205 (patch) | |
tree | dbd56d57fbc4576e18002a5cc08b1f4327a2248f /include | |
parent | 5d6a27d8a096868ae313f71f563b06074a7e34fe (diff) |
perfcounters: add task migrations counter
Impact: add new feature, new sw counter
Add a counter that counts the number of cross-CPU migrations a
task is suffering.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/perf_counter.h | 8 | ||||
-rw-r--r-- | include/linux/sched.h | 3 |
2 files changed, 7 insertions, 4 deletions
diff --git a/include/linux/perf_counter.h b/include/linux/perf_counter.h index d2a16563415f..f30486fc55d7 100644 --- a/include/linux/perf_counter.h +++ b/include/linux/perf_counter.h | |||
@@ -42,6 +42,8 @@ enum hw_event_types { | |||
42 | PERF_COUNT_BRANCH_INSTRUCTIONS = 4, | 42 | PERF_COUNT_BRANCH_INSTRUCTIONS = 4, |
43 | PERF_COUNT_BRANCH_MISSES = 5, | 43 | PERF_COUNT_BRANCH_MISSES = 5, |
44 | 44 | ||
45 | PERF_HW_EVENTS_MAX = 6, | ||
46 | |||
45 | /* | 47 | /* |
46 | * Special "software" counters provided by the kernel, even if | 48 | * Special "software" counters provided by the kernel, even if |
47 | * the hardware does not support performance counters. These | 49 | * the hardware does not support performance counters. These |
@@ -50,11 +52,11 @@ enum hw_event_types { | |||
50 | */ | 52 | */ |
51 | PERF_COUNT_CPU_CLOCK = -1, | 53 | PERF_COUNT_CPU_CLOCK = -1, |
52 | PERF_COUNT_TASK_CLOCK = -2, | 54 | PERF_COUNT_TASK_CLOCK = -2, |
53 | /* | ||
54 | * Future software events: | ||
55 | */ | ||
56 | PERF_COUNT_PAGE_FAULTS = -3, | 55 | PERF_COUNT_PAGE_FAULTS = -3, |
57 | PERF_COUNT_CONTEXT_SWITCHES = -4, | 56 | PERF_COUNT_CONTEXT_SWITCHES = -4, |
57 | PERF_COUNT_CPU_MIGRATIONS = -5, | ||
58 | |||
59 | PERF_SW_EVENTS_MIN = -6, | ||
58 | }; | 60 | }; |
59 | 61 | ||
60 | /* | 62 | /* |
diff --git a/include/linux/sched.h b/include/linux/sched.h index 4c530278391b..2e15be8fc792 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -1014,6 +1014,8 @@ struct sched_entity { | |||
1014 | u64 last_wakeup; | 1014 | u64 last_wakeup; |
1015 | u64 avg_overlap; | 1015 | u64 avg_overlap; |
1016 | 1016 | ||
1017 | u64 nr_migrations; | ||
1018 | |||
1017 | #ifdef CONFIG_SCHEDSTATS | 1019 | #ifdef CONFIG_SCHEDSTATS |
1018 | u64 wait_start; | 1020 | u64 wait_start; |
1019 | u64 wait_max; | 1021 | u64 wait_max; |
@@ -1029,7 +1031,6 @@ struct sched_entity { | |||
1029 | u64 exec_max; | 1031 | u64 exec_max; |
1030 | u64 slice_max; | 1032 | u64 slice_max; |
1031 | 1033 | ||
1032 | u64 nr_migrations; | ||
1033 | u64 nr_migrations_cold; | 1034 | u64 nr_migrations_cold; |
1034 | u64 nr_failed_migrations_affine; | 1035 | u64 nr_failed_migrations_affine; |
1035 | u64 nr_failed_migrations_running; | 1036 | u64 nr_failed_migrations_running; |