#NEWLINE# def _generate_ctx( self , stream ) : #NEWLINE# #INDENT# tmpl = templates . _CTX_BEGIN #NEWLINE# self . _cg . add_lines ( tmpl . format ( prefix = self . _cfg . prefix , sname = stream . name ) ) #NEWLINE# tmpl = 'uint32_t off_tph_{fname};' #NEWLINE# self . _cg . indent ( ) #NEWLINE# trace_packet_header_type = self . _cfg . metadata . trace . packet_header_type #NEWLINE# if ( trace_packet_header_type is not None ) : #NEWLINE# #INDENT# for field_name in trace_packet_header_type . fields : #NEWLINE# #INDENT# self . _cg . add_lines ( tmpl . format ( fname = field_name ) ) #NEWLINE# #UNINDENT# #UNINDENT# tmpl = 'uint32_t off_spc_{fname};' #NEWLINE# if ( stream . packet_context_type is not None ) : #NEWLINE# #INDENT# for field_name in stream . packet_context_type . fields : #NEWLINE# #INDENT# self . _cg . add_lines ( tmpl . format ( fname = field_name ) ) #NEWLINE# #UNINDENT# #UNINDENT# self . _cg . unindent ( ) #NEWLINE# tmpl = templates . _CTX_END #NEWLINE# self . _cg . add_lines ( tmpl )