gpu: nvgpu: Capture thread name for every channel created

This change ensures that in scenarios where GPU enters a bad
state because of the work submitted by a misbehaved thread,
we should be able to capture thread name as part of our
1st set of failure logs.
Changes for QNX env is pending.

JIRA NVGPU-7783

Change-Id: I65d55a6ade749ff91739458e0642ed2dafaae5cc
Signed-off-by: Kishan <kpalankar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2879197
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Tejal Kudav <tkudav@nvidia.com>
Reviewed-by: Ankur Kishore <ankkishore@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
Kishan
2023-03-29 11:07:51 +00:00
committed by mobile promotions
parent af48120169
commit c6d5fb348c
8 changed files with 52 additions and 11 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017-2019, NVIDIA CORPORATION. All rights reserved.
* Copyright (c) 2017-2023, 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,
@@ -30,3 +30,13 @@ void nvgpu_print_current_impl(struct gk20a *g, const char *func_name, int line,
{
nvgpu_log_msg_impl(g, func_name, line, type, current->comm);
}
void nvgpu_get_thread_name(char *dest)
{
char buf[TASK_COMM_LEN];
get_task_comm(buf, current);
strncpy(dest, buf, TASK_COMM_LEN);
/* Ensure buffer is null terminated */
dest[TASK_COMM_LEN-1] = '\0';
}