Lines Matching refs:swap_info
824 bool ParseZramMmStat(StringPiece mm_stat_data, SwapInfo* swap_info) { in ParseZramMmStat() argument
842 if (!StringToUint64(tokens[0], &swap_info->orig_data_size)) in ParseZramMmStat()
844 if (!StringToUint64(tokens[1], &swap_info->compr_data_size)) in ParseZramMmStat()
846 if (!StringToUint64(tokens[2], &swap_info->mem_used_total)) in ParseZramMmStat()
852 bool ParseZramStat(StringPiece stat_data, SwapInfo* swap_info) { in ParseZramStat() argument
870 if (!StringToUint64(tokens[0], &swap_info->num_reads)) in ParseZramStat()
872 if (!StringToUint64(tokens[4], &swap_info->num_writes)) in ParseZramStat()
880 bool IgnoreZramFirstPage(uint64_t orig_data_size, SwapInfo* swap_info) { in IgnoreZramFirstPage() argument
884 swap_info->orig_data_size = 0; in IgnoreZramFirstPage()
885 swap_info->num_reads = 0; in IgnoreZramFirstPage()
886 swap_info->num_writes = 0; in IgnoreZramFirstPage()
887 swap_info->compr_data_size = 0; in IgnoreZramFirstPage()
888 swap_info->mem_used_total = 0; in IgnoreZramFirstPage()
894 void ParseZramPath(SwapInfo* swap_info) { in ParseZramPath() argument
898 if (IgnoreZramFirstPage(orig_data_size, swap_info)) in ParseZramPath()
901 swap_info->orig_data_size = orig_data_size; in ParseZramPath()
902 swap_info->num_reads = ReadFileToUint64(zram_path.Append("num_reads")); in ParseZramPath()
903 swap_info->num_writes = ReadFileToUint64(zram_path.Append("num_writes")); in ParseZramPath()
904 swap_info->compr_data_size = in ParseZramPath()
906 swap_info->mem_used_total = in ParseZramPath()
910 bool GetSwapInfoImpl(SwapInfo* swap_info) { in GetSwapInfoImpl() argument
924 ParseZramPath(swap_info); in GetSwapInfoImpl()
933 if (!ParseZramMmStat(mm_stat_data, swap_info)) { in GetSwapInfoImpl()
937 if (IgnoreZramFirstPage(swap_info->orig_data_size, swap_info)) in GetSwapInfoImpl()
946 if (!ParseZramStat(stat_data, swap_info)) { in GetSwapInfoImpl()
956 bool GetSwapInfo(SwapInfo* swap_info) { in GetSwapInfo() argument
957 if (!GetSwapInfoImpl(swap_info)) { in GetSwapInfo()
958 *swap_info = SwapInfo(); in GetSwapInfo()