Lines Matching refs:stat
403 struct tracer_stat stat; member
448 struct ftrace_profile_stat *stat = in function_stat_start() local
449 container_of(trace, struct ftrace_profile_stat, stat); in function_stat_start()
451 if (!stat || !stat->start) in function_stat_start()
454 return function_stat_next(&stat->start->records[0], 0); in function_stat_start()
565 static void ftrace_profile_reset(struct ftrace_profile_stat *stat) in ftrace_profile_reset() argument
569 pg = stat->pages = stat->start; in ftrace_profile_reset()
577 memset(stat->hash, 0, in ftrace_profile_reset()
581 static int ftrace_profile_pages_init(struct ftrace_profile_stat *stat) in ftrace_profile_pages_init() argument
589 if (stat->pages) in ftrace_profile_pages_init()
592 stat->pages = (void *)get_zeroed_page(GFP_KERNEL); in ftrace_profile_pages_init()
593 if (!stat->pages) in ftrace_profile_pages_init()
609 pg = stat->start = stat->pages; in ftrace_profile_pages_init()
623 pg = stat->start; in ftrace_profile_pages_init()
631 stat->pages = NULL; in ftrace_profile_pages_init()
632 stat->start = NULL; in ftrace_profile_pages_init()
639 struct ftrace_profile_stat *stat; in ftrace_profile_init_cpu() local
642 stat = &per_cpu(ftrace_profile_stats, cpu); in ftrace_profile_init_cpu()
644 if (stat->hash) { in ftrace_profile_init_cpu()
646 ftrace_profile_reset(stat); in ftrace_profile_init_cpu()
656 stat->hash = kcalloc(size, sizeof(struct hlist_head), GFP_KERNEL); in ftrace_profile_init_cpu()
658 if (!stat->hash) in ftrace_profile_init_cpu()
662 if (ftrace_profile_pages_init(stat) < 0) { in ftrace_profile_init_cpu()
663 kfree(stat->hash); in ftrace_profile_init_cpu()
664 stat->hash = NULL; in ftrace_profile_init_cpu()
687 ftrace_find_profiled_func(struct ftrace_profile_stat *stat, unsigned long ip) in ftrace_find_profiled_func() argument
694 hhd = &stat->hash[key]; in ftrace_find_profiled_func()
707 static void ftrace_add_profile(struct ftrace_profile_stat *stat, in ftrace_add_profile() argument
713 hlist_add_head_rcu(&rec->node, &stat->hash[key]); in ftrace_add_profile()
720 ftrace_profile_alloc(struct ftrace_profile_stat *stat, unsigned long ip) in ftrace_profile_alloc() argument
725 if (atomic_inc_return(&stat->disabled) != 1) in ftrace_profile_alloc()
732 rec = ftrace_find_profiled_func(stat, ip); in ftrace_profile_alloc()
736 if (stat->pages->index == PROFILES_PER_PAGE) { in ftrace_profile_alloc()
737 if (!stat->pages->next) in ftrace_profile_alloc()
739 stat->pages = stat->pages->next; in ftrace_profile_alloc()
742 rec = &stat->pages->records[stat->pages->index++]; in ftrace_profile_alloc()
744 ftrace_add_profile(stat, rec); in ftrace_profile_alloc()
747 atomic_dec(&stat->disabled); in ftrace_profile_alloc()
756 struct ftrace_profile_stat *stat; in function_profile_call() local
765 stat = this_cpu_ptr(&ftrace_profile_stats); in function_profile_call()
766 if (!stat->hash || !ftrace_profile_enabled) in function_profile_call()
769 rec = ftrace_find_profiled_func(stat, ip); in function_profile_call()
771 rec = ftrace_profile_alloc(stat, ip); in function_profile_call()
809 struct ftrace_profile_stat *stat; in profile_graph_return() local
815 stat = this_cpu_ptr(&ftrace_profile_stats); in profile_graph_return()
816 if (!stat->hash || !ftrace_profile_enabled) in profile_graph_return()
839 rec = ftrace_find_profiled_func(stat, trace->func); in profile_graph_return()
956 struct ftrace_profile_stat *stat; in ftrace_profile_tracefs() local
962 stat = &per_cpu(ftrace_profile_stats, cpu); in ftrace_profile_tracefs()
975 stat->stat = function_stats; in ftrace_profile_tracefs()
976 stat->stat.name = name; in ftrace_profile_tracefs()
977 ret = register_stat_tracer(&stat->stat); in ftrace_profile_tracefs()