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

@ -14,4 +14,4 @@ chrono = "0.4"
lttng-ust = { version = "0.1.0", optional = true }
[build-dependencies]
lttng-ust-generate = "0.1.0"
lttng-ust-generate = "0.1.0"

View File

@ -1,9 +1,11 @@
use std::env;
use std::path::PathBuf;
#[cfg(feature = "tracing")]
use lttng_ust_generate::{Provider, Generator, CTFType, CIntegerType};
fn main() {
#[cfg(feature = "tracing")]
fn setup_tracepoints() {
// the provider is called calendar
let mut provider = Provider::new("calendar");
@ -22,4 +24,9 @@ fn main() {
.output_file_name(PathBuf::from(env::var("OUT_DIR").unwrap()).join("tracepoints.rs"))
.generate()
.expect("Unable to generate tracepoint bindings");
}
}
fn main() {
#[cfg(feature = "tracing")]
setup_tracepoints();
}