First, prepare the tracepoint provider header: This provides a tracepoint declaration in which you can specify the tracepoint provider (TP) name, arguments, payload variable types, fields and expressions. Refer to the lttng-ust man page for detailed field types that you can use. Some examples are ctf_integer, ctf_float and ctf_string. The TRACEPOINT_ EVENT macro sets everything up for you once you specify the arguments. We can create this header for our tracepoint and name it as thttpd_tp_provider.h
Insert the tracepoint functions inside the handle_ newconnect() body. I choose to put it in such a way as to keep track of the http_conn_count while I trace.