View debug methods for kernel function calls "original"

Source: Internet
Author: User

Method One,

By printing the function address, you can see where the function is called

For example:

Core.c DRIVERS\PWM

int pwm_config (struct pwm_device *pwm, int duty_ns, int period_ns)

{

if (!PWM | | period_ns = = 0 | | Duty_ns > Period_ns)

Return-einval;

PRINTK ("%s DRIVERS\PWM core.c----(%d) \ r \ n", __func__, __line__);

PRINTK ("pwm->chip->ops->config=%p----(%d) \ r \ n", Pwm->chip->ops->config, __line__);

Return Pwm->chip->ops->config (Pwm->chip, PWM, Duty_ns, Period_ns);

}

The terminal is displayed as follows:

[42.550000] pwm->chip->ops->config=c001b0c0----(378)

You can then

The following directory

Z:\linux-3.6.5

Found in the System.map in

C001B0C0 T Asiu_pwmc_config

It is called this function asiu_pwmc_config

Method Two,

Dump_stack () function

Welcome to Exchange

If reproduced please indicate the source

Sina Blog: http://blog.sina.com.cn/u/2049150530
Blog Park: http://www.cnblogs.com/sky-heaven/
Know: Http://www.zhihu.com/people/zhang-bing-hua

View debug methods for kernel function calls "original"

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.