Commit 1d536414 authored by Ze Zuo's avatar Ze Zuo
Browse files

sched: Enable per-process mem_sampling from sched switch path

hulk inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I9GZAQ


CVE: NA

--------------------------------

Program mem_sampling for access profiling for threads from the
task sched switch path. mem_sampling is programmed with a period
that corresponds to the incoming thread. Kernel threads are
excluded from this.

Signed-off-by: default avatarZe Zuo <zuoze1@huawei.com>
Signed-off-by: default avatarTong Tiangen <tongtiangen@huawei.com>
Signed-off-by: default avatarShuang Yan <yanshuang7@huawei.com>
parent 9878268b
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

#include <linux/kcov.h>
#include <linux/scs.h>
#include <linux/mem_sampling.h>

#include <asm/irq_regs.h>
#include <asm/switch_to.h>
@@ -4066,6 +4067,7 @@ static struct rq *finish_task_switch(struct task_struct *prev)
	prev_state = prev->state;
	vtime_task_switch(prev);
	perf_event_task_sched_in(prev, current);
	mem_sampling_sched_in(prev, current);
	finish_task(prev);
	tick_nohz_task_switch();
	finish_lock_switch(rq);