blob: 4df1d842b1e32184370e324f915076d033f119c6 [file] [log] [blame]
Robin Pengc2b5ca92021-02-23 20:00:28 +08001/*
2 * Copyright (C) 2018 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
17#define LOG_TAG "pixelstats"
18
19#include <android-base/logging.h>
20
21#include <pixelstats/SysfsCollector.h>
22
23using android::hardware::google::pixel::SysfsCollector;
24
25#define UFSHC_PATH(filename) "/dev/sys/block/bootdevice/" #filename
26const struct SysfsCollector::SysfsPaths sysfs_paths = {
27 .SlowioReadCntPath = UFSHC_PATH(slowio_read_cnt),
28 .SlowioWriteCntPath = UFSHC_PATH(slowio_write_cnt),
29 .SlowioUnmapCntPath = UFSHC_PATH(slowio_unmap_cnt),
30 .SlowioSyncCntPath = UFSHC_PATH(slowio_sync_cnt),
31 .UFSLifetimeA = UFSHC_PATH(health_descriptor/life_time_estimation_a),
32 .UFSLifetimeB = UFSHC_PATH(health_descriptor/life_time_estimation_b),
33 .UFSLifetimeC = UFSHC_PATH(health_descriptor/life_time_estimation_c),
34 .F2fsStatsPath = "/sys/fs/f2fs/",
35};
36
37int main() {
38 LOG(INFO) << "starting PixelStats";
39
40 SysfsCollector collector(sysfs_paths);
41 collector.collect(); // This blocks forever.
42
43 return 0;
44}