aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
5 daysSnap for 11878282 from 1e390fa8dcbd6224667bec30e8a064ef2cf3c915 to sdk-releasesdk-releaseAndroid Build Coastguard Worker
Change-Id: I89ee8b33d0dedc24ea561465dddcd17aebabf2a2
6 daysSnap for 11871564 from e100785b1b6408fa0386f5b4d866116dad149575 to sdk-releaseAndroid Build Coastguard Worker
Change-Id: I69352c43c8f8a5ae717d7301c7164ddbf99823fd
7 daysRework memory allocation with free policyHEADmastermainAlessio Balsini
The memory allocation function was allocating a number of bytes in the heap, traversing all of them page by page to make sure all the addresses were mapped with physical pages, and the memory released with the destructor. While the memory is allocated, there is no way of knowing if the kernel swaps it out. To remove this level of uncertainty, instead of overcoming the lazy page allocation manually, ask the kernel to allocate a resident memory region for us. In addition to that, let the user decide at what stages of the instruction the memory should be freed: 1. like before, until the destructor; 2. after every execution; 3. after the last "repeat". Test: inspection with Perfetto Bug: 339590280 Change-Id: If139971222af56ad3f5aaf2f96d09122a27f8259 Signed-off-by: Alessio Balsini <balsini@google.com>
7 daysAdd offset_us parameter to delay repeated instructionAlessio Balsini
Instead of running instructions as soon as possible, create a delay on the first execution of a repeated execution. A repeated instruction is able to reiterate every period_us, but the timeline can be shifted with the newly introduced parameter offset_us. Test: Trace evaluation with Perfetto shows that the first execution is delayed Bug: 339590280 Change-Id: I33fed7a361e75b8aba8b54466cb485ff85618e13 Signed-off-by: Alessio Balsini <balsini@google.com>
13 daysRename next_awake_time_ in next_wakeup_Alessio Balsini
This is just a cosmetic name change. Test: build Bug: 339590280 Change-Id: I9c5971dfd1acf1a5c3c6a4e1f41fe3265a7d4c1c Signed-off-by: Alessio Balsini <balsini@google.com>
13 daysUpdate log format and add datetimeAlessio Balsini
Timing is important in Ditto, and the logger should be helpful when identifying timing issues. This patch extends the logger with date and time. In addition, it attemps to improve the log visibility with the following format: [DATE/TIME] LOGLEVEL FILE/LINE ERROR [ERRNO] Test: visual inspection Bug: 339590280 Change-Id: I568171cf322a813dbcee1176e4b19644e6b9b8e7 Signed-off-by: Alessio Balsini <balsini@google.com>
2024-04-09Snap for 11692525 from b1e80e259a89e48487b712f0098661a09869b787 to sdk-releaseAndroid Build Coastguard Worker
Change-Id: I7fb8d52c048355d4bf4c5e7f1d8661358fce4cf1
2024-04-04Merge "Add support for nested parcel" into mainParth Sane
2024-03-28Add support for nested parcelParth Sane
Test: example/android/binder_nested_parcel.ditto Bug: 323841271 Change-Id: I4cba1f58f0d8a5fd5c834aa42dc01621f7e1a7d0
2024-03-26Snap for 11630439 from 2ec354024a508eebc43c078d5339da6833b2ea5e to sdk-releaseAndroid Build Coastguard Worker
Change-Id: I59349f215adebdb8ba59408df45c7dd673be5745
2024-03-21Merge "Use name instead of instruction id for spawned tasks" into mainTreehugger Robot
2024-03-19Snap for 11598262 from 8e8906f6945c022de9056bc6c84bbf2294261074 to sdk-releaseAndroid Build Coastguard Worker
Change-Id: Icaec33861fe68acfb7cfe341d5044982b43d0b36
2024-03-15Fix incompatibility with Protobuf 22.x.Krzysztof Kosiński
In version 22.x, the JSON conversion functions return absl::Status, which is marked nodiscard. Check the ok() function before printing the output. Bug: 329747255 Test: presubmit Change-Id: I46e2f20a26953dc6501f51daecc1a56547a326ab
2024-03-12Snap for 11566117 from e8cea65741e47490bed5987aeb9d26fb25118821 to sdk-releaseplatform-tools-35.0.1Android Build Coastguard Worker
Change-Id: I62f021447725e08a8ab65213568fbb5a4447d254
2024-03-12Use name instead of instruction id for spawned tasksAlessio Balsini
When printing the benchmarking results, instead of reporting the process/thraed name, Dittobench was only printing the numerical identifier of the process/thread. This was enough to distinguish the instructions run from one process/thread to another, but not enough to understand what process/thread called them. Additionally, this numerical value was only referring to the id of the "spawned" processes, so if multiple threads were generated manually, and each of them was using the default "spawn" value of 1, their reported instruction identifier would have been "0". Fix by using the thread name if available, otherwise the instruction number. Test: manual check Change-Id: If3cfbf705dd242f78a51cec995381d964872217f Signed-off-by: Alessio Balsini <balsini@google.com>
2024-03-12Fix missing mean valueAlessio Balsini
For benchmarks that spawn multiple processes, the returned aggregated data was lacking the mean value. This was due to the mean value correctly exported by the child process, but mistakenly not copied into the parent. This patch fixes this issue. Test: manual execution of a multiprocessing workload Change-Id: If643932a88c95ae41145c58badfef4a61bfe1d71 Signed-off-by: Alessio Balsini <balsini@google.com>
2024-03-07Snap for 11541002 from f49a1949a48863babbba66081096fdc39d298502 to sdk-releaseAndroid Build Coastguard Worker
Change-Id: I072e1d1c834b2e50902a406a19da62278b217d0b
2024-03-06Merge changes Ibb906796,I2e980637,I05ca8ffb into mainAlessio Balsini
* changes: Update protobuf header include path Move gettid and sched_setattr to Syscall interface Move SchedAttr__ to syscall
2024-03-05Update protobuf header include pathAlessio Balsini
When building the project with Kleaf, the root path is different from the Dittosuite root, causing the protobuffer-generated headers to not be found in the expected folder. After several attemps, the simplest solution that unifies Android.bp, CMake and Bazel is to explicitly include the PB directory "schema". This works for both CMake and Bazel, and is also what was is done by Android by default. The `#ifdef __ANDROID__` condition to choose if including `<benchmark.pb.h>` or `"schema/benchmark.pb.h"` is not needed anymore, as `<benchmark.pb.h>` now works in both cases. Bug: 322744630 Test: bazel build --enable_bzlmod --config=internet \ //test/dittosuite:dittobench # From common-android-mainline Change-Id: Ibb90679689178169add35c866c4935f30686ccc0 Signed-off-by: Alessio Balsini <balsini@google.com>
2024-03-05Move gettid and sched_setattr to Syscall interfaceAlessio Balsini
Moving function calls that are strictly depending on the platform into an external redirection that complies to the SyscallInterface interface is a design pattern that should have been always followed. Not complying to this design pattern can cause issues, for example when building the tool with Kleaf, whose build environment does not support some of the latest syscalls. Fix by moving these function calls into the Syscall interface and implementing them in a more baremetal fashion. Bug: 322744630 Test: build, run on Android Change-Id: I2e9806373868fadd54f9d500346aaab424e34539 Signed-off-by: Alessio Balsini <balsini@google.com>
2024-03-04Move SchedAttr__ to syscallAlessio Balsini
As part of a refactoring required to implement functions not yet available in the libraries provided by Kleaf's sysroot, move the data structure that mimicks sched_attr in sched/types.h into the syscall-related code. Test: build Bug: 322744630 Change-Id: I05ca8ffb2ef36b29708dfc0340635fb2c2162037 Signed-off-by: Alessio Balsini <balsini@google.com>
2024-02-21Snap for 11473990 from 40b07b8734e1c472db5e9ea7a43c9f0fb05bb814 to sdk-releaseAndroid Build Coastguard Worker
Change-Id: Ifb5813c7e3ba50dfefb5d9203f8475628f9a6e8f
2024-02-15Merge "Add support for generic binder call to any service" into main am: ↵Parth Sane
40b07b8734 Original change: https://android-review.googlesource.com/c/platform/test/dittosuite/+/2950485 Change-Id: Ifacd947607ed8eee0b79f31686690da15574a5f1 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-02-15Merge "Add support for generic binder call to any service" into mainParth Sane
2024-02-14Add support for generic binder call to any serviceParth Sane
Intent support isn't complete yet Test: Pixel 7 with example/android/binder_gen.ditto Bug: 323841271 Change-Id: Ie7eb650b119ea120ea3935ec51ec28fc0b9dc8f1
2024-02-14Snap for 11445705 from 415067aab66812bc5efff1d11cf70559aeee50ce to sdk-releaseAndroid Build Coastguard Worker
Change-Id: I8a9b7c73e3262177b372c05c7e82c2726d65659d
2024-02-13Merge "Migrate Test Targets to New Android Ownership Model" into main am: ↵Treehugger Robot
415067aab6 Original change: https://android-review.googlesource.com/c/platform/test/dittosuite/+/2945340 Change-Id: I2b0841482e1e1edeb2f53c3e68eb90933f38008b Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-02-13Merge "Migrate Test Targets to New Android Ownership Model" into mainTreehugger Robot
2024-02-05Snap for 11406128 from 7b07e0cd8ca87b8221ee17220a0586f7a972c19d to sdk-releaseAndroid Build Coastguard Worker
Change-Id: I455a6f7e475ac9ceba4d215ff818b552f327d5b4
2024-02-05Add tests to Bazel build am: 7b07e0cd8cAlessio Balsini
Original change: https://android-review.googlesource.com/c/platform/test/dittosuite/+/2943527 Change-Id: I50492644a7884da0f41f1f20678245d36bbd3caf Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-02-05Refactor Logger test am: 4e34847ac3Alessio Balsini
Original change: https://android-review.googlesource.com/c/platform/test/dittosuite/+/2943526 Change-Id: I838ef26d36e6502d8279250ab6f38f2f6c30d638 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-02-05Introduce Bazel build am: fa62652ccbAlessio Balsini
Original change: https://android-review.googlesource.com/c/platform/test/dittosuite/+/2917386 Change-Id: I72fa7d8dc3d7dfc1dc567d62d45b1ccd63bc5a77 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-02-05Add tests to Bazel buildAlessio Balsini
Create the test target that groups all the tests in the project. Test: bazel test dittobench_test Bug: 322744630 Change-Id: Ic6e0ffc7ca8fbe88e7e73c0a0446e0d397982e3b Signed-off-by: Alessio Balsini <balsini@google.com>
2024-02-02Migrate Test Targets to New Android Ownership ModelAditya Choudhary
This CL is created as a best effort to migrate test targets to the new Android ownership model. It is based on historical data from repository history and insights from git blame. Given the nature of this effort, there may be instances of incorrect attribution. If you find incorrect or unnecessary attribution in this CL, please create a new CL to fix that. For detailed guidelines and further information on the migration please refer to the link below, go/new-android-ownership-model Bug: 304529413 Test: N/A Change-Id: I18358fe58a359c04a1755dd45c1f4407b9edd325
2024-02-01Refactor Logger testAlessio Balsini
Apply some good practices in unit testing, such as parameterized tests, and the arrange, act, assert structure. Test: test Bug: 322744630 Signed-off-by: Alessio Balsini <balsini@google.com> Change-Id: Id52a7c770b33fa623e8c07199a72ba9e6c7ef683
2024-02-01Introduce Bazel buildAlessio Balsini
Create all the build configuration to be able to build dittosuite with Bazel. The tricky part is the Protocol Buffer dependency, which is solved in the MODULE.bazel file. This works fine if the project is built standalone, but when imported as part of another Bazel project, the WORKSPACE dependency is not met, and the build fails. Test: bazel build :all Bug: 322744630 Change-Id: Icaeffb26b5251d1ff33755eb79af528cfb2c8d58 Signed-off-by: Alessio Balsini <balsini@google.com>
2024-01-10Snap for 11292864 from 42d8ea6bd9fff0fdb0e437fe52a19cdd39063d7b to sdk-releaseAndroid Build Coastguard Worker
Change-Id: I723cc8bb10aca74ec2f2d6afc5d0bb06f46dab04
2024-01-04Solve type conversion between char and int8_t am: 42d8ea6bd9 am: 2e93bbc65f ↵Alessio Balsini
am: 1b63359296 Original change: https://android-review.googlesource.com/c/platform/test/dittosuite/+/2897520 Change-Id: Ibc0252d237c0105f5da08b4612d2aabcfc9310f4 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-04Solve type conversion between char and int8_t am: 42d8ea6bd9 am: 2e93bbc65fAlessio Balsini
Original change: https://android-review.googlesource.com/c/platform/test/dittosuite/+/2897520 Change-Id: Ic92bdd7c85fd99f2364c7e63242c617d255d25e5 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-04Solve type conversion between char and int8_t am: 42d8ea6bd9Alessio Balsini
Original change: https://android-review.googlesource.com/c/platform/test/dittosuite/+/2897520 Change-Id: I4f66b7ceeb4bc85970bb511bc7b16a6eab8cf1de Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-04Solve type conversion between char and int8_tAlessio Balsini
Apparently, while in amd64 Cuttlefish the sync() DittoBinder transaction was working fine, in arm64 (tried in Pixel 7), some kind of type conversion is transforming a signed integer into an unsigned integer. This results in an error such as: dittosuite/src/binder_request.cpp:35: FATAL: Wrong result, expected: -2, but got: 254 Apparently changing char to int8_t in the requester code is enough to prevent this conversion. Test: Pixel 7 and CF: dittobench example/android/binder.ditto Bug: 318651715 Change-Id: Ic05d70d72419fef089287781c5eed8247bf05763 Signed-off-by: Alessio Balsini <balsini@google.com>
2023-12-13Snap for 11211409 from f11da82c82ace492a6a5760981392d2908ce5c6e to sdk-releaseAndroid Build Coastguard Worker
Change-Id: I4ce7baea23bb3da6486377e83e178e0f897e9b6f
2023-10-20Properly set process title am: 444ce0527c am: b52c55e87a am: 5a7dac7c42Alessio Balsini
Original change: https://android-review.googlesource.com/c/platform/test/dittosuite/+/2794733 Change-Id: I2f1b70955a4603975d04c068d0aaa08e2eded3f4 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-20Fix atrace event format am: 96690b8802 am: 0e9be3d15c am: a693e02fc9Alessio Balsini
Original change: https://android-review.googlesource.com/c/platform/test/dittosuite/+/2785983 Change-Id: Ie44cab6f3577ca8135d40a186336cb7c4a2ef819 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-20Introduce memory allocation instruction am: b762867192 am: 082acbbfa8 am: ↵Alessio Balsini
440b812810 Original change: https://android-review.googlesource.com/c/platform/test/dittosuite/+/2788472 Change-Id: Ie3fd0b71556b45d8683033f28f83b0ae4541015e Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-19Properly set process title am: 444ce0527c am: b52c55e87aAlessio Balsini
Original change: https://android-review.googlesource.com/c/platform/test/dittosuite/+/2794733 Change-Id: I5ce2be2d1c82918e656718c444768ade10d69ae3 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-19Fix atrace event format am: 96690b8802 am: 0e9be3d15cAlessio Balsini
Original change: https://android-review.googlesource.com/c/platform/test/dittosuite/+/2785983 Change-Id: I804b36512778002c5668f9b12993030a3fb84d6f Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-19Introduce memory allocation instruction am: b762867192 am: 082acbbfa8Alessio Balsini
Original change: https://android-review.googlesource.com/c/platform/test/dittosuite/+/2788472 Change-Id: I45406768acf84298ff322f78f8dcf8143dbfef95 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-19Snap for 10972066 from 444ce0527c8d2a3d737850abc2caf2f809688a0b to sdk-releaseAndroid Build Coastguard Worker
Change-Id: I08385af58fc145c1d4ab74cbdd1c6e9d1f164d18
2023-10-18Properly set process title am: 444ce0527c am: f11da82c82 am: 35e5436ba4Alessio Balsini
Original change: https://android-review.googlesource.com/c/platform/test/dittosuite/+/2794733 Change-Id: Iaa891e317d3dc2b2a17adacc9da451bbde1432d5 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>