[PATCH v3 12/15] Write tracepoint definition in CTF and read.

Doug Evans dje@google.com
Thu Mar 14 18:34:00 GMT 2013


Yao Qi writes:
 > This patch teaches GDB to write uploaded tracepoints to CTF, and also
 > read them out from CTF.
 > 
 > gdb:
 > 
 > 2013-03-08  Yao Qi  <yao@codesourcery.com>
 > 
 > 	* ctf.c (CTF_EVENT_ID_TP_DEF): New macro.
 > 	ctf_write_header): Define event type "tp_def" in metadata.
 > 	(ctf_write_uploaded_tp): Write tracepoint definition to CTF.
 > 	(SET_ARRAY_FIELD, SET_STRING_FIELD): New macros.
 > 	(ctf_read_tp): New.
 > 	(ctf_open): Call ctf_read_tp.  Adjust the event id checking.
 > 	Call merge_uploaded_tracepoints.
 >[...]
 > @@ -371,6 +375,34 @@ ctf_write_header (struct trace_file_writer *self)
 >  			  "\t};\n"
 >  			  "};\n", CTF_EVENT_ID_TSV_DEF);
 >  
 > +  ctf_save_write_metadata (&writer->tcs, "\n");
 > +  ctf_save_write_metadata (&writer->tcs,
 > +			   "event {\n\tname = \"tp_def\";\n"
 > +			   "\tid = %u;\n\tfields := struct { \n"
 > +			   "\t\tuint64_t addr;\n"
 > +			   "\t\tuint64_t traceframe_usage;\n"
 > +			   "\t\tint32_t number;\n"
 > +			   "\t\tint32_t enabled;\n"
 > +			   "\t\tint32_t step;\n"
 > +			   "\t\tint32_t pass;\n"
 > +			   "\t\tint32_t hit_count;\n"
 > +			   "\t\tint32_t type;\n"
 > +			   "\t\tchars cond;\n"
 > +
 > +			  "\t\tuint32_t action_num;\n"
 > +			  "\t\tchars actions[action_num];\n"
 > +
 > +			  "\t\tuint32_t step_action_num;\n"
 > +			  "\t\tchars step_actions[step_action_num];\n"
 > +
 > +			  "\t\tchars at_string;\n"
 > +			  "\t\tchars cond_string;\n"
 > +
 > +			  "\t\tuint32_t cmd_num;\n"
 > +			  "\t\tchars cmd_strings[cmd_num];\n"
 > +			  "\t};\n"
 > +			  "};\n", CTF_EVENT_ID_TP_DEF);

Nit: CTF_EVENT_ID_TP_DEF is a lonnggg way from the %u that uses it.
Split into two pieces?



More information about the Gdb-patches mailing list