Analyzers
Talk to fellow users of Intel Analyzer tools (Intel VTune™ Profiler, Intel Advisor)
5002 Discussions

Is "Anomaly Detection Analysis" supported under Rust?

Violin
Beginner
306 Views

(Title)

Used Intel VTune™ Profiler, and after sampling there doesn't seem to be any code regions to inspect.

Here the sample code I used to test with.

If it fails to compile, add

".allowlist_function("__itt.*")"

To "ittapi/rust/ittapi-sys/tests/bindgen-up-to-date.rs" the "test_ittnotify_bindings_up_to_date" function and regenerate the bindings as documented in the README.

 

 

 

use std::ffi::CString;

extern crate ittapi_sys;
use ittapi_sys::{__itt_mark_pt_region_begin, __itt_mark_pt_region_end};

pub fn fibonacci_reccursive(n: i32) -> u64 {
if n < 0 {
panic!("{} is negative!", n);
}
match n {
0 => panic!("zero is not a right argument to fibonacci_reccursive()!"),
1 | 2 => 1,
3 => 2,
/*
50 => 12586269025,
*/
_ => fibonacci_reccursive(n - 1) + fibonacci_reccursive(n - 2),
}
}
fn main() {
let region = unsafe { ittapi_sys::__itt_pt_region_create_ptr__3_0.unwrap()(CString::new("test-domain").unwrap().into_raw()) };
unsafe { __itt_mark_pt_region_begin(region) };

fibonacci_reccursive(2);

unsafe { __itt_mark_pt_region_end(region) };
}

 

 

Labels (1)
0 Kudos
1 Reply
yuzhang3_intel
Moderator
235 Views

Yes, VTune supports ITT API Rust profiling.

 

But we currently have an issue with supporting of the __itt_mark_pt_region_begin/end ITT APIs that you mentioned in the sample code (link to the open issue: https://github.com/intel/ittapi/issues/139).

 

We are working on the problem and it should be resolved in the next release.

0 Kudos
Reply