• Home
  • Raw
  • Download

Lines Matching refs:iter

495 static int get_ksymbol_arch(struct kallsym_iter *iter)  in get_ksymbol_arch()  argument
497 int ret = arch_get_kallsym(iter->pos - kallsyms_num_syms, in get_ksymbol_arch()
498 &iter->value, &iter->type, in get_ksymbol_arch()
499 iter->name); in get_ksymbol_arch()
502 iter->pos_arch_end = iter->pos; in get_ksymbol_arch()
509 static int get_ksymbol_mod(struct kallsym_iter *iter) in get_ksymbol_mod() argument
511 int ret = module_get_kallsym(iter->pos - iter->pos_arch_end, in get_ksymbol_mod()
512 &iter->value, &iter->type, in get_ksymbol_mod()
513 iter->name, iter->module_name, in get_ksymbol_mod()
514 &iter->exported); in get_ksymbol_mod()
516 iter->pos_mod_end = iter->pos; in get_ksymbol_mod()
523 static int get_ksymbol_ftrace_mod(struct kallsym_iter *iter) in get_ksymbol_ftrace_mod() argument
525 int ret = ftrace_mod_get_kallsym(iter->pos - iter->pos_mod_end, in get_ksymbol_ftrace_mod()
526 &iter->value, &iter->type, in get_ksymbol_ftrace_mod()
527 iter->name, iter->module_name, in get_ksymbol_ftrace_mod()
528 &iter->exported); in get_ksymbol_ftrace_mod()
530 iter->pos_ftrace_mod_end = iter->pos; in get_ksymbol_ftrace_mod()
537 static int get_ksymbol_bpf(struct kallsym_iter *iter) in get_ksymbol_bpf() argument
539 strlcpy(iter->module_name, "bpf", MODULE_NAME_LEN); in get_ksymbol_bpf()
540 iter->exported = 0; in get_ksymbol_bpf()
541 return bpf_get_kallsym(iter->pos - iter->pos_ftrace_mod_end, in get_ksymbol_bpf()
542 &iter->value, &iter->type, in get_ksymbol_bpf()
543 iter->name) < 0 ? 0 : 1; in get_ksymbol_bpf()
547 static unsigned long get_ksymbol_core(struct kallsym_iter *iter) in get_ksymbol_core() argument
549 unsigned off = iter->nameoff; in get_ksymbol_core()
551 iter->module_name[0] = '\0'; in get_ksymbol_core()
552 iter->value = kallsyms_sym_address(iter->pos); in get_ksymbol_core()
554 iter->type = kallsyms_get_symbol_type(off); in get_ksymbol_core()
556 off = kallsyms_expand_symbol(off, iter->name, ARRAY_SIZE(iter->name)); in get_ksymbol_core()
558 return off - iter->nameoff; in get_ksymbol_core()
561 static void reset_iter(struct kallsym_iter *iter, loff_t new_pos) in reset_iter() argument
563 iter->name[0] = '\0'; in reset_iter()
564 iter->nameoff = get_symbol_offset(new_pos); in reset_iter()
565 iter->pos = new_pos; in reset_iter()
567 iter->pos_arch_end = 0; in reset_iter()
568 iter->pos_mod_end = 0; in reset_iter()
569 iter->pos_ftrace_mod_end = 0; in reset_iter()
578 static int update_iter_mod(struct kallsym_iter *iter, loff_t pos) in update_iter_mod() argument
580 iter->pos = pos; in update_iter_mod()
582 if ((!iter->pos_arch_end || iter->pos_arch_end > pos) && in update_iter_mod()
583 get_ksymbol_arch(iter)) in update_iter_mod()
586 if ((!iter->pos_mod_end || iter->pos_mod_end > pos) && in update_iter_mod()
587 get_ksymbol_mod(iter)) in update_iter_mod()
590 if ((!iter->pos_ftrace_mod_end || iter->pos_ftrace_mod_end > pos) && in update_iter_mod()
591 get_ksymbol_ftrace_mod(iter)) in update_iter_mod()
594 return get_ksymbol_bpf(iter); in update_iter_mod()
598 static int update_iter(struct kallsym_iter *iter, loff_t pos) in update_iter() argument
602 return update_iter_mod(iter, pos); in update_iter()
605 if (pos != iter->pos) in update_iter()
606 reset_iter(iter, pos); in update_iter()
608 iter->nameoff += get_ksymbol_core(iter); in update_iter()
609 iter->pos++; in update_iter()
637 struct kallsym_iter *iter = m->private; in s_show() local
640 if (!iter->name[0]) in s_show()
643 value = iter->show_value ? (void *)iter->value : NULL; in s_show()
645 if (iter->module_name[0]) { in s_show()
652 type = iter->exported ? toupper(iter->type) : in s_show()
653 tolower(iter->type); in s_show()
655 type, iter->name, iter->module_name); in s_show()
658 iter->type, iter->name); in s_show()
710 struct kallsym_iter *iter; in kallsyms_open() local
711 iter = __seq_open_private(file, &kallsyms_op, sizeof(*iter)); in kallsyms_open()
712 if (!iter) in kallsyms_open()
714 reset_iter(iter, 0); in kallsyms_open()
716 iter->show_value = kallsyms_show_value(); in kallsyms_open()