Loading cmds/atrace/atrace.cpp +0 −1 Original line number Diff line number Diff line Loading @@ -126,7 +126,6 @@ static const TracingCategory k_categories[] = { { "aidl", "AIDL calls", ATRACE_TAG_AIDL, { } }, { "nnapi", "NNAPI", ATRACE_TAG_NNAPI, { } }, { "rro", "Runtime Resource Overlay", ATRACE_TAG_RRO, { } }, { "sysprop", "System Property", ATRACE_TAG_SYSPROP, { } }, { k_coreServiceCategory, "Core services", 0, { } }, { k_pdxServiceCategory, "PDX services", 0, { } }, { "sched", "CPU Scheduling", 0, { Loading cmds/atrace/atrace.rc +12 −1 Original line number Diff line number Diff line Loading @@ -266,7 +266,10 @@ on late-init chmod 0666 /sys/kernel/debug/tracing/per_cpu/cpu15/trace chmod 0666 /sys/kernel/tracing/per_cpu/cpu15/trace on post-fs-data # Only create the tracing instance if persist.mm_events.enabled # Attempting to remove the tracing instance after it has been created # will likely fail with EBUSY as it would be in use by traced_probes. on post-fs-data && property:persist.mm_events.enabled=true # Create MM Events Tracing Instance for Kmem Activity Trigger mkdir /sys/kernel/debug/tracing/instances/mm_events 0755 system system mkdir /sys/kernel/tracing/instances/mm_events 0755 system system Loading @@ -275,10 +278,18 @@ on post-fs-data chmod 0666 /sys/kernel/debug/tracing/instances/mm_events/buffer_size_kb chmod 0666 /sys/kernel/tracing/instances/mm_events/buffer_size_kb # Set the default buffer size to the minimum write /sys/kernel/debug/tracing/instances/mm_events/buffer_size_kb 1 write /sys/kernel/tracing/instances/mm_events/buffer_size_kb 1 # Read and enable tracing chmod 0666 /sys/kernel/debug/tracing/instances/mm_events/tracing_on chmod 0666 /sys/kernel/tracing/instances/mm_events/tracing_on # Tracing disabled by default write /sys/kernel/debug/tracing/instances/mm_events/tracing_on 0 write /sys/kernel/tracing/instances/mm_events/tracing_on 0 # Read and truncate kernel trace chmod 0666 /sys/kernel/debug/tracing/instances/mm_events/trace chmod 0666 /sys/kernel/tracing/instances/mm_events/trace Loading cmds/surfacereplayer/proto/src/trace.proto +5 −0 Original line number Diff line number Diff line Loading @@ -52,6 +52,7 @@ message SurfaceChange { BackgroundBlurRadiusChange background_blur_radius = 20; ShadowRadiusChange shadow_radius = 21; BlurRegionsChange blur_regions = 22; TrustedOverlayChange trusted_overlay = 23; } } Loading Loading @@ -197,6 +198,10 @@ message ShadowRadiusChange { required float radius = 1; } message TrustedOverlayChange { required float is_trusted_overlay = 1; } message BlurRegionsChange { repeated BlurRegionChange blur_regions = 1; } Loading include/private/performance_hint_private.h 0 → 100644 +145 −0 Original line number Diff line number Diff line /* * Copyright (C) 2021 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef ANDROID_PRIVATE_NATIVE_PERFORMANCE_HINT_PRIVATE_H #define ANDROID_PRIVATE_NATIVE_PERFORMANCE_HINT_PRIVATE_H #include <stdint.h> __BEGIN_DECLS struct APerformanceHintManager; struct APerformanceHintSession; /** * An opaque type representing a handle to a performance hint manager. * It must be released after use. * * <p>To use:<ul> * <li>Obtain the performance hint manager instance by calling * {@link APerformanceHint_getManager} function.</li> * <li>Create an {@link APerformanceHintSession} with * {@link APerformanceHint_createSession}.</li> * <li>Get the preferred update rate in nanoseconds with * {@link APerformanceHint_getPreferredUpdateRateNanos}.</li> */ typedef struct APerformanceHintManager APerformanceHintManager; /** * An opaque type representing a handle to a performance hint session. * A session can only be acquired from a {@link APerformanceHintManager} * with {@link APerformanceHint_getPreferredUpdateRateNanos}. It must be * freed with {@link APerformanceHint_closeSession} after use. * * A Session represents a group of threads with an inter-related workload such that hints for * their performance should be considered as a unit. The threads in a given session should be * long-life and not created or destroyed dynamically. * * <p>Each session is expected to have a periodic workload with a target duration for each * cycle. The cycle duration is likely greater than the target work duration to allow other * parts of the pipeline to run within the available budget. For example, a renderer thread may * work at 60hz in order to produce frames at the display's frame but have a target work * duration of only 6ms.</p> * * <p>After each cycle of work, the client is expected to use * {@link APerformanceHint_reportActualWorkDuration} to report the actual time taken to * complete.</p> * * <p>To use:<ul> * <li>Update a sessions target duration for each cycle of work * with {@link APerformanceHint_updateTargetWorkDuration}.</li> * <li>Report the actual duration for the last cycle of work with * {@link APerformanceHint_reportActualWorkDuration}.</li> * <li>Release the session instance with * {@link APerformanceHint_closeSession}.</li></ul></p> */ typedef struct APerformanceHintSession APerformanceHintSession; /** * Acquire an instance of the performance hint manager. * * @return manager instance on success, nullptr on failure. */ APerformanceHintManager* APerformanceHint_getManager(); /** * Creates a session for the given set of threads and sets their initial target work * duration. * @param manager The performance hint manager instance. * @param threadIds The list of threads to be associated with this session. They must be part of * this app's thread group. * @param size the size of threadIds. * @param initialTargetWorkDurationNanos The desired duration in nanoseconds for the new session. * This must be positive. * @return manager instance on success, nullptr on failure. */ APerformanceHintSession* APerformanceHint_createSession(APerformanceHintManager* manager, const int32_t* threadIds, size_t size, int64_t initialTargetWorkDurationNanos); /** * Get preferred update rate information for this device. * * @param manager The performance hint manager instance. * @return the preferred update rate supported by device software. */ int64_t APerformanceHint_getPreferredUpdateRateNanos(APerformanceHintManager* manager); /** * Updates this session's target duration for each cycle of work. * * @param session The performance hint session instance to update. * @param targetDurationNanos the new desired duration in nanoseconds. This must be positive. * @return 0 on success * EINVAL if targetDurationNanos is not positive. * EPIPE if communication with the system service has failed. */ int APerformanceHint_updateTargetWorkDuration(APerformanceHintSession* session, int64_t targetDurationNanos); /** * Reports the actual duration for the last cycle of work. * * <p>The system will attempt to adjust the core placement of the threads within the thread * group and/or the frequency of the core on which they are run to bring the actual duration * close to the target duration.</p> * * @param session The performance hint session instance to update. * @param actualDurationNanos how long the thread group took to complete its last task in * nanoseconds. This must be positive. * @return 0 on success * EINVAL if actualDurationNanos is not positive. * EPIPE if communication with the system service has failed. */ int APerformanceHint_reportActualWorkDuration(APerformanceHintSession* session, int64_t actualDurationNanos); /** * Release the performance hint manager pointer acquired via * {@link APerformanceHint_createSession}. * * @param session The performance hint session instance to release. */ void APerformanceHint_closeSession(APerformanceHintSession* session); /** * For testing only. */ void APerformanceHint_setIHintManagerForTesting(void* iManager); __END_DECLS #endif // ANDROID_PRIVATE_NATIVE_PERFORMANCE_HINT_PRIVATE_H libs/binder/ndk/tests/Android.bp +1 −1 Original line number Diff line number Diff line Loading @@ -95,7 +95,7 @@ cc_test { "libbinder_ndk", "libutils", ], test_suites: ["general-tests", "vts"], test_suites: ["general-tests"], require_root: true, } Loading Loading
cmds/atrace/atrace.cpp +0 −1 Original line number Diff line number Diff line Loading @@ -126,7 +126,6 @@ static const TracingCategory k_categories[] = { { "aidl", "AIDL calls", ATRACE_TAG_AIDL, { } }, { "nnapi", "NNAPI", ATRACE_TAG_NNAPI, { } }, { "rro", "Runtime Resource Overlay", ATRACE_TAG_RRO, { } }, { "sysprop", "System Property", ATRACE_TAG_SYSPROP, { } }, { k_coreServiceCategory, "Core services", 0, { } }, { k_pdxServiceCategory, "PDX services", 0, { } }, { "sched", "CPU Scheduling", 0, { Loading
cmds/atrace/atrace.rc +12 −1 Original line number Diff line number Diff line Loading @@ -266,7 +266,10 @@ on late-init chmod 0666 /sys/kernel/debug/tracing/per_cpu/cpu15/trace chmod 0666 /sys/kernel/tracing/per_cpu/cpu15/trace on post-fs-data # Only create the tracing instance if persist.mm_events.enabled # Attempting to remove the tracing instance after it has been created # will likely fail with EBUSY as it would be in use by traced_probes. on post-fs-data && property:persist.mm_events.enabled=true # Create MM Events Tracing Instance for Kmem Activity Trigger mkdir /sys/kernel/debug/tracing/instances/mm_events 0755 system system mkdir /sys/kernel/tracing/instances/mm_events 0755 system system Loading @@ -275,10 +278,18 @@ on post-fs-data chmod 0666 /sys/kernel/debug/tracing/instances/mm_events/buffer_size_kb chmod 0666 /sys/kernel/tracing/instances/mm_events/buffer_size_kb # Set the default buffer size to the minimum write /sys/kernel/debug/tracing/instances/mm_events/buffer_size_kb 1 write /sys/kernel/tracing/instances/mm_events/buffer_size_kb 1 # Read and enable tracing chmod 0666 /sys/kernel/debug/tracing/instances/mm_events/tracing_on chmod 0666 /sys/kernel/tracing/instances/mm_events/tracing_on # Tracing disabled by default write /sys/kernel/debug/tracing/instances/mm_events/tracing_on 0 write /sys/kernel/tracing/instances/mm_events/tracing_on 0 # Read and truncate kernel trace chmod 0666 /sys/kernel/debug/tracing/instances/mm_events/trace chmod 0666 /sys/kernel/tracing/instances/mm_events/trace Loading
cmds/surfacereplayer/proto/src/trace.proto +5 −0 Original line number Diff line number Diff line Loading @@ -52,6 +52,7 @@ message SurfaceChange { BackgroundBlurRadiusChange background_blur_radius = 20; ShadowRadiusChange shadow_radius = 21; BlurRegionsChange blur_regions = 22; TrustedOverlayChange trusted_overlay = 23; } } Loading Loading @@ -197,6 +198,10 @@ message ShadowRadiusChange { required float radius = 1; } message TrustedOverlayChange { required float is_trusted_overlay = 1; } message BlurRegionsChange { repeated BlurRegionChange blur_regions = 1; } Loading
include/private/performance_hint_private.h 0 → 100644 +145 −0 Original line number Diff line number Diff line /* * Copyright (C) 2021 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef ANDROID_PRIVATE_NATIVE_PERFORMANCE_HINT_PRIVATE_H #define ANDROID_PRIVATE_NATIVE_PERFORMANCE_HINT_PRIVATE_H #include <stdint.h> __BEGIN_DECLS struct APerformanceHintManager; struct APerformanceHintSession; /** * An opaque type representing a handle to a performance hint manager. * It must be released after use. * * <p>To use:<ul> * <li>Obtain the performance hint manager instance by calling * {@link APerformanceHint_getManager} function.</li> * <li>Create an {@link APerformanceHintSession} with * {@link APerformanceHint_createSession}.</li> * <li>Get the preferred update rate in nanoseconds with * {@link APerformanceHint_getPreferredUpdateRateNanos}.</li> */ typedef struct APerformanceHintManager APerformanceHintManager; /** * An opaque type representing a handle to a performance hint session. * A session can only be acquired from a {@link APerformanceHintManager} * with {@link APerformanceHint_getPreferredUpdateRateNanos}. It must be * freed with {@link APerformanceHint_closeSession} after use. * * A Session represents a group of threads with an inter-related workload such that hints for * their performance should be considered as a unit. The threads in a given session should be * long-life and not created or destroyed dynamically. * * <p>Each session is expected to have a periodic workload with a target duration for each * cycle. The cycle duration is likely greater than the target work duration to allow other * parts of the pipeline to run within the available budget. For example, a renderer thread may * work at 60hz in order to produce frames at the display's frame but have a target work * duration of only 6ms.</p> * * <p>After each cycle of work, the client is expected to use * {@link APerformanceHint_reportActualWorkDuration} to report the actual time taken to * complete.</p> * * <p>To use:<ul> * <li>Update a sessions target duration for each cycle of work * with {@link APerformanceHint_updateTargetWorkDuration}.</li> * <li>Report the actual duration for the last cycle of work with * {@link APerformanceHint_reportActualWorkDuration}.</li> * <li>Release the session instance with * {@link APerformanceHint_closeSession}.</li></ul></p> */ typedef struct APerformanceHintSession APerformanceHintSession; /** * Acquire an instance of the performance hint manager. * * @return manager instance on success, nullptr on failure. */ APerformanceHintManager* APerformanceHint_getManager(); /** * Creates a session for the given set of threads and sets their initial target work * duration. * @param manager The performance hint manager instance. * @param threadIds The list of threads to be associated with this session. They must be part of * this app's thread group. * @param size the size of threadIds. * @param initialTargetWorkDurationNanos The desired duration in nanoseconds for the new session. * This must be positive. * @return manager instance on success, nullptr on failure. */ APerformanceHintSession* APerformanceHint_createSession(APerformanceHintManager* manager, const int32_t* threadIds, size_t size, int64_t initialTargetWorkDurationNanos); /** * Get preferred update rate information for this device. * * @param manager The performance hint manager instance. * @return the preferred update rate supported by device software. */ int64_t APerformanceHint_getPreferredUpdateRateNanos(APerformanceHintManager* manager); /** * Updates this session's target duration for each cycle of work. * * @param session The performance hint session instance to update. * @param targetDurationNanos the new desired duration in nanoseconds. This must be positive. * @return 0 on success * EINVAL if targetDurationNanos is not positive. * EPIPE if communication with the system service has failed. */ int APerformanceHint_updateTargetWorkDuration(APerformanceHintSession* session, int64_t targetDurationNanos); /** * Reports the actual duration for the last cycle of work. * * <p>The system will attempt to adjust the core placement of the threads within the thread * group and/or the frequency of the core on which they are run to bring the actual duration * close to the target duration.</p> * * @param session The performance hint session instance to update. * @param actualDurationNanos how long the thread group took to complete its last task in * nanoseconds. This must be positive. * @return 0 on success * EINVAL if actualDurationNanos is not positive. * EPIPE if communication with the system service has failed. */ int APerformanceHint_reportActualWorkDuration(APerformanceHintSession* session, int64_t actualDurationNanos); /** * Release the performance hint manager pointer acquired via * {@link APerformanceHint_createSession}. * * @param session The performance hint session instance to release. */ void APerformanceHint_closeSession(APerformanceHintSession* session); /** * For testing only. */ void APerformanceHint_setIHintManagerForTesting(void* iManager); __END_DECLS #endif // ANDROID_PRIVATE_NATIVE_PERFORMANCE_HINT_PRIVATE_H
libs/binder/ndk/tests/Android.bp +1 −1 Original line number Diff line number Diff line Loading @@ -95,7 +95,7 @@ cc_test { "libbinder_ndk", "libutils", ], test_suites: ["general-tests", "vts"], test_suites: ["general-tests"], require_root: true, } Loading