The author has 1 post.
Font size: Small - 100% (Default)▼  Content converter: No conversion▼
 
Clicks Replies
760 0
linux内核用printk打印函数指针指向的函数名,以及当前函数的调用者的函数名
巨大八爪鱼
武林盟主 二十一级
Reply
Floor 1 Posted at: 8/18/25 10:46

打印函数指针指向的函数名:

printk(KERN_ERR "%s: func %pS is at address: %px\n", __func__, hdev->send, hdev->send);

打印当前函数的调用者的函数名:

printk(KERN_ERR "%s: the func's caller is %pS\n", __func__, __builtin_return_address(0));

Reply the post
Content:
User: You are currently anonymous.
Captcha:
Unclear? Try another one.
(Shortcut key: Ctrl+Enter)
Post Information
Clicks: 760 Replies: 0
Author: 巨大八爪鱼
Last reply: 巨大八爪鱼
Last reply time: 8/18/25 10:46
Bar Hot Posts
Announcements