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/gk20a/channel_gk20a.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'drivers/gpu/nvgpu/gk20a/channel_gk20a.c') diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c index 07ae5a16..f4a49a4b 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c @@ -44,6 +44,7 @@ #include #include #include +#include #include "gk20a.h" #include "dbg_gpu_gk20a.h" @@ -726,8 +727,8 @@ struct channel_gk20a *gk20a_open_new_channel(struct gk20a *g, /* now the channel is in a limbo out of the free list but not marked as * alive and used (i.e. get-able) yet */ - ch->pid = current->pid; - ch->tgid = current->tgid; /* process granularity for FECS traces */ + ch->pid = nvgpu_current_tid(g); + ch->tgid = nvgpu_current_pid(g); /* process granularity for FECS traces */ /* By default, channel is regular (non-TSG) channel */ ch->tsgid = NVGPU_INVALID_TSG_ID; -- cgit v1.2.2