Tra­ce­point dec­la­ra­tion

OpenSource For You - - DEVELOPERS -

First, pre­pare the tra­ce­point provider header: This pro­vides a tra­ce­point dec­la­ra­tion in which you can spec­ify the tra­ce­point provider (TP) name, ar­gu­ments, pay­load vari­able types, fields and ex­pres­sions. Re­fer to the lttng-ust man page for de­tailed field types that you can use. Some ex­am­ples are ct­f_in­te­ger, ct­f_float and ct­f_string. The TRACEPOINT_ EVENT macro sets ev­ery­thing up for you once you spec­ify the ar­gu­ments. We can cre­ate this header for our tra­ce­point and name it as thttpd_t­p_provider.h

Insert the tra­ce­point func­tions in­side the han­dle_ new­con­nect() body. I choose to put it in such a way as to keep track of the http_­con­n_­count while I trace.

Newspapers in English

Newspapers from India

© PressReader. All rights reserved.