From 8fb42631f20cf1396bcfe1f6a926172b520655e3 Mon Sep 17 00:00:00 2001 From: Balazs Gerofi Date: Sat, 20 Mar 2021 13:11:53 +0900 Subject: [PATCH] profile: fix infinite recursion for allocation miss event Change-Id: I248c2abc7d02a9d9bffce20b3183724ddc8c2c1c --- kernel/profile.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/kernel/profile.c b/kernel/profile.c index 80c0b2c0..7fbab128 100644 --- a/kernel/profile.c +++ b/kernel/profile.c @@ -100,8 +100,13 @@ void profile_event_add(enum profile_event_type type, uint64_t tsc) return; if (!cpu_local_var(current)->profile_events) { - if (profile_alloc_events(cpu_local_var(current)) < 0) + if (type == PROFILE_mpol_alloc_missed) { return; + } + + if (profile_alloc_events(cpu_local_var(current)) < 0) { + return; + } } if (type < PROFILE_EVENT_MAX) {