1 /*
2  * Copyright 2022 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 #include <dump/pixel_dump.h>
17 #include <unistd.h>
18 
19 const char* dvfs_paths[][2] = {
20     {"MIF DVFS", "/sys/devices/platform/17000010.devfreq_mif/devfreq/17000010.devfreq_mif/trans_stat"},
21     {"INT DVFS", "/sys/devices/platform/17000020.devfreq_int/devfreq/17000020.devfreq_int/trans_stat"},
22     {"INTCAM DVFS", "/sys/devices/platform/17000030.devfreq_intcam/devfreq/17000030.devfreq_intcam/trans_stat"},
23     {"DISP DVFS", "/sys/devices/platform/17000040.devfreq_disp/devfreq/17000040.devfreq_disp/trans_stat"},
24     {"CAM DVFS", "/sys/devices/platform/17000050.devfreq_cam/devfreq/17000050.devfreq_cam/trans_stat"},
25     {"TNR DVFS", "/sys/devices/platform/17000060.devfreq_tnr/devfreq/17000060.devfreq_tnr/trans_stat"},
26     {"MFC DVFS", "/sys/devices/platform/17000070.devfreq_mfc/devfreq/17000070.devfreq_mfc/trans_stat"},
27     {"BO DVFS", "/sys/devices/platform/17000080.devfreq_bo/devfreq/17000080.devfreq_bo/trans_stat"},
28     {"BW DVFS", "/sys/devices/platform/17000080.devfreq_bw/devfreq/17000080.devfreq_bw/trans_stat"},
29     {"DSU DVFS", "/sys/devices/platform/17000090.devfreq_dsu/devfreq/17000090.devfreq_dsu/trans_stat"},
30     {"BCI DVFS", "/sys/devices/platform/170000a0.devfreq_bci/devfreq/170000a0.devfreq_bci/trans_stat"},
31     {"BTS stats", "/sys/devices/platform/exynos-bts/bts_stats"}
32 };
main()33 int main() {
34 
35     for (auto &dvfs_path : dvfs_paths ) {
36         if(!access(dvfs_path[1], R_OK)) {
37             dumpFileContent(dvfs_path[0], dvfs_path[1]);
38         }
39     }
40     return 0;
41 }
42