免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12下一页
最近访问板块 发新帖
查看: 5935 | 回复: 17

怎样编译内核才能生成vmlinuz-syms-2.6.*的文件? [复制链接]

论坛徽章:
0
发表于 2009-10-22 14:46 |显示全部楼层
10可用积分
因为本人要安装Oprofile对系统进行评测,

编译的内核需要编译出带“syms”字样的内核文件,例如:vmlinuz-syms-2.6.18.8-xen

也就是需要with debugging symbols,

但是试验了很多次,都没有编译出带syms字样的内核来,只有vmlinuz-2.6.18.8-xen,

不知道怎么样才能编译出这样的内核文件来?、

熟悉内幕的大锅们能够详细的教小弟一下吗?


问题已经解决,见14楼

[ 本帖最后由 almeydifer 于 2009-10-22 19:09 编辑 ]

最佳答案

查看完整内容

在内核配置文件中配置了Debug应该就可以了,有没有"syms"只是镜像的名字不一样

论坛徽章:
36
IT运维版块每日发帖之星
日期:2016-04-10 06:20:00IT运维版块每日发帖之星
日期:2016-04-16 06:20:0015-16赛季CBA联赛之广东
日期:2016-04-16 19:59:32IT运维版块每日发帖之星
日期:2016-04-18 06:20:00IT运维版块每日发帖之星
日期:2016-04-19 06:20:00每日论坛发贴之星
日期:2016-04-19 06:20:00IT运维版块每日发帖之星
日期:2016-04-25 06:20:00IT运维版块每日发帖之星
日期:2016-05-06 06:20:00IT运维版块每日发帖之星
日期:2016-05-08 06:20:00IT运维版块每日发帖之星
日期:2016-05-13 06:20:00IT运维版块每日发帖之星
日期:2016-05-28 06:20:00每日论坛发贴之星
日期:2016-05-28 06:20:00
发表于 2009-10-22 14:46 |显示全部楼层
在内核配置文件中配置了Debug应该就可以了,有没有"syms"只是镜像的名字不一样

论坛徽章:
0
发表于 2009-10-22 14:50 |显示全部楼层
mv vmlinuz vmlinuz-syms-2.6.18.8-xen
本人纯属娱乐

论坛徽章:
0
发表于 2009-10-22 14:58 |显示全部楼层
我是这样做的,

第一个配置是在menuconfig里选择了Kernel Hacking 目下的Kerneil debugging,然后再选择了Complile the kernel with debug info,

第二个是在General Setup里选择了Configure standard kernel features (for small systems),然后其下的所有子项,全部选上了。

有这两步够了吗?

论坛徽章:
0
发表于 2009-10-22 14:59 |显示全部楼层
原帖由 Godbach 于 2009-10-22 14:48 发表
在内核配置文件中配置了Debug应该就可以了,有没有"syms"只是镜像的名字不一样


谢谢您的回复!
但是我在google里搜了这么一段话:

That should be correct. I don't know how your "vmlinux-syms-2.6.16.13-xen"
kernel was built, but it's surprising to me that it's got the "syms" string
in its name, but was built without -g.

似乎syms还是会表示是个什么意思。

论坛徽章:
36
IT运维版块每日发帖之星
日期:2016-04-10 06:20:00IT运维版块每日发帖之星
日期:2016-04-16 06:20:0015-16赛季CBA联赛之广东
日期:2016-04-16 19:59:32IT运维版块每日发帖之星
日期:2016-04-18 06:20:00IT运维版块每日发帖之星
日期:2016-04-19 06:20:00每日论坛发贴之星
日期:2016-04-19 06:20:00IT运维版块每日发帖之星
日期:2016-04-25 06:20:00IT运维版块每日发帖之星
日期:2016-05-06 06:20:00IT运维版块每日发帖之星
日期:2016-05-08 06:20:00IT运维版块每日发帖之星
日期:2016-05-13 06:20:00IT运维版块每日发帖之星
日期:2016-05-28 06:20:00每日论坛发贴之星
日期:2016-05-28 06:20:00
发表于 2009-10-22 15:04 |显示全部楼层
原帖由 almeydifer 于 2009-10-22 14:59 发表


谢谢您的回复!
但是我在google里搜了这么一段话:

That should be correct. I don't know how your "vmlinux-syms-2.6.16.13-xen"
kernel was built, but it's surprising to me that it's got the " ...


名字是什么不重要,关键是你编译出来的内核有相关调试信息了吗

论坛徽章:
36
IT运维版块每日发帖之星
日期:2016-04-10 06:20:00IT运维版块每日发帖之星
日期:2016-04-16 06:20:0015-16赛季CBA联赛之广东
日期:2016-04-16 19:59:32IT运维版块每日发帖之星
日期:2016-04-18 06:20:00IT运维版块每日发帖之星
日期:2016-04-19 06:20:00每日论坛发贴之星
日期:2016-04-19 06:20:00IT运维版块每日发帖之星
日期:2016-04-25 06:20:00IT运维版块每日发帖之星
日期:2016-05-06 06:20:00IT运维版块每日发帖之星
日期:2016-05-08 06:20:00IT运维版块每日发帖之星
日期:2016-05-13 06:20:00IT运维版块每日发帖之星
日期:2016-05-28 06:20:00每日论坛发贴之星
日期:2016-05-28 06:20:00
发表于 2009-10-22 15:11 |显示全部楼层
因为本人要安装Oprofile对系统进行评测,


Oprofile在编译内核的时候配置一下就可以了。我的系统默认就安装了。

论坛徽章:
0
发表于 2009-10-22 15:12 |显示全部楼层
原帖由 Godbach 于 2009-10-22 15:04 发表


名字是什么不重要,关键是你编译出来的内核有相关调试信息了吗



因为我装的是Xen虚拟机,所以有两个启动内核,一个是Xen的,叫做xen-syms-3.3.0(它带sysms吔)

另外一个是driver domain的内核,叫做vmlinuz-2.6.18.8-xen

现在跑oprofile,只能显示出xen-syms-3.3.0里的相关符号名称。

论坛徽章:
36
IT运维版块每日发帖之星
日期:2016-04-10 06:20:00IT运维版块每日发帖之星
日期:2016-04-16 06:20:0015-16赛季CBA联赛之广东
日期:2016-04-16 19:59:32IT运维版块每日发帖之星
日期:2016-04-18 06:20:00IT运维版块每日发帖之星
日期:2016-04-19 06:20:00每日论坛发贴之星
日期:2016-04-19 06:20:00IT运维版块每日发帖之星
日期:2016-04-25 06:20:00IT运维版块每日发帖之星
日期:2016-05-06 06:20:00IT运维版块每日发帖之星
日期:2016-05-08 06:20:00IT运维版块每日发帖之星
日期:2016-05-13 06:20:00IT运维版块每日发帖之星
日期:2016-05-28 06:20:00每日论坛发贴之星
日期:2016-05-28 06:20:00
发表于 2009-10-22 15:17 |显示全部楼层
Oprofile是有参数的,你编译的那个内核他识别不出来符号吗?

论坛徽章:
0
发表于 2009-10-22 15:35 |显示全部楼层
原帖由 Godbach 于 2009-10-22 15:17 发表
Oprofile是有参数的,你编译的那个内核他识别不出来符号吗?


这个是我的结果:

samples  %        app name                 symbol name
3356     28.9485  xen-unknown              (no symbols)
708       6.1071  xen-syms-3.3.0           do_general_protection
619       5.3394  xen-syms-3.3.0           do_grant_table_op
557       4.8046  xen-syms-3.3.0           __gnttab_unmap_common_complete
543       4.6839  xen-syms-3.3.0           host_to_guest_gpr_switch
423       3.6488  xen-syms-3.3.0           __gnttab_unmap_common
374       3.2261  xen-syms-3.3.0           replace_grant_va_mapping
341       2.9414  xen-syms-3.3.0           guest_to_host_gpr_switch
325       2.8034  xen-syms-3.3.0           __copy_from_user_ll
296       2.5533  libata                   (no symbols)
259       2.2341  xen-syms-3.3.0           is_iomem_page
251       2.1651  xen-syms-3.3.0           general_protection
235       2.0271  xen-syms-3.3.0           create_grant_host_mapping
192       1.6562  xen-syms-3.3.0           handle_exception
191       1.6475  xen-syms-3.3.0           __copy_to_user_ll
189       1.6303  xen-syms-3.3.0           flush_area_local
189       1.6303  xen-syms-3.3.0           restore_all_guest
160       1.3801  xen-syms-3.3.0           hypercall
145       1.2508  xen-syms-3.3.0           put_page
143       1.2335  xen-syms-3.3.0           rangeset_contains_range
133       1.1472  xen-syms-3.3.0           read_descriptor


下面这个是renato在xen summit做presentation时的一个例子:
samples  %        app name                           symbol name
6913      5.4236  xen-syms-3.0-unstable       do_grant_table_op
5922      4.6461  vmlinux-syms-2.6.16-xen0  net_tx_action
5419      4.2515  xen-syms-3.0-unstable        find_domain_by_id
5066      3.9745  xen-syms-3.0-unstable        gnttab_transfer
4870      3.8208  vmlinux-syms-2.6.16-xen0  net_rx_action
4311      3.3822  vmlinux-syms-2.6.16-xen0  nf_iterate
4032      3.1633  vmlinux-syms-2.6.16-xen0  hypercall_page
3555      2.7891  vmlinux-syms-2.6.16-xen0  eth_type_trans

3397      2.6651  xen-syms-3.0-unstable        hypercall
2820      2.2124  vmlinux-syms-2.6.16-xen0  e1000_intr
2607      2.0453  xen-syms-3.0-unstable        alloc_domheap_pages
2549      1.9998  vmlinux-syms-2.6.16-xen0  nf_hook_slow
2264      1.7762  xen-syms-3.0-unstable        evtchn_set_pending
2249      1.7645  vmlinux-syms-2.6.16-xen0  e1000_clean_rx_irq
2216      1.7386  xen-syms-3.0-unstable    __copy_from_user_ll
2178      1.7088  vmlinux-syms-2.6.16-xen0  dev_queue_xmit


注意看,他可以把driver domain的内核相关符号都显示出来,但是我不行。
他的该内核文件带有syms,所以我认为我编译的时候,有的选项没有设置
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP