use std::env; use std::path::PathBuf; use lttng_ust_generate::{Provider, Generator, CTFType, CIntegerType}; fn main() { // the provider is called calendar let mut provider = Provider::new("calendar"); // class for drawing events let draw_class = provider.create_class("draw") .add_field("width", CTFType::Integer(CIntegerType::I32)) .add_field("height", CTFType::Integer(CIntegerType::I32)); // drawing events draw_class.instantiate("draw_entry"); draw_class.instantiate("draw_exit"); Generator::default() .generated_lib_name("calendar_tracepoints") .register_provider(provider) .output_file_name(PathBuf::from(env::var("OUT_DIR").unwrap()).join("tracepoints.rs")) .generate() .expect("Unable to generate tracepoint bindings"); }