Loading media/libcpustats/Android.mk +3 −1 Original line number Diff line number Diff line Loading @@ -8,4 +8,6 @@ LOCAL_SRC_FILES := \ LOCAL_MODULE := libcpustats LOCAL_CFLAGS := -std=gnu++11 -Werror include $(BUILD_STATIC_LIBRARY) media/libcpustats/ThreadCpuUsage.cpp +1 −2 Original line number Diff line number Diff line Loading @@ -21,7 +21,6 @@ #include <stdlib.h> #include <time.h> #include <utils/Debug.h> #include <utils/Log.h> #include <cpustats/ThreadCpuUsage.h> Loading Loading @@ -218,7 +217,7 @@ uint32_t ThreadCpuUsage::getCpukHz(int cpuNum) #define FREQ_SIZE 64 char freq_path[FREQ_SIZE]; #define FREQ_DIGIT 27 COMPILE_TIME_ASSERT_FUNCTION_SCOPE(MAX_CPU <= 10); static_assert(MAX_CPU <= 10, "MAX_CPU too large"); #define FREQ_PATH "/sys/devices/system/cpu/cpu?/cpufreq/scaling_cur_freq" strlcpy(freq_path, FREQ_PATH, sizeof(freq_path)); freq_path[FREQ_DIGIT] = cpuNum + '0'; Loading Loading
media/libcpustats/Android.mk +3 −1 Original line number Diff line number Diff line Loading @@ -8,4 +8,6 @@ LOCAL_SRC_FILES := \ LOCAL_MODULE := libcpustats LOCAL_CFLAGS := -std=gnu++11 -Werror include $(BUILD_STATIC_LIBRARY)
media/libcpustats/ThreadCpuUsage.cpp +1 −2 Original line number Diff line number Diff line Loading @@ -21,7 +21,6 @@ #include <stdlib.h> #include <time.h> #include <utils/Debug.h> #include <utils/Log.h> #include <cpustats/ThreadCpuUsage.h> Loading Loading @@ -218,7 +217,7 @@ uint32_t ThreadCpuUsage::getCpukHz(int cpuNum) #define FREQ_SIZE 64 char freq_path[FREQ_SIZE]; #define FREQ_DIGIT 27 COMPILE_TIME_ASSERT_FUNCTION_SCOPE(MAX_CPU <= 10); static_assert(MAX_CPU <= 10, "MAX_CPU too large"); #define FREQ_PATH "/sys/devices/system/cpu/cpu?/cpufreq/scaling_cur_freq" strlcpy(freq_path, FREQ_PATH, sizeof(freq_path)); freq_path[FREQ_DIGIT] = cpuNum + '0'; Loading