gpu: nvgpu: add support to print caller information

This patch updates nvgpu_assert as macro to print the information
about the calling function. Specifically, to print the function
name and the line number details.

This patch introduces misra violations (misra_c_2012_rule_10_1_violation)
in nvgpu_assert(). However, leaving misra violations unfixed has low
safety impact since misra violations are coming after fatal error is
hit where GPU driver is not expected to be serviceable thereafter.
Further, this patch provides debug benefit in quickly finding the
function that lead to the exit of NvGPU process.

Bug 2964898

Change-Id: Iba85f4a9226742a0bb08b045bcbfa26949bbe746
Signed-off-by: Rajesh Devaraj <rdevaraj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2342086
Reviewed-by: automaticguardword <automaticguardword@nvidia.com>
Reviewed-by: Ankur Kishore <ankkishore@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Rajesh Devaraj
2020-05-11 11:20:58 +00:00
committed by Alex Waterman
parent 077a07ff9f
commit d4d81a6f8e
2 changed files with 10 additions and 17 deletions

View File

@@ -169,7 +169,7 @@ done:
#endif
while ((err = raise(SIGSEGV)) != 0) {
/*
* Make sure the signal is raised.
* Make sure that SIGSEGV signal is raised.
*/
}