Files
linux-nvgpu/drivers/gpu/nvgpu/common/linux/os_sched.c
Terje Bergstrom 32353ab744 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 <tbergstrom@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1627239
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-12-28 10:02:09 -08:00

27 lines
711 B
C

/*
* Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*/
#include <nvgpu/os_sched.h>
#include <linux/sched.h>
int nvgpu_current_tid(struct gk20a *g)
{
return current->pid;
}
int nvgpu_current_pid(struct gk20a *g)
{
return current->tgid;
}