• Home
  • Raw
  • Download

Lines Matching refs:session

47 static void __reset_stat_session(struct stat_session *session)  in __reset_stat_session()  argument
51 rbtree_postorder_for_each_entry_safe(snode, n, &session->stat_root, node) { in __reset_stat_session()
52 if (session->ts->stat_release) in __reset_stat_session()
53 session->ts->stat_release(snode->stat); in __reset_stat_session()
57 session->stat_root = RB_ROOT; in __reset_stat_session()
60 static void reset_stat_session(struct stat_session *session) in reset_stat_session() argument
62 mutex_lock(&session->stat_mutex); in reset_stat_session()
63 __reset_stat_session(session); in reset_stat_session()
64 mutex_unlock(&session->stat_mutex); in reset_stat_session()
67 static void destroy_session(struct stat_session *session) in destroy_session() argument
69 tracefs_remove(session->file); in destroy_session()
70 __reset_stat_session(session); in destroy_session()
71 mutex_destroy(&session->stat_mutex); in destroy_session()
72 kfree(session); in destroy_session()
123 static int stat_seq_init(struct stat_session *session) in stat_seq_init() argument
125 struct tracer_stat *ts = session->ts; in stat_seq_init()
126 struct rb_root *root = &session->stat_root; in stat_seq_init()
131 mutex_lock(&session->stat_mutex); in stat_seq_init()
132 __reset_stat_session(session); in stat_seq_init()
161 mutex_unlock(&session->stat_mutex); in stat_seq_init()
165 __reset_stat_session(session); in stat_seq_init()
166 mutex_unlock(&session->stat_mutex); in stat_seq_init()
173 struct stat_session *session = s->private; in stat_seq_start() local
179 mutex_lock(&session->stat_mutex); in stat_seq_start()
182 if (session->ts->stat_headers) { in stat_seq_start()
188 node = rb_first(&session->stat_root); in stat_seq_start()
197 struct stat_session *session = s->private; in stat_seq_next() local
203 return rb_first(&session->stat_root); in stat_seq_next()
210 struct stat_session *session = s->private; in stat_seq_stop() local
211 mutex_unlock(&session->stat_mutex); in stat_seq_stop()
216 struct stat_session *session = s->private; in stat_seq_show() local
220 return session->ts->stat_headers(s); in stat_seq_show()
222 return session->ts->stat_show(s, l->stat); in stat_seq_show()
237 struct stat_session *session = inode->i_private; in tracing_stat_open() local
243 ret = stat_seq_init(session); in tracing_stat_open()
249 reset_stat_session(session); in tracing_stat_open()
254 m->private = session; in tracing_stat_open()
263 struct stat_session *session = i->i_private; in tracing_stat_release() local
265 reset_stat_session(session); in tracing_stat_release()
293 static int init_stat_file(struct stat_session *session) in init_stat_file() argument
300 session->file = tracefs_create_file(session->ts->name, TRACE_MODE_WRITE, in init_stat_file()
301 stat_dir, session, in init_stat_file()
303 if (!session->file) in init_stat_file()
310 struct stat_session *session, *node; in register_stat_tracer() local
328 session = kzalloc(sizeof(*session), GFP_KERNEL); in register_stat_tracer()
329 if (!session) in register_stat_tracer()
332 session->ts = trace; in register_stat_tracer()
333 INIT_LIST_HEAD(&session->session_list); in register_stat_tracer()
334 mutex_init(&session->stat_mutex); in register_stat_tracer()
336 ret = init_stat_file(session); in register_stat_tracer()
338 destroy_session(session); in register_stat_tracer()
344 list_add_tail(&session->session_list, &all_stat_sessions); in register_stat_tracer()