aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/beam_debug.c
diff options
context:
space:
mode:
authorRickard Green <[email protected]>2017-04-11 17:57:48 +0200
committerRickard Green <[email protected]>2017-04-11 17:57:48 +0200
commitd37bcb84be7c16dcb1c8637c1c3777a6d02932e7 (patch)
tree1f758d4c30202cc5f4ef773e6edd6e022c522b32 /erts/emulator/beam/beam_debug.c
parent92a3b1a37182527d0bf8b6242d54e7fae6f4bbf9 (diff)
parent1bd867a8dbd88ffcee38b2179d42b563e5078820 (diff)
downloadotp-d37bcb84be7c16dcb1c8637c1c3777a6d02932e7.tar.gz
otp-d37bcb84be7c16dcb1c8637c1c3777a6d02932e7.tar.bz2
otp-d37bcb84be7c16dcb1c8637c1c3777a6d02932e7.zip
Merge branch 'rickard/sched_type_tests'
* rickard/sched_type_tests: Fix dirty scheduler type tests
Diffstat (limited to 'erts/emulator/beam/beam_debug.c')
-rw-r--r--erts/emulator/beam/beam_debug.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/erts/emulator/beam/beam_debug.c b/erts/emulator/beam/beam_debug.c
index 88b223cf49..37d8699a4b 100644
--- a/erts/emulator/beam/beam_debug.c
+++ b/erts/emulator/beam/beam_debug.c
@@ -853,15 +853,23 @@ dirty_test(Process *c_p, Eterm type, Eterm arg1, Eterm arg2, UWord *I)
goto badarg;
esdp = erts_proc_sched_data(c_p);
if (!esdp)
- ERTS_BIF_PREP_RET(ret, am_error);
- else if (!ERTS_SCHEDULER_IS_DIRTY(esdp))
+ goto scheduler_type_error;
+
+ switch (esdp->type) {
+ case ERTS_SCHED_NORMAL:
ERTS_BIF_PREP_RET(ret, am_normal);
- else if (ERTS_SCHEDULER_IS_DIRTY_CPU(esdp))
+ break;
+ case ERTS_SCHED_DIRTY_CPU:
ERTS_BIF_PREP_RET(ret, am_dirty_cpu);
- else if (ERTS_SCHEDULER_IS_DIRTY_IO(esdp))
+ break;
+ case ERTS_SCHED_DIRTY_IO:
ERTS_BIF_PREP_RET(ret, am_dirty_io);
- else
+ break;
+ default:
+ scheduler_type_error:
ERTS_BIF_PREP_RET(ret, am_error);
+ break;
+ }
}
else if (am_error == arg1) {
switch (arg2) {