def return_probe_from_definition(df, types):
 args = df['args']
 retval_type = df['retval_type']
 printf_specifier = type_description(retval_type, types)['printf_specifier']
 template = Template(RETURN_PROBE_TEMPLATE)
 mapping = {'__LIBRARY__': df.get('library', ''), '__NAME__': df['api'], '__ARGS_FORMAT_STRING__': arguments_format_string(args, types), '__RETVAL_FORMAT_SPECIFIER__': printf_specifier, '__ARGUMENTS__': arguments_section(args, types), '__RETVAL__': retval_section(retval_type, types), '__ARGUMENTS_POP_FROM_STACK__': pop_from_stack_section(args)}
 return template.substitute(mapping)

def return_probe_from_definition ( df , types ) : args = df [ 'args' ] retval_type = df [ 'retval_type' ] printf_specifier = type_description ( retval_type , types ) [ 'printf_specifier' ] template = Template ( RETURN_PROBE_TEMPLATE ) mapping = { '__LIBRARY__' : df . get ( 'library' , '' ) , '__NAME__' : df [ 'api' ] , '__ARGS_FORMAT_STRING__' : arguments_format_string ( args , types ) , '__RETVAL_FORMAT_SPECIFIER__' : printf_specifier , '__ARGUMENTS__' : arguments_section ( args , types ) , '__RETVAL__' : retval_section ( retval_type , types ) , '__ARGUMENTS_POP_FROM_STACK__' : pop_from_stack_section ( args ) } return template . substitute ( mapping )
generates a return dtrace probe from the given api definition .