#NEWLINE# def _get_kernel_name( ) : #NEWLINE# #INDENT# '\n    Returns the path of the kernel\n    ' #NEWLINE# names = [ 'kernel' ] #NEWLINE# if ( 'NVPROF_ID' in os . environ ) : #NEWLINE# #INDENT# for frame in tb . extract_stack ( ) : #NEWLINE# #INDENT# if nrv_re . search ( frame [ 0 ] ) : #NEWLINE# #INDENT# break #NEWLINE# #UNINDENT# caller = frame [ 0 : 2 ] #NEWLINE# #UNINDENT# ( file_path , file_name ) = os . path . split ( caller [ 0 ] ) #NEWLINE# ( path1 , path2 ) = os . path . split ( file_path ) #NEWLINE# ( file_base , ext ) = os . path . splitext ( file_name ) #NEWLINE# for name in ( path2 , file_base , ext ) : #NEWLINE# #INDENT# name = name_re . sub ( '' , names ) #NEWLINE# if name : #NEWLINE# #INDENT# names . append ( name ) #NEWLINE# #UNINDENT# #UNINDENT# names . append ( str ( caller [ 1 ] ) ) #NEWLINE# #UNINDENT# return names