Keep track of number of context switches per CPU
Change-Id: I7a2194c8777a7efcd34e1ed7f4734da03fb4d433
This commit is contained in:
committed by
Masamichi Takagi
parent
17a8f68d60
commit
1afc3d9b70
@@ -100,6 +100,7 @@ struct cpu_local_var {
|
|||||||
int in_interrupt;
|
int in_interrupt;
|
||||||
int no_preempt;
|
int no_preempt;
|
||||||
int timer_enabled;
|
int timer_enabled;
|
||||||
|
unsigned long nr_ctx_switches;
|
||||||
int kmalloc_initialized;
|
int kmalloc_initialized;
|
||||||
struct ihk_os_cpu_monitor *monitor;
|
struct ihk_os_cpu_monitor *monitor;
|
||||||
struct rusage_percpu *rusage;
|
struct rusage_percpu *rusage;
|
||||||
|
|||||||
@@ -3518,8 +3518,11 @@ void schedule(void)
|
|||||||
set_timer(1);
|
set_timer(1);
|
||||||
|
|
||||||
if (switch_ctx) {
|
if (switch_ctx) {
|
||||||
dkprintf("schedule: %d => %d \n",
|
++cpu_local_var(nr_ctx_switches);
|
||||||
prev ? prev->tid : 0, next ? next->tid : 0);
|
dkprintf("%s: %d => %d [ctx sws: %lu]\n",
|
||||||
|
__func__,
|
||||||
|
prev ? prev->tid : 0, next ? next->tid : 0,
|
||||||
|
cpu_local_var(nr_ctx_switches));
|
||||||
|
|
||||||
if (prev && prev->ptrace_debugreg) {
|
if (prev && prev->ptrace_debugreg) {
|
||||||
save_debugreg(prev->ptrace_debugreg);
|
save_debugreg(prev->ptrace_debugreg);
|
||||||
|
|||||||
Reference in New Issue
Block a user