gs-common: dumpstate: Rewrite dump_pixel_metrics to cpp am: 717622c5bd am: e569271a1d
Original change: https://googleplex-android-review.googlesource.com/c/device/google/gs-common/+/23574829 Change-Id: I754114d945eda6e477a9cfe4c80dfee11a633799 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
commit
272f1eecad
@ -2,9 +2,19 @@ package {
|
|||||||
default_applicable_licenses: ["Android-Apache-2.0"],
|
default_applicable_licenses: ["Android-Apache-2.0"],
|
||||||
}
|
}
|
||||||
|
|
||||||
sh_binary {
|
cc_binary {
|
||||||
name: "dump_pixel_metrics.sh",
|
name: "dump_pixel_metrics",
|
||||||
src: "dump_pixel_metrics.sh",
|
srcs: ["dump_pixel_metrics.cpp"],
|
||||||
|
cflags: [
|
||||||
|
"-Wall",
|
||||||
|
"-Wextra",
|
||||||
|
"-Werror",
|
||||||
|
],
|
||||||
|
shared_libs: [
|
||||||
|
"libbase",
|
||||||
|
"libdump",
|
||||||
|
"liblog",
|
||||||
|
],
|
||||||
vendor: true,
|
vendor: true,
|
||||||
sub_dir: "dump",
|
relative_install_path: "dump",
|
||||||
}
|
}
|
||||||
|
26
pixel_metrics/dump_pixel_metrics.cpp
Normal file
26
pixel_metrics/dump_pixel_metrics.cpp
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2022 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.
|
||||||
|
*/
|
||||||
|
#include <dump/pixel_dump.h>
|
||||||
|
#include <android-base/file.h>
|
||||||
|
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
setbuf(stdout, NULL);
|
||||||
|
dumpFileContent("Long running IRQ metrics", "/sys/kernel/metrics/irq/long_irq_metrics");
|
||||||
|
dumpFileContent("Resume latency metrics", "/sys/kernel/metrics/resume_latency/resume_latency_metrics");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
@ -1,7 +0,0 @@
|
|||||||
#!/vendor/bin/sh
|
|
||||||
echo "Long running IRQ metrics"
|
|
||||||
cat /sys/kernel/metrics/irq/long_irq_metrics
|
|
||||||
echo "Resume latency metrics"
|
|
||||||
cat /sys/kernel/metrics/resume_latency/resume_latency_metrics
|
|
||||||
echo "Temperature Residency Metrics:"
|
|
||||||
cat /sys/kernel/metrics/temp_residency/temp_residency_all/stats
|
|
@ -1,3 +1,3 @@
|
|||||||
BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/pixel_metrics/sepolicy
|
BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/pixel_metrics/sepolicy
|
||||||
|
|
||||||
PRODUCT_PACKAGES += dump_pixel_metrics.sh
|
PRODUCT_PACKAGES += dump_pixel_metrics
|
||||||
|
@ -2,4 +2,4 @@ pixel_bugreport(dump_pixel_metrics)
|
|||||||
|
|
||||||
#vendor-metrics
|
#vendor-metrics
|
||||||
r_dir_file(dump_pixel_metrics, sysfs_vendor_metrics)
|
r_dir_file(dump_pixel_metrics, sysfs_vendor_metrics)
|
||||||
allow dump_pixel_metrics vendor_toolbox_exec:file execute_no_trans;
|
allow dump_pixel_metrics vendor_dumpsys:file execute_no_trans;
|
||||||
|
@ -1 +1 @@
|
|||||||
/vendor/bin/dump/dump_pixel_metrics\.sh u:object_r:dump_pixel_metrics_exec:s0
|
/vendor/bin/dump/dump_pixel_metrics u:object_r:dump_pixel_metrics_exec:s0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user