Lines Matching refs:mem_st
71 static void memory_stat_parse_line(const char* line, struct memory_stat* mem_st) { in memory_stat_parse_line() argument
82 mem_st->pgfault = value; in memory_stat_parse_line()
84 mem_st->pgmajfault = value; in memory_stat_parse_line()
86 mem_st->rss_in_bytes = value; in memory_stat_parse_line()
88 mem_st->cache_in_bytes = value; in memory_stat_parse_line()
90 mem_st->swap_in_bytes = value; in memory_stat_parse_line()
93 static int memory_stat_from_cgroup(struct memory_stat* mem_st, int pid, uid_t uid __unused) { in memory_stat_from_cgroup() argument
108 memory_stat_parse_line(buf, mem_st); in memory_stat_from_cgroup()
115 static int memory_stat_from_procfs(struct memory_stat* mem_st, int pid) { in memory_stat_from_procfs() argument
143 mem_st->pgfault = pgfault; in memory_stat_from_procfs()
144 mem_st->pgmajfault = pgmajfault; in memory_stat_from_procfs()
145 mem_st->process_start_time_ns = starttime * (NS_PER_SEC / sysconf(_SC_CLK_TCK)); in memory_stat_from_procfs()
152 static struct memory_stat mem_st = {}; in stats_read_memory_stat() local
158 if (memory_stat_from_cgroup(&mem_st, pid, uid) == 0) { in stats_read_memory_stat()
159 return &mem_st; in stats_read_memory_stat()
162 if (memory_stat_from_procfs(&mem_st, pid) == 0) { in stats_read_memory_stat()
163 mem_st.rss_in_bytes = rss_bytes; in stats_read_memory_stat()
164 mem_st.swap_in_bytes = swap_bytes; in stats_read_memory_stat()
165 return &mem_st; in stats_read_memory_stat()