Execute phase segment modifier to view the execution process

Source: Internet
Author: User
When I looked at the I2C driver, I felt a bit messy. The server was down and couldn't be compiled. It wasn't good to pile up. makefile and kconfig both looked at it and wrote a script based on the header file of the kernel, allows you to conveniently view the function execution process.
Execute postseq 'pwd'
Output modifier in execution stage function name + row number
1 #! /Bin/bash 2 3 file_one =/tmp/Jerry. post0. $4 file_two =/tmp/Jerry. post1. $5 6
# For all the viewed functions, the _ init class attribute is used by default. 7 For name in 'grep _ init. /*-Rn | sed-n-e's /. * init [[: blank:] \ {1 \} \ ([A-Za-Z]. * \)/\ 1/P' | sed-n-e's/\ ([a-zA-Z0-9 _] * \). */\ 1/p''
# For the _ init modifier function name, view the modifier server in the execution stage
# Here, the segment modifiers of the execution phase are:
# Early_initcall pure_initcall core_initcall core_initcall_sync
# Postcore_initcall post_inicall_sync arch_initcall arch_initcall_sync
# Subsys_initcall subsys_initcall_sync fs_initcall fs_initcall_sync
# Rootfs_initcall
# Module_init _ initcall device_initcall device_initcall_sync
# Late_initcall late_initcall_sync 8 do 9 grep $ name 'pwd'/*-Rn | sed-n-e '/early_initcall/p'-E'/pure_initcall/p'-E '/ core_initcall/p'-E'/core_initcall_sync/p'-E'/postcore_initcall/p'-E'/postcore_initcall_sync/p'-E'/arch_initcall/p'-E '/ arch_initcall_sync/p'-E'/subsys_initcall/p'-E'/subsys_initcall_sync/p'-E'/fs_initcall/p'-E'/fs_initcall_sync/p'-E '/ rootfs_initcall/p'-E'/module_init/p'-E'/_ initcall/p'-E'/device_initcall/p'-E'/device_initcall_sync/p'-e '/late_initcall/p'-E'/late_initcall_sync/P'> $ file_one10 done11 12 echo 'sed-n-e 'P' $ file_one' | sed-n-e' S /; * [[: blank:] \ {1 \}/; \ n/GP '| sed-n-E's,' $ {PWD }'/,, p'> $ file_two13 14 echo 'sed-n-e 'P' $ file_two' | sed-n-e's/; [[: blank:] */\ n/GP '| sed-n-e's /\(. * \): \ ([0-9] * \): \ (. * \) [[: blank:] * ([[: blank:] * \ (. * \) [[: blank:] *) $/\ 3 \ 4 \ 1 + \ 2/P' | awk '{printf "%-20 S %-30s \ t % S % s \ n", $1, $2, $3, $4} '| sort-D-K1 | uniq 15 16 RM $ file_one17 RM $ file_two

I tried it in the sound file. I listed too many of them and deleted them. There are about 10 lele_init modules. Based on the script running results, we combined makefile, you can determine the function Execution Process in a drive folder,
In makefile, the files generated by the previous compilation are located in front of the parameter list during the link, so they are located in front of the same section, therefore, for process modules started by more data sections such as module_init,
It must also be executed first.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.