tracers-codegen 0.1.0

Contains the compile-time code generation logic which powers the `probe` and `tracers` macros. Do not use this crate directly; see "tracers" for more information.
Documentation
/** This file automatically generated by {{env!("CARGO_PKG_NAME")}} {{env!("CARGO_PKG_VERSION")}}.  Do not edit
 * this file.
 *
 * This file contains native wrappers for the probes defined in trait {{spec.ident()}}.
 *
 * The source code for that trait is:
 *
 * ```rust
 * {{spec.token_stream().to_string()}}
 * ```
 */
#define _SDT_HAS_SEMAPHORES 1


#define STAP_HAS_SEMAPHORES 1 /* deprecated */

{% include "sys_sdt.h" %}

/* The C-callable wrapper functions which the Rust bindings will invoke in order to fire the probes */
extern "C" {
{% for probe_spec in spec.probes() %}

    /* A C function which fires the {{spec.name()}} probe {{probe_spec.name}} */
    void {{spec.name_with_hash()}}_{{probe_spec.name}}(
	{%for arg in probe_spec.args %}{{ arg.arg_type_info().get_c_type_str() }} {{ arg.name() }}{% if !loop.last %}, {% endif %}{%endfor%}
    ) {
	STAP_PROBE{% if probe_spec.args.len() > 0 %}{{ probe_spec.args.len() }}{% endif %}(
	    {{ spec.name() }},
	    {{ probe_spec.name }}
	    {% for arg in probe_spec.args %}, {{ arg.name() }}{%endfor%}
	);
    }

    /* The semaphore which will be incremented if the probe is enabled */
    __extension__ unsigned short {{spec.name()}}_{{probe_spec.name}}_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes"))) __attribute__ ((visibility ("hidden")));

{% endfor %}
}