€•xRŒsphinx.addnodes”Œdocument”“”)”}”(Œ rawsource”Œ”Œchildren”]”(Œ translations”Œ LanguagesNode”“”)”}”(hhh]”(hŒ pending_xref”“”)”}”(hhh]”Œdocutils.nodes”ŒText”“”ŒChinese (Simplified)”…””}”Œparent”hsbaŒ attributes”}”(Œids”]”Œclasses”]”Œnames”]”Œdupnames”]”Œbackrefs”]”Œ refdomain”Œstd”Œreftype”Œdoc”Œ reftarget”Œ7/translations/zh_CN/trace/rv/da_monitor_instrumentation”Œmodname”NŒ classname”NŒ refexplicit”ˆuŒtagname”hhh ubh)”}”(hhh]”hŒChinese (Traditional)”…””}”hh2sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ7/translations/zh_TW/trace/rv/da_monitor_instrumentation”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒItalian”…””}”hhFsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ7/translations/it_IT/trace/rv/da_monitor_instrumentation”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒJapanese”…””}”hhZsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ7/translations/ja_JP/trace/rv/da_monitor_instrumentation”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒKorean”…””}”hhnsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ7/translations/ko_KR/trace/rv/da_monitor_instrumentation”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒPortuguese (Brazilian)”…””}”hh‚sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ7/translations/pt_BR/trace/rv/da_monitor_instrumentation”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒSpanish”…””}”hh–sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ7/translations/sp_SP/trace/rv/da_monitor_instrumentation”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubeh}”(h]”h ]”h"]”h$]”h&]”Œcurrent_language”ŒEnglish”uh1h hhŒ _document”hŒsource”NŒline”NubhŒsection”“”)”}”(hhh]”(hŒtitle”“”)”}”(hŒ&Deterministic Automata Instrumentation”h]”hŒ&Deterministic Automata Instrumentation”…””}”(hh¼h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhh·h²hh³ŒQ/var/lib/git/docbuild/linux/Documentation/trace/rv/da_monitor_instrumentation.rst”h´KubhŒ paragraph”“”)”}”(hŒtThe RV monitor file created by dot2k, with the name "$MODEL_NAME.c" includes a section dedicated to instrumentation.”h]”hŒxThe RV monitor file created by dot2k, with the name “$MODEL_NAME.c†includes a section dedicated to instrumentation.”…””}”(hhÍh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Khh·h²hubhÌ)”}”(hŒIIn the example of the wip.dot monitor created on [1], it will look like::”h]”hŒHIn the example of the wip.dot monitor created on [1], it will look like:”…””}”(hhÛh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Khh·h²hubhŒ literal_block”“”)”}”(hX®/* * This is the instrumentation part of the monitor. * * This is the section where manual work is required. Here the kernel events * are translated into model's event. * */ static void handle_preempt_disable(void *data, /* XXX: fill header */) { da_handle_event_wip(preempt_disable_wip); } static void handle_preempt_enable(void *data, /* XXX: fill header */) { da_handle_event_wip(preempt_enable_wip); } static void handle_sched_waking(void *data, /* XXX: fill header */) { da_handle_event_wip(sched_waking_wip); } static int enable_wip(void) { int retval; retval = da_monitor_init_wip(); if (retval) return retval; rv_attach_trace_probe("wip", /* XXX: tracepoint */, handle_preempt_disable); rv_attach_trace_probe("wip", /* XXX: tracepoint */, handle_preempt_enable); rv_attach_trace_probe("wip", /* XXX: tracepoint */, handle_sched_waking); return 0; }”h]”hX®/* * This is the instrumentation part of the monitor. * * This is the section where manual work is required. Here the kernel events * are translated into model's event. * */ static void handle_preempt_disable(void *data, /* XXX: fill header */) { da_handle_event_wip(preempt_disable_wip); } static void handle_preempt_enable(void *data, /* XXX: fill header */) { da_handle_event_wip(preempt_enable_wip); } static void handle_sched_waking(void *data, /* XXX: fill header */) { da_handle_event_wip(sched_waking_wip); } static int enable_wip(void) { int retval; retval = da_monitor_init_wip(); if (retval) return retval; rv_attach_trace_probe("wip", /* XXX: tracepoint */, handle_preempt_disable); rv_attach_trace_probe("wip", /* XXX: tracepoint */, handle_preempt_enable); rv_attach_trace_probe("wip", /* XXX: tracepoint */, handle_sched_waking); return 0; }”…””}”hhësbah}”(h]”h ]”h"]”h$]”h&]”Œ xml:space”Œpreserve”uh1héh³hÊh´K hh·h²hubhÌ)”}”(hŒ‘The comment at the top of the section explains the general idea: the instrumentation section translates *kernel events* into the *model's event*.”h]”(hŒhThe comment at the top of the section explains the general idea: the instrumentation section translates ”…””}”(hhûh²hh³Nh´NubhŒemphasis”“”)”}”(hŒ*kernel events*”h]”hŒ kernel events”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jhhûubhŒ into the ”…””}”(hhûh²hh³Nh´Nubj)”}”(hŒ*model's event*”h]”hŒmodel’s event”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jhhûubhŒ.”…””}”(hhûh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K.hh·h²hubh¶)”}”(hhh]”(h»)”}”(hŒTracing callback functions”h]”hŒTracing callback functions”…””}”(hj2h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhj/h²hh³hÊh´K3ubhÌ)”}”(hŒÙThe first three functions are the starting point of the callback *handler functions* for each of the three events from the wip model. The developer does not necessarily need to use them: they are just starting points.”h]”(hŒAThe first three functions are the starting point of the callback ”…””}”(hj@h²hh³Nh´Nubj)”}”(hŒ*handler functions*”h]”hŒhandler functions”…””}”(hjHh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj@ubhŒ… for each of the three events from the wip model. The developer does not necessarily need to use them: they are just starting points.”…””}”(hj@h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K5hj/h²hubhÌ)”}”(hŒUsing the example of::”h]”hŒUsing the example of:”…””}”(hj`h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K9hj/h²hubhê)”}”(hŒtvoid handle_preempt_disable(void *data, /* XXX: fill header */) { da_handle_event_wip(preempt_disable_wip); }”h]”hŒtvoid handle_preempt_disable(void *data, /* XXX: fill header */) { da_handle_event_wip(preempt_disable_wip); }”…””}”hjnsbah}”(h]”h ]”h"]”h$]”h&]”hùhúuh1héh³hÊh´K;hj/h²hubhÌ)”}”(hŒÈThe preempt_disable event from the model connects directly to the preemptirq:preempt_disable. The preemptirq:preempt_disable event has the following signature, from include/trace/events/preemptirq.h::”h]”hŒÇThe preempt_disable event from the model connects directly to the preemptirq:preempt_disable. The preemptirq:preempt_disable event has the following signature, from include/trace/events/preemptirq.h:”…””}”(hj|h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K@hj/h²hubhê)”}”(hŒ3TP_PROTO(unsigned long ip, unsigned long parent_ip)”h]”hŒ3TP_PROTO(unsigned long ip, unsigned long parent_ip)”…””}”hjŠsbah}”(h]”h ]”h"]”h$]”h&]”hùhúuh1héh³hÊh´KDhj/h²hubhÌ)”}”(hŒ=Hence, the handle_preempt_disable() function will look like::”h]”hŒ