Loading cmds/atrace/atrace_userdebug.rc +6 −0 Original line number Diff line number Diff line Loading @@ -5,6 +5,12 @@ # Access control to these files is now entirely in selinux policy. on post-fs # On userdebug allow to enable any event via the generic # set_event interface: # echo sched/foo > set_event == echo 1 > events/sched/foo/enable. chmod 0666 /sys/kernel/tracing/set_event chmod 0666 /sys/kernel/debug/tracing/set_event chmod 0666 /sys/kernel/tracing/events/workqueue/enable chmod 0666 /sys/kernel/debug/tracing/events/workqueue/enable chmod 0666 /sys/kernel/tracing/events/regulator/enable Loading cmds/dumpstate/DumpstateService.cpp +15 −5 Original line number Diff line number Diff line Loading @@ -98,11 +98,10 @@ binder::Status DumpstateService::setListener(const std::string& name, return binder::Status::ok(); } binder::Status DumpstateService::startBugreport(const android::base::unique_fd& /* bugreportFd */, const android::base::unique_fd& /* screenshotFd */, binder::Status DumpstateService::startBugreport(const android::base::unique_fd& bugreport_fd, const android::base::unique_fd& screenshot_fd, int bugreport_mode, const sp<IDumpstateListener>& /* listener */) { // TODO(b/111441001): Pass in fds & other arguments to DumpOptions. const sp<IDumpstateListener>& listener) { MYLOGI("startBugreport() with mode: %d\n", bugreport_mode); if (bugreport_mode != Dumpstate::BugreportMode::BUGREPORT_FULL && Loading @@ -116,9 +115,20 @@ binder::Status DumpstateService::startBugreport(const android::base::unique_fd& StringPrintf("Invalid bugreport mode: %d", bugreport_mode)); } if (bugreport_fd.get() == -1 || screenshot_fd.get() == -1) { return exception(binder::Status::EX_ILLEGAL_ARGUMENT, "Invalid file descriptor"); } std::unique_ptr<Dumpstate::DumpOptions> options = std::make_unique<Dumpstate::DumpOptions>(); options->Initialize(static_cast<Dumpstate::BugreportMode>(bugreport_mode)); options->Initialize(static_cast<Dumpstate::BugreportMode>(bugreport_mode), bugreport_fd, screenshot_fd); std::lock_guard<std::mutex> lock(lock_); // TODO(b/111441001): Disallow multiple simultaneous bugreports. ds_.SetOptions(std::move(options)); if (listener != nullptr) { ds_.listener_ = listener; } pthread_t thread; status_t err = pthread_create(&thread, nullptr, callAndNotify, &ds_); Loading cmds/dumpstate/DumpstateService.h +2 −2 Original line number Diff line number Diff line Loading @@ -42,8 +42,8 @@ class DumpstateService : public BinderService<DumpstateService>, public BnDumpst bool getSectionDetails, sp<IDumpstateToken>* returned_token) override; binder::Status startBugreport(const android::base::unique_fd& bugreportFd, const android::base::unique_fd& screenshotFd, int bugreport_mode, binder::Status startBugreport(const android::base::unique_fd& bugreport_fd, const android::base::unique_fd& screenshot_fd, int bugreport_mode, const sp<IDumpstateListener>& listener) override; private: Loading cmds/dumpstate/binder/android/os/IDumpstate.aidl +2 −4 Original line number Diff line number Diff line Loading @@ -25,8 +25,6 @@ import android.os.DumpstateOptions; * {@hide} */ interface IDumpstate { // TODO: remove method once startBugReport is used by Shell. /* * Sets the listener for this dumpstate progress. Loading cmds/dumpstate/binder/android/os/IDumpstateListener.aidl +39 −9 Original line number Diff line number Diff line Loading @@ -22,11 +22,41 @@ package android.os; * {@hide} */ interface IDumpstateListener { /** * Called when there is a progress update. * * @param progress the progress in [0, 100] */ oneway void onProgress(int progress); /* Options specified are invalid or incompatible */ const int BUGREPORT_ERROR_INVALID_INPUT = 1; /* Bugreport encountered a runtime error */ const int BUGREPORT_ERROR_RUNTIME_ERROR = 2; /** * Called on an error condition with one of the error codes listed above. */ oneway void onError(int errorCode); /** * Called when taking bugreport finishes successfully * * @param durationMs time capturing bugreport took in milliseconds * @param title title for the bugreport; helpful in reminding the user why they took it * @param description detailed description for the bugreport */ oneway void onFinished(long durationMs, @utf8InCpp String title, @utf8InCpp String description); // TODO(b/111441001): Remove old methods when not used anymore. void onProgressUpdated(int progress); void onMaxProgressUpdated(int maxProgress); /** * Called after every section is complete. * * @param name section name * @param status values from status_t * {@code OK} section completed successfully Loading Loading
cmds/atrace/atrace_userdebug.rc +6 −0 Original line number Diff line number Diff line Loading @@ -5,6 +5,12 @@ # Access control to these files is now entirely in selinux policy. on post-fs # On userdebug allow to enable any event via the generic # set_event interface: # echo sched/foo > set_event == echo 1 > events/sched/foo/enable. chmod 0666 /sys/kernel/tracing/set_event chmod 0666 /sys/kernel/debug/tracing/set_event chmod 0666 /sys/kernel/tracing/events/workqueue/enable chmod 0666 /sys/kernel/debug/tracing/events/workqueue/enable chmod 0666 /sys/kernel/tracing/events/regulator/enable Loading
cmds/dumpstate/DumpstateService.cpp +15 −5 Original line number Diff line number Diff line Loading @@ -98,11 +98,10 @@ binder::Status DumpstateService::setListener(const std::string& name, return binder::Status::ok(); } binder::Status DumpstateService::startBugreport(const android::base::unique_fd& /* bugreportFd */, const android::base::unique_fd& /* screenshotFd */, binder::Status DumpstateService::startBugreport(const android::base::unique_fd& bugreport_fd, const android::base::unique_fd& screenshot_fd, int bugreport_mode, const sp<IDumpstateListener>& /* listener */) { // TODO(b/111441001): Pass in fds & other arguments to DumpOptions. const sp<IDumpstateListener>& listener) { MYLOGI("startBugreport() with mode: %d\n", bugreport_mode); if (bugreport_mode != Dumpstate::BugreportMode::BUGREPORT_FULL && Loading @@ -116,9 +115,20 @@ binder::Status DumpstateService::startBugreport(const android::base::unique_fd& StringPrintf("Invalid bugreport mode: %d", bugreport_mode)); } if (bugreport_fd.get() == -1 || screenshot_fd.get() == -1) { return exception(binder::Status::EX_ILLEGAL_ARGUMENT, "Invalid file descriptor"); } std::unique_ptr<Dumpstate::DumpOptions> options = std::make_unique<Dumpstate::DumpOptions>(); options->Initialize(static_cast<Dumpstate::BugreportMode>(bugreport_mode)); options->Initialize(static_cast<Dumpstate::BugreportMode>(bugreport_mode), bugreport_fd, screenshot_fd); std::lock_guard<std::mutex> lock(lock_); // TODO(b/111441001): Disallow multiple simultaneous bugreports. ds_.SetOptions(std::move(options)); if (listener != nullptr) { ds_.listener_ = listener; } pthread_t thread; status_t err = pthread_create(&thread, nullptr, callAndNotify, &ds_); Loading
cmds/dumpstate/DumpstateService.h +2 −2 Original line number Diff line number Diff line Loading @@ -42,8 +42,8 @@ class DumpstateService : public BinderService<DumpstateService>, public BnDumpst bool getSectionDetails, sp<IDumpstateToken>* returned_token) override; binder::Status startBugreport(const android::base::unique_fd& bugreportFd, const android::base::unique_fd& screenshotFd, int bugreport_mode, binder::Status startBugreport(const android::base::unique_fd& bugreport_fd, const android::base::unique_fd& screenshot_fd, int bugreport_mode, const sp<IDumpstateListener>& listener) override; private: Loading
cmds/dumpstate/binder/android/os/IDumpstate.aidl +2 −4 Original line number Diff line number Diff line Loading @@ -25,8 +25,6 @@ import android.os.DumpstateOptions; * {@hide} */ interface IDumpstate { // TODO: remove method once startBugReport is used by Shell. /* * Sets the listener for this dumpstate progress. Loading
cmds/dumpstate/binder/android/os/IDumpstateListener.aidl +39 −9 Original line number Diff line number Diff line Loading @@ -22,11 +22,41 @@ package android.os; * {@hide} */ interface IDumpstateListener { /** * Called when there is a progress update. * * @param progress the progress in [0, 100] */ oneway void onProgress(int progress); /* Options specified are invalid or incompatible */ const int BUGREPORT_ERROR_INVALID_INPUT = 1; /* Bugreport encountered a runtime error */ const int BUGREPORT_ERROR_RUNTIME_ERROR = 2; /** * Called on an error condition with one of the error codes listed above. */ oneway void onError(int errorCode); /** * Called when taking bugreport finishes successfully * * @param durationMs time capturing bugreport took in milliseconds * @param title title for the bugreport; helpful in reminding the user why they took it * @param description detailed description for the bugreport */ oneway void onFinished(long durationMs, @utf8InCpp String title, @utf8InCpp String description); // TODO(b/111441001): Remove old methods when not used anymore. void onProgressUpdated(int progress); void onMaxProgressUpdated(int maxProgress); /** * Called after every section is complete. * * @param name section name * @param status values from status_t * {@code OK} section completed successfully Loading