crosvm/perfetto
Noah Gold 81fdd8c7dd perfetto: minor build fixes.
* Requiring documentation for all public functions is a little too broad
(it covers the auto-gen'ed bindings too, which we don't want). This CL
removes the requirement.
* Minor issues in the hashing implemention using the sha2 crate were
  fixed.
* Fixed dependency issues.
* Switch to std::ffi::c_char since this differs by platform.
* Fix clippy errors.

TEST=builds
BUG=none

Change-Id: I0757a1efa17af225d01a636c611e4ca517825632
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4522874
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Noah Gold <nkgold@google.com>
2023-05-16 22:30:45 +00:00
..
src perfetto: minor build fixes. 2023-05-16 22:30:45 +00:00
build.rs Upstream the perfetto crate. 2023-05-11 18:12:36 +00:00
Cargo.toml perfetto: minor build fixes. 2023-05-16 22:30:45 +00:00
README.md Upstream the perfetto crate. 2023-05-11 18:12:36 +00:00

Perfetto Rust wrapper

The following instructions are based on tools/impl/bindgen-common.sh

When the Perfetto C API is updated, in order to regenerate the bindings:

  1. Download the bindgen cmdline tool.
  2. Run the bindgen command. If you are in crosvm:
    $ bindgen third_party/perfetto/include/perfetto/tracing/ctrace.h --disable-header-comment --no-layout-tests --no-doc-comments --with-derive-default --size_t-is-usize -o ./perfetto/src/bindings.rs
    
  3. Add the following to the top of the new bindings.rs file:
    #![allow(clippy::missing_safety_doc)]
    #![allow(clippy::upper_case_acronyms)]
    #![allow(non_upper_case_globals)]
    #![allow(non_camel_case_types)]
    #![allow(non_snake_case)]
    #![allow(dead_code)]
    
  4. Finally, add a copyright header to the bindings.