Lines Matching refs:mem_st
81 struct memory_stat *mem_st) { in stats_write_lmk_kill_occurred() argument
88 mem_st ? mem_st->pgfault : -1, in stats_write_lmk_kill_occurred()
89 mem_st ? mem_st->pgmajfault : -1, in stats_write_lmk_kill_occurred()
90 mem_st ? mem_st->rss_in_bytes : tasksize * BYTES_IN_KILOBYTE, in stats_write_lmk_kill_occurred()
91 mem_st ? mem_st->cache_in_bytes : -1, in stats_write_lmk_kill_occurred()
92 mem_st ? mem_st->swap_in_bytes : -1, in stats_write_lmk_kill_occurred()
93 mem_st ? mem_st->process_start_time_ns : -1, in stats_write_lmk_kill_occurred()
103 struct memory_stat* mem_st) { in stats_write_lmk_kill_occurred_pid() argument
108 tasksize, mem_st); in stats_write_lmk_kill_occurred_pid()
111 static void memory_stat_parse_line(char* line, struct memory_stat* mem_st) { in memory_stat_parse_line() argument
122 mem_st->pgfault = value; in memory_stat_parse_line()
124 mem_st->pgmajfault = value; in memory_stat_parse_line()
126 mem_st->rss_in_bytes = value; in memory_stat_parse_line()
128 mem_st->cache_in_bytes = value; in memory_stat_parse_line()
130 mem_st->swap_in_bytes = value; in memory_stat_parse_line()
133 static int memory_stat_from_cgroup(struct memory_stat* mem_st, int pid, uid_t uid) { in memory_stat_from_cgroup() argument
146 memory_stat_parse_line(buf, mem_st); in memory_stat_from_cgroup()
153 static int memory_stat_from_procfs(struct memory_stat* mem_st, int pid) { in memory_stat_from_procfs() argument
182 mem_st->pgfault = pgfault; in memory_stat_from_procfs()
183 mem_st->pgmajfault = pgmajfault; in memory_stat_from_procfs()
184 mem_st->rss_in_bytes = (rss_in_pages * PAGE_SIZE); in memory_stat_from_procfs()
185 mem_st->process_start_time_ns = starttime * (NS_PER_SEC / sysconf(_SC_CLK_TCK)); in memory_stat_from_procfs()
191 static struct memory_stat mem_st = {}; in stats_read_memory_stat() local
198 if (memory_stat_from_cgroup(&mem_st, pid, uid) == 0) { in stats_read_memory_stat()
199 return &mem_st; in stats_read_memory_stat()
202 if (memory_stat_from_procfs(&mem_st, pid) == 0) { in stats_read_memory_stat()
203 return &mem_st; in stats_read_memory_stat()