Skip to content

This script spiders through an entire project to find each function and visually display how each function calls other functions.

License

Notifications You must be signed in to change notification settings

EpiJunkie/project-function-hierarchy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Project Function Hierarchy

This script spiders through an entire project to find each function and visually display how each function calls other functions. This can be helpful to optimize a script after you realize how many times a function is called.

Example

A single function:

[epijunkie@bhost] ~/project# ./project-function-hierarchy.sh __info
   __info
      __return_pools_active
      __gvset_guest_pool
         __verify_valid_pool
            __setup
            __fault_detected_exit
               __log
               __log
            __fault_detected_exit
               __log
               __log
            __fault_detected_exit
               __log
               __log
            __fault_detected_exit
               __log
               __log
      __return_chyves_zfs_property_value
      __return_new_line_delimit_as_space_string
      __return_guest_list
      __load_guest_parameters
         __gvset_guest_pool
            __verify_valid_pool
               __setup
               __fault_detected_exit
                  __log
                  __log
               __fault_detected_exit
                  __log
                  __log
               __fault_detected_exit
                  __log
                  __log
               __fault_detected_exit
                  __log
                  __log
         __return_chyves_zfs_property_value
         __return_chyves_zfs_property_value
         __return_chyves_zfs_property_value
         __return_chyves_zfs_property_value
         __return_chyves_zfs_property_value
         __return_chyves_zfs_property_value
         __return_chyves_zfs_property_value
         __return_chyves_zfs_property_value
         __return_chyves_zfs_property_value
         __return_chyves_zfs_property_value
         __return_chyves_zfs_property_value
         __return_chyves_zfs_property_value
         __return_chyves_zfs_property_value
         __return_chyves_zfs_property_value
         __return_chyves_zfs_property_value
         __return_chyves_zfs_property_value
         __return_chyves_zfs_property_value
         __return_chyves_zfs_property_value
         __return_chyves_zfs_property_value
         __return_chyves_zfs_property_value
         __return_chyves_zfs_property_value
         __return_guest_dataset_mountpoint
      __get_guest_console_pid
      __return_guest_vmm_allocated
      __return_guest_bhyve_pid
      __return_rcboot_priority
         __return_chyves_zfs_property_value
      __gvset_first_disk
      __return_guest_disk_list
      __return_chyves_zfs_property_value
      __return_chyves_zfs_property_value

An entire project

[epijunkie@bhost] ~/project# ./project-function-hierarchy.sh
      __preflight_check
         __load_library_files
            __log
            __log
            __fault_detected_exit
               __log
               __log
         __fault_detected_exit
            __log
            __log
         __log
         __log
         __return_cpu_section_from_dmesg
         __return_cpu_section_from_dmesg
         __return_cpu_section_from_dmesg
         __log
         __log
         __log
         __return_cpu_section_from_dmesg
         __fault_detected_exit
            __log
            __log
         __gvset_primary_pool
            __verify_valid_pool
               __setup
               __fault_detected_exit
                  __log
                  __log
               __fault_detected_exit
                  __log
                  __log
               __fault_detected_exit
                  __log
                  __log
               __fault_detected_exit
                  __log
                  __log
         __log
         __fault_detected_exit
            __log
            __log
         __return_chyves_zfs_property_value
         __return_chyves_zfs_property_value
         __return_chyves_zfs_property_value
         __return_chyves_zfs_property_value
         __return_chyves_zfs_property_value
         __return_chyves_zfs_property_value
         __return_chyves_zfs_property_value
         __return_chyves_zfs_property_value
         __return_chyves_zfs_property_value
         __return_chyves_zfs_property_value
         __return_chyves_zfs_property_value
         __return_new_line_delimit_as_comma_string
         __return_guest_list
         __return_new_line_delimit_as_grep_string
         __return_guest_list
         __return_chyves_zfs_property_value
         __return_chyves_zfs_property_value
         __return_chyves_zfs_property_value
         __return_chyves_zfs_property_value
         __return_chyves_zfs_property_value
         __return_chyves_zfs_property_value
         __verify_kernel_module_loaded
            __verify_kernel_module_loaded - [WARNING] Infinite loop [WARNING]
            __fault_detected_exit
               __log
               __log
      __parse_cmd_ingress
         __parse_cmd_dataset
            __root_credentials_required
               __fault_detected_exit
                  __log
                  __log
            __verify_number_of_arguments
               __help
                  __version
               __fault_detected_exit
                  __log
                  __log
            __verify_valid_pool
               __setup
               __fault_detected_exit
                  __log
                  __log
               __fault_detected_exit
                  __log
                  __log
               __fault_detected_exit
                  __log
                  __log
               __fault_detected_exit
                  __log
                  __log
            __dataset_install
               __log
               __log
               __set_chyves_zfs_property
                  __log
               __set_chyves_zfs_property
                  __log
               __set_chyves_zfs_property
                  __log
               __set_chyves_zfs_property
                  __log
               __set_chyves_zfs_property
                  __log
               __set_chyves_zfs_property
                  __log
               __set_chyves_zfs_property
                  __log
               __set_chyves_zfs_property
                  __log
               __set_chyves_zfs_property
                  __log
               __set_chyves_zfs_property
                  __log
               __set_chyves_zfs_property
                  __log
               __set_chyves_zfs_property
                  __log
               __set_chyves_zfs_property
                  __log
               __set_chyves_zfs_property
                  __log
               __set_chyves_zfs_property
                  __log
               __set_chyves_zfs_property
                  __log
               __set_chyves_zfs_property
                  __log
               __set_chyves_zfs_property
                  __log
               __set_chyves_zfs_property
                  __log
               __set_chyves_zfs_property
                  __log
               __set_chyves_zfs_property
                  __log
               __log
               __log
               __set_chyves_zfs_property
                  __log
               __set_chyves_zfs_property
                  __log
               __set_chyves_zfs_property
                  __log
               __set_chyves_zfs_property
                  __log
               __set_chyves_zfs_property
                  __log
               __set_chyves_zfs_property
                  __log
               __set_chyves_zfs_property
                  __log
               __set_chyves_zfs_property
                  __log
               __set_chyves_zfs_property
                  __log
               __set_chyves_zfs_property
                  __log
               __set_chyves_zfs_property
                  __log
               __set_chyves_zfs_property
                  __log
               __set_chyves_zfs_property
                  __log
               __set_chyves_zfs_property
                  __log
               __set_chyves_zfs_property
                  __log
               __set_chyves_zfs_property
                  __log
               __set_chyves_zfs_property
                  __log
               __set_chyves_zfs_property
                  __log
               __set_chyves_zfs_property
                  __log
               __set_chyves_zfs_property
                  __log
               __set_chyves_zfs_property
                  __log
               __set_chyves_zfs_property
                  __log
               __log
               __log
               __resource_import
                  __verify_valid_dataset
                     __fault_detected_exit
                        __log
                        __log
                     __fault_detected_exit
                        __log
                        __log
                  __log
                  __log
                  __log
                  __log
                  __log
                  __log
                  __log
                  __log
                  __log
                  __log
                  __log
                  __resource_functions
                  __log
                  __log
                  __log
                  __verify_valid_dataset
                     __fault_detected_exit
                        __log
                        __log
                     __fault_detected_exit
                        __log
                        __log
                  __log
                  __log
                  __log
                  __log
                  __log
                  __log
                  __resource_functions
               __log
               __return_one_if_freenas
            __verify_valid_pool
               __setup
               __fault_detected_exit
                  __log
                  __log
               __fault_detected_exit
                  __log
                  __log
               __fault_detected_exit
                  __log
                  __log
               __fault_detected_exit
                  __log
                  __log
            __dataset_offline
            __verify_valid_pool
               __setup
               __fault_detected_exit
                  __log
                  __log
               __fault_detected_exit
                  __log
                  __log
               __fault_detected_exit
                  __log
                  __log
               __fault_detected_exit
                  __log
                  __log
            __dataset_online
            __verify_valid_pool
               __setup
               __fault_detected_exit
                  __log
                  __log
               __fault_detected_exit
                  __log
                  __log
               __fault_detected_exit
                  __log
                  __log
               __fault_detected_exit
                  __log
                  __log
            __dataset_promote
            __verify_valid_pool
               __setup
               __fault_detected_exit
                  __log
                  __log
               __fault_detected_exit
                  __log
                  __log
               __fault_detected_exit
                  __log
                  __log
               __fault_detected_exit
                  __log
                  __log
            __dataset_delete
            __verify_valid_pool
               __setup
               __fault_detected_exit
                  __log
                  __log
               __fault_detected_exit
                  __log
                  __log
               __fault_detected_exit
                  __log
                  __log
               __fault_detected_exit
                  __log
                  __log
            __dataset_upgrade
            __help
               __version
            __fault_detected_exit
               __log
               __log
         __fault_detected_exit
            __log
            __log
         __parse_cmd_resources
            __list_firmwares
            __list_iso
            __verify_number_of_arguments
               __help
                  __version
               __fault_detected_exit
                  __log
                  __log
            __verify_valid_dataset
               __fault_detected_exit
                  __log
                  __log
               __fault_detected_exit
                  __log
                  __log
            __resource_delete
               __log
            __verify_number_of_arguments
               __help
                  __version
               __fault_detected_exit
                  __log
                  __log
            __resource_import
               __verify_valid_dataset
                  __fault_detected_exit
                     __log
                     __log
                  __fault_detected_exit
                     __log
                     __log
               __log
               __log
               __log
               __log
               __log
               __log
               __log
               __log
               __log
               __log
               __log
               __resource_functions
               __log
               __log
               __log
               __verify_valid_dataset
                  __fault_detected_exit
                     __log
                     __log
                  __fault_detected_exit
                     __log
                     __log
               __log
               __log
               __log
               __log
               __log
               __log
               __resource_functions
            __verify_number_of_arguments
               __help
                  __version
               __fault_detected_exit
                  __log
                  __log
            __verify_valid_dataset
               __fault_detected_exit
                  __log
                  __log
               __fault_detected_exit
                  __log
                  __log
            __verify_valid_dataset
               __fault_detected_exit
                  __log
                  __log
               __fault_detected_exit
                  __log
                  __log
            __resource_rename
               __log
         __help
            __version
         __verify_number_of_arguments
            __help
               __version
...thousands more lines...

About

This script spiders through an entire project to find each function and visually display how each function calls other functions.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages