From 32353ab744937add05253cea617f397ea3d13920 Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Mon, 11 Dec 2017 11:33:48 -0800 Subject: gpu: nvgpu: Implement abstraction for finding TID Implement abstraction for finding the thread ID of thread currently being run. This is tracked for context switch tracing. In Linux kernel this is implemented by returning PID. Change-Id: Id46a318894f9a2ff3c85d2c8ef0b02c52783f122 Signed-off-by: Terje Bergstrom Reviewed-on: https://git-master.nvidia.com/r/1627239 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/common/linux/os_sched.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'drivers/gpu/nvgpu/common/linux/os_sched.c') diff --git a/drivers/gpu/nvgpu/common/linux/os_sched.c b/drivers/gpu/nvgpu/common/linux/os_sched.c index ddaaad0f..586b35eb 100644 --- a/drivers/gpu/nvgpu/common/linux/os_sched.c +++ b/drivers/gpu/nvgpu/common/linux/os_sched.c @@ -15,6 +15,11 @@ #include +int nvgpu_current_tid(struct gk20a *g) +{ + return current->pid; +} + int nvgpu_current_pid(struct gk20a *g) { return current->tgid; -- cgit v1.2.2