disable generation of lttng tracepoints if no tracing feature set

Signed-off-by: Fabrizio <fab@pop-os.localdomain>
This commit is contained in:
Fabrizio 2023-06-04 09:36:26 +02:00
parent 7550842126
commit 36d3ce3a09
3 changed files with 351 additions and 681 deletions

1019
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -1,9 +1,11 @@
use std::env; use std::env;
use std::path::PathBuf; use std::path::PathBuf;
#[cfg(feature = "tracing")]
use lttng_ust_generate::{Provider, Generator, CTFType, CIntegerType}; use lttng_ust_generate::{Provider, Generator, CTFType, CIntegerType};
fn main() { #[cfg(feature = "tracing")]
fn setup_tracepoints() {
// the provider is called calendar // the provider is called calendar
let mut provider = Provider::new("calendar"); let mut provider = Provider::new("calendar");
@ -23,3 +25,8 @@ fn main() {
.generate() .generate()
.expect("Unable to generate tracepoint bindings"); .expect("Unable to generate tracepoint bindings");
} }
fn main() {
#[cfg(feature = "tracing")]
setup_tracepoints();
}