rust: add support for Intel PT regions (#140)

* rust: add `__itt*` functions in generated bindings

This change adds some bindgen-generated functions, and not just
variables, to the generated bindings. This should resolve #139 by making
the `pt_region_*` functions at least visibile in the `ittapi-sys` crate,
making it possible to add higher-level Rust versions.

We cannot generate bindings for all declared functions because these
cause link errors: they are only present in the dynamic library (`*.so`)
but not in the static library (`libittnotify.a`) that the `ittapi-sys`
crate links to. So, for these dynamically-provided functions we must
just retain the `*_ptr__3_0` data symbols and wait for them to be
resolved to functions pointers at runtime.

* rust: remove unused code

* rust: document static/dynamic linking in `README.md`

It is easy to forget how the `ittapi` system of static + dynamic linking
works (and why!). To answer the underlying question of issues like #139,
this change adds some `README.md` documentation explaining why we can't
just include all function symbols in the generated bindings.

* rust: add `Region` for marking Intel PT regions

In #139, @codecnotsupported pointed out a need for access to
`__itt_mark_pt_region_begin` and `__itt_mark_pt_region_end` for
fine-grained VTune analysis using Intel PT. This change adds a
high-level `Region` structure for easy access to these now-available
functions. Closes #139.
15 files changed
tree: 9213bffaf1d197d81ea094f6b690394a184f4444
  1. .github/
  2. cmake/
  3. include/
  4. LICENSES/
  5. rust/
  6. src/
  7. .gitignore
  8. buildall.py
  9. CMakeLists.txt
  10. README.md
  11. SECURITY.md
README.md

IntelĀ® Instrumentation and Tracing Technology (ITT) and Just-In-Time (JIT) API

This ITT/JIT open source profiling API includes:

  • Instrumentation and Tracing Technology (ITT) API
  • Just-In-Time (JIT) Profiling API

The Instrumentation and Tracing Technology (ITT) API enables your application to generate and control the collection of trace data during its execution across different Intel tools.

ITT API consists of two parts: a static part and a dynamic part. The dynamic part is specific for a tool and distributed only with a particular tool. The static part is a common part shared between tools. Currently, the static part of ITT API is distributed as a static library and released under a BSD/GPLv2 dual license with every tool supporting ITT API.

Build

To build the library:

  • On Windows, Linux, FreeBSD and OSX: requires cmake to be set in PATH
  • Windows: requires Visual Studio installed or requires Ninja to be set in PATH
  • To list available build options execute: python buildall.py -h
usage: buildall.py [-h] [-d] [-c] [-v] [-pt] [--force_bits] [-ft]

optional arguments:
  -h, --help      show this help message and exit
  -d, --debug     specify debug build configuration (release by default)
  -c, --clean     delete any intermediate and output files
  -v, --verbose   enable verbose output from build process
  -pt, --ptmark   enable anomaly detection support
  --force_bits    specify bit version for the target
  -ft, --fortran  enable fortran support

License

All code in the repo is dual licensed under GPLv2 and 3-Clause BSD licenses

Security

Please refer to the security policy for reporting vulnerabilties.