Lines Matching refs:task_entry

59 struct task_entry {  struct
122 static void get_full_task_comm(struct task_entry *task_entry, in get_full_task_comm() argument
132 __get_task_comm(task_entry->comm, TASK_COMM_LEN, task); in get_full_task_comm()
133 i = strlen(task_entry->comm); in get_full_task_comm()
135 task_entry->comm[i++] = ' '; in get_full_task_comm()
145 len = strlcpy(task_entry->comm + i, pathname, in get_full_task_comm()
148 task_entry->comm[i++] = ' '; in get_full_task_comm()
162 task_entry->comm[i++] = buf[offset]; in get_full_task_comm()
164 task_entry->comm[i++] = ' '; in get_full_task_comm()
171 while (task_entry->comm[i-1] == ' ') in get_full_task_comm()
173 task_entry->comm[i] = '\0'; in get_full_task_comm()
176 static struct task_entry *find_task_entry(struct uid_entry *uid_entry, in find_task_entry()
179 struct task_entry *task_entry; in find_task_entry() local
181 hash_for_each_possible(uid_entry->task_entries, task_entry, hash, in find_task_entry()
183 if (task->pid == task_entry->pid) { in find_task_entry()
185 int len = strnchr(task_entry->comm, ' ', TASK_COMM_LEN) in find_task_entry()
186 - task_entry->comm; in find_task_entry()
188 if (strncmp(task_entry->comm, task->comm, len)) in find_task_entry()
189 get_full_task_comm(task_entry, task); in find_task_entry()
190 return task_entry; in find_task_entry()
196 static struct task_entry *find_or_register_task(struct uid_entry *uid_entry, in find_or_register_task()
199 struct task_entry *task_entry; in find_or_register_task() local
202 task_entry = find_task_entry(uid_entry, task); in find_or_register_task()
203 if (task_entry) in find_or_register_task()
204 return task_entry; in find_or_register_task()
206 task_entry = kzalloc(sizeof(struct task_entry), GFP_ATOMIC); in find_or_register_task()
207 if (!task_entry) in find_or_register_task()
210 get_full_task_comm(task_entry, task); in find_or_register_task()
212 task_entry->pid = pid; in find_or_register_task()
213 hash_add(uid_entry->task_entries, &task_entry->hash, (unsigned int)pid); in find_or_register_task()
215 return task_entry; in find_or_register_task()
220 struct task_entry *task_entry; in remove_uid_tasks() local
225 tmp_task, task_entry, hash) { in remove_uid_tasks()
226 hash_del(&task_entry->hash); in remove_uid_tasks()
227 kfree(task_entry); in remove_uid_tasks()
233 struct task_entry *task_entry; in set_io_uid_tasks_zero() local
236 hash_for_each(uid_entry->task_entries, bkt_task, task_entry, hash) { in set_io_uid_tasks_zero()
237 memset(&task_entry->io[UID_STATE_TOTAL_CURR], 0, in set_io_uid_tasks_zero()
245 struct task_entry *task_entry = find_or_register_task(uid_entry, task); in add_uid_tasks_io_stats() local
246 struct io_stats *task_io_slot = &task_entry->io[slot]; in add_uid_tasks_io_stats()
257 struct task_entry *task_entry; in compute_io_uid_tasks() local
260 hash_for_each(uid_entry->task_entries, bkt_task, task_entry, hash) { in compute_io_uid_tasks()
261 compute_io_bucket_stats(&task_entry->io[uid_entry->state], in compute_io_uid_tasks()
262 &task_entry->io[UID_STATE_TOTAL_CURR], in compute_io_uid_tasks()
263 &task_entry->io[UID_STATE_TOTAL_LAST], in compute_io_uid_tasks()
264 &task_entry->io[UID_STATE_DEAD_TASKS]); in compute_io_uid_tasks()
270 struct task_entry *task_entry; in show_io_uid_tasks() local
273 hash_for_each(uid_entry->task_entries, bkt_task, task_entry, hash) { in show_io_uid_tasks()
276 task_entry->comm, in show_io_uid_tasks()
277 (unsigned long)task_entry->pid, in show_io_uid_tasks()
278 task_entry->io[UID_STATE_FOREGROUND].rchar, in show_io_uid_tasks()
279 task_entry->io[UID_STATE_FOREGROUND].wchar, in show_io_uid_tasks()
280 task_entry->io[UID_STATE_FOREGROUND].read_bytes, in show_io_uid_tasks()
281 task_entry->io[UID_STATE_FOREGROUND].write_bytes, in show_io_uid_tasks()
282 task_entry->io[UID_STATE_BACKGROUND].rchar, in show_io_uid_tasks()
283 task_entry->io[UID_STATE_BACKGROUND].wchar, in show_io_uid_tasks()
284 task_entry->io[UID_STATE_BACKGROUND].read_bytes, in show_io_uid_tasks()
285 task_entry->io[UID_STATE_BACKGROUND].write_bytes, in show_io_uid_tasks()
286 task_entry->io[UID_STATE_FOREGROUND].fsync, in show_io_uid_tasks()
287 task_entry->io[UID_STATE_BACKGROUND].fsync); in show_io_uid_tasks()