summaryrefslogtreecommitdiff
path: root/libatrace_rust
AgeCommit message (Collapse)Author
2023-10-24Allow libatrace_tracing_subscriber on hostNikita Putikhin
Useful for projects that include it but need to be buildable on host. Test: compiles Bug: 305648381 Change-Id: If742cd84ab20cc02331743d65b6fa03b504fb067
2023-09-18Document the tracing subscriber usage in README.md, better sample initNikita Putikhin
Test: manually collect a trace Bug: 293435349 Change-Id: Iccc7ab4592bde9d8f272ea63f45be86209fb774e
2023-09-15Speed up the subscriberNikita Putikhin
Better string handling, avoiding work where possible, new filter mode to optimize the case when the subscriber is the only layer. Bug: 293435349 Test: atest Test: benchmark Test: manually ran the sample and captured a trace Change-Id: I05ede25daaadb109cffae2ad7658d4fab58b4b5d
2023-09-14Move making the vector out of benchmark iterNikita Putikhin
The difference is within normal noise levels but it's a bit neater. Bug: 293435349 Test: run benchmark Change-Id: If46ceaa00a0c57942553e4710a2e8fbc366edefb
2023-09-11Add a benchmark for the tracing subscriberNikita Putikhin
Measure the times so that we can optimize them. Bug: 293435349 Test: Run benchmarks on aosp_cf_x86_64_phone Change-Id: I2f5c23254533a92d122fab35f18bdbf4cafb19b2
2023-09-11Add tracing subscriber for ATraceNikita Putikhin
A simple subscriber that forwards calls to ATrace. It is not optimized, the purpose of this implementation is to have a working starting point to test and benchmark. Tests follow the same pattern as the main libatrace_rust but we had to copy the global mock helpers because the mocked methods are different. Bug: 293435349 Test: atest Test: manually uploaded and captured a trace Change-Id: Ibce802ec28159366d5d58550b105e9cd9546fded
2023-07-31Add safety comments.Andrew Walbran
These will soon be required by a lint. Bug: 290018030 Test: m rust Change-Id: I4a2c338909c8f25e3727edc9a8ce61ae1a7e7ea3
2023-07-26Add readme and owners, improve commentsNikita Putikhin
Finishing touches before the library is more or less ready to use. Bug: 289989828 Test: atrace Test: Manually collected trace Change-Id: I0186bbff1417fefde8056a9e8e39055988d1875a
2023-07-25Add a macro to instrument the calling methodNikita Putikhin
Bug: 289989828 Test: atest Test: Manually collected trace Change-Id: I821cd5a2cb4f19c7519085dd74f359095a1cb052
2023-07-24Add scoped eventNikita Putikhin
Scoped events are more convenient and less error-prone than beginning and ending events manually. Bug: 289989828 Test: atest Test: Manually collected trace Change-Id: I9078e326c7868af30f1a2b60eedcdb82778dc653
2023-07-24Wrap instant events and countersNikita Putikhin
These are the last remaining methods from ATrace to add. Bug: 289989828 Test: atest Test: Manually collected trace Change-Id: I95a1494a0109c84ef20fccc5c565332f5698c912
2023-07-24Wrap async ATrace eventsNikita Putikhin
Bug: 289989828 Test: atest Test: Manually collected trace Change-Id: I69e609d45c67a9a7e07e98f282339a1759577751
2023-07-24Wrap atrace utility methodsNikita Putikhin
Bug: 289989828 Test: atest Test: Manually collected trace Change-Id: Ie893ae8c3c82a3020a752e4a2fbfeac0dd018e87
2023-07-21Don't call wrapped atrace_begin if tag is disabledNikita Putikhin
Gating the binding call on tag status lets us avoid constructing CString and spending a lot of time when tracing is disabled. We'll use this optimization when adding other wrapper methods that accept strings. Change of atrace_begin time with tracing off: 100 ns -> 6 ns Test: atest Test: Manually run libatrace_rust_benchmark Test: Manually run libatrace_rust_example and collect a trace with Perfetto. Bug: 289989828 Change-Id: Id73cdfa887da9b5d2142154d3be5f88872108675
2023-07-21Add the rest of static inline function wrappersNikita Putikhin
Will be used for Rust bindings. Test: Manually run libatrace_rust_example and collect a trace with Perfetto. Bug: 289989828 Change-Id: I08951eec445b91a4e451164957a5e6bd2f00bb6c
2023-07-19Add a benchmark for libatrace_rustNikita Putikhin
The benchmark gives us data on relative performance of API wrappers vs calling the API directly. Right now it shows big overhead on atrace_begin with tracing disabled. This is expected - we always allocate a CString which is ignored if tracing is off. The perf issue will be fixed in the next commit. Bug: 289989828 Test: Run benchmarks on aosp_cf_x86_64_phone Change-Id: I25868b7724f70ac875ec1e8cbfb192e16cc7087c
2023-07-17Add Rust ATrace libraryNikita Putikhin
The new library is a wrapper over bindings to cutils. This commit establishes the basic structure of the library. To make the review smaller we only wrap two functions for now - atrace_begin and atrace_end. These functions are not optimized yet and instead use the simplest possible implementaiton. Future commits will improve the performance and add the rest of the API. Bug: 289989828 Test: atest Test: Manually run libatrace_rust_example and collect a trace with Perfetto. Change-Id: I323fe300aeeab9343a5d25f993cd989be0059d80