def flag_bits(args): bits = [ Arg(type='enum intel_ds_stall_flag', name='flags', var='decode_cb(flags)', c_format='0x%x') ] for a in args: bits.append( Arg(type='bool', name=a[1], var='__entry->flags & INTEL_DS_{0}_BIT'.format(a[0]), c_format='%u')) return bits
Tracepoint('start_{0}'.format(name), toggle_name=name, tp_perfetto='tu_start_{0}'.format(name)) Tracepoint('end_{0}'.format(name), toggle_name=name, args=args, tp_struct=tp_struct, tp_perfetto='tu_end_{0}'.format(name), tp_print=tp_print) begin_end_tp( 'render_pass', args=[ArgStruct(type='const struct tu_framebuffer *', var='fb')], tp_struct=[ Arg(type='uint16_t', name='width', var='fb->width', c_format='%u'), Arg(type='uint16_t', name='height', var='fb->height', c_format='%u'), Arg(type='uint8_t', name='MRTs', var='fb->attachment_count', c_format='%u'), # Arg(type='uint8_t', name='samples', var='fb->samples', c_format='%u'), Arg(type='uint16_t', name='numberOfBins', var='fb->tile_count.width * fb->tile_count.height', c_format='%u'), Arg(type='uint16_t', name='binWidth', var='fb->tile0.width', c_format='%u'), Arg(type='uint16_t',
def define_tracepoints(args): from u_trace import Header, HeaderScope from u_trace import ForwardDecl from u_trace import Tracepoint from u_trace import TracepointArg as Arg from u_trace import TracepointArgStruct as ArgStruct Header('intel_driver_ds.h', scope=HeaderScope.SOURCE) Header('blorp/blorp_priv.h', scope=HeaderScope.HEADER) Header('ds/intel_driver_ds.h', scope=HeaderScope.HEADER) def begin_end_tp(name, tp_args=[], tp_struct=None, tp_print=None, end_pipelined=True): Tracepoint('intel_begin_{0}'.format(name), tp_perfetto='intel_ds_begin_{0}'.format(name)) Tracepoint('intel_end_{0}'.format(name), args=tp_args, tp_struct=tp_struct, tp_perfetto='intel_ds_end_{0}'.format(name), tp_print=tp_print, end_of_pipe=end_pipelined) begin_end_tp('batch', tp_args=[Arg(type='uint8_t', var='name', c_format='%hhu'),], end_pipelined=False) begin_end_tp('cmd_buffer', tp_args=[Arg(type='uint8_t', var='level', c_format='%hhu'),], end_pipelined=False) begin_end_tp('render_pass', tp_args=[Arg(type='uint16_t', var='width', c_format='%hu'), Arg(type='uint16_t', var='height', c_format='%hu'), Arg(type='uint8_t', var='att_count', c_format='%hhu'), Arg(type='uint8_t', var='msaa', c_format='%hhu'), Arg(type='uint32_t', var='subpass_count', c_format='%u'),]) begin_end_tp('dyn_render_pass', tp_args=[Arg(type='uint16_t', var='width', c_format='%hu'), Arg(type='uint16_t', var='height', c_format='%hu'), Arg(type='uint8_t', var='att_count', c_format='%hhu'), Arg(type='uint8_t', var='msaa', c_format='%hhu'), Arg(type='uint8_t', var='suspend', c_format='%hhu'), Arg(type='uint8_t', var='resume', c_format='%hhu'),]) begin_end_tp('blorp', tp_args=[Arg(type='uint32_t', name='width', var='width', c_format='%u'), Arg(type='uint32_t', name='height', var='height', c_format='%u'), Arg(type='enum isl_aux_op', name='hiz_op', var='hiz_op', c_format='%s', to_prim_type='isl_aux_op_to_name({})'), Arg(type='enum isl_aux_op', name='fast_clear_op', var='fast_clear_op', c_format='%s', to_prim_type='isl_aux_op_to_name({})'), Arg(type='enum blorp_shader_type', name='blorp_type', var='shader_type', c_format='%s', to_prim_type='blorp_shader_type_to_name({})'), Arg(type='enum blorp_shader_pipeline', name='blorp_pipe', var='shader_pipe', c_format='%s', to_prim_type='blorp_shader_pipeline_to_name({})'),]) begin_end_tp('draw', tp_args=[Arg(type='uint32_t', var='count', c_format='%u')]) begin_end_tp('draw_multi', tp_args=[Arg(type='uint32_t', var='count', c_format='%u'),]) begin_end_tp('draw_indexed', tp_args=[Arg(type='uint32_t', var='count', c_format='%u'),]) begin_end_tp('draw_indexed_multi', tp_args=[Arg(type='uint32_t', var='count', c_format='%u'),]) begin_end_tp('draw_indirect_byte_count', tp_args=[Arg(type='uint32_t', var='instance_count', c_format='%u'),]) begin_end_tp('draw_indirect', tp_args=[Arg(type='uint32_t', var='draw_count', c_format='%u'),]) begin_end_tp('draw_indexed_indirect', tp_args=[Arg(type='uint32_t', var='draw_count', c_format='%u'),]) begin_end_tp('draw_indirect_count', tp_args=[Arg(type='uint32_t', var='max_draw_count', c_format='%u'),]) begin_end_tp('draw_indexed_indirect_count', tp_args=[Arg(type='uint32_t', var='max_draw_count', c_format='%u'),]) begin_end_tp('compute', tp_args=[Arg(type='uint32_t', var='group_x', c_format='%u'), Arg(type='uint32_t', var='group_y', c_format='%u'), Arg(type='uint32_t', var='group_z', c_format='%u'),], tp_print=['group=%ux%ux%u', '__entry->group_x', '__entry->group_y', '__entry->group_z']) def flag_bits(args): bits = [Arg(type='enum intel_ds_stall_flag', name='flags', var='decode_cb(flags)', c_format='0x%x')] for a in args: bits.append(Arg(type='bool', name=a[1], var='__entry->flags & INTEL_DS_{0}_BIT'.format(a[0]), c_format='%u')) return bits def stall_args(args): fmt = '' exprs = [] for a in args: fmt += '%s' exprs.append('(__entry->flags & INTEL_DS_{0}_BIT) ? "+{1}" : ""'.format(a[0], a[1])) fmt += ' : %s' exprs.append('__entry->reason ? __entry->reason : "unknown"') fmt = [fmt] fmt += exprs return fmt stall_flags = [['DEPTH_CACHE_FLUSH', 'depth_flush'], ['DATA_CACHE_FLUSH', 'dc_flush'], ['HDC_PIPELINE_FLUSH', 'hdc_flush'], ['RENDER_TARGET_CACHE_FLUSH', 'rt_flush'], ['TILE_CACHE_FLUSH', 'tile_flush'], ['STATE_CACHE_INVALIDATE', 'state_inval'], ['CONST_CACHE_INVALIDATE', 'const_inval'], ['VF_CACHE_INVALIDATE', 'vf_inval'], ['TEXTURE_CACHE_INVALIDATE', 'tex_inval'], ['INST_CACHE_INVALIDATE', 'ic_inval'], ['STALL_AT_SCOREBOARD', 'pb_stall'], ['DEPTH_STALL', 'depth_stall'], ['CS_STALL', 'cs_stall']] begin_end_tp('stall', tp_args=[ArgStruct(type='uint32_t', var='flags'), ArgStruct(type='intel_ds_stall_cb_t', var='decode_cb'), ArgStruct(type='const char *', var='reason'),], tp_struct=[Arg(type='uint32_t', name='flags', var='decode_cb(flags)', c_format='0x%x'), Arg(type='const char *', name='reason', var='reason', c_format='%s'),], tp_print=stall_args(stall_flags), end_pipelined=False)
from u_trace import TracepointArg as Arg from u_trace import TracepointArgStruct as ArgStruct from u_trace import utrace_generate # # Tracepoint definitions: # Header('pipe/p_state.h') Header('util/format/u_format.h') Tracepoint( 'surface', args=[ArgStruct(type='const struct pipe_surface *', var='psurf')], tp_struct=[ Arg(type='uint16_t', name='width', var='psurf->width', c_format='%u'), Arg(type='uint16_t', name='height', var='psurf->height', c_format='%u'), Arg(type='uint8_t', name='nr_samples', var='psurf->nr_samples', c_format='%u'), Arg(type='const char *', name='format', var='util_format_short_name(psurf->format)', c_format='%s') ], tp_print=[ '%ux%u@%u, fmt=%s', '__entry->width', '__entry->height', '__entry->nr_samples', '__entry->format' ],