由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - how printk works
相关主题
没完的“unresolved external symbol” in c++ compiling问一个machine learning/SVM 问题
INIT_WORK从Linux kernel 2.6.20后改了?C++ delete
segfaultGO似乎是目前最难反编译的代码了
vert.x就是一个小型的eai*** help needed! on MATLAB GUI ***
并口驱动的一个问题 (转载)How to tell gcc stop compiling.
哪位用过tty_flip_buffer_push()?inheritence problem
C arrayA tech question (转载)
A C++ compiler related interview questionAn interesting C++ compile error
相关话题的讨论汇总
话题: printk话题: unwind话题: entries话题: would话题: know
进入Programming版参与讨论
1 (共1页)
c****d
发帖数: 116
1
I know the printk supports ``%pS'' would output
function_name+0ffset if given current pc.
Something I know is that compiler would generate
unwind tables, with unwind index. But I don't know
exactly what are those entries in tables, and how
kernel would use these entries to unwind the stack,
particularly the function name.
unwind.c in kernel source code helps, but I still
need someone explain this a little bit.
thanks
m**k
发帖数: 290
2
跟unwind.c没关系。
编译内核最后面几步会运行
KSYM .tmp_kallsyms1.o
KSYM .tmp_kallsyms2.o
LD vmlinux
KSYM 运行 nm | scripts/kallsyms | cc
把所有的symbol编译到 vmlinux 里面。具体数据保存在 kallsyms_addresses 等一些
表里面。printk会在这些表里查询。实现在 kenrel/kallsyms.c:sprint_symbol()
c****d
发帖数: 116
3
thank you so much.
Let me dig dig.. ;) unwind.c is used to unwind the whole stack.

【在 m**k 的大作中提到】
: 跟unwind.c没关系。
: 编译内核最后面几步会运行
: KSYM .tmp_kallsyms1.o
: KSYM .tmp_kallsyms2.o
: LD vmlinux
: KSYM 运行 nm | scripts/kallsyms | cc
: 把所有的symbol编译到 vmlinux 里面。具体数据保存在 kallsyms_addresses 等一些
: 表里面。printk会在这些表里查询。实现在 kenrel/kallsyms.c:sprint_symbol()

1 (共1页)
进入Programming版参与讨论
相关主题
An interesting C++ compile error并口驱动的一个问题 (转载)
谁来解释一下这个是compiler问题吗?哪位用过tty_flip_buffer_push()?
关于Makefile的一个问题C array
这句话是为什么呢?A C++ compiler related interview question
没完的“unresolved external symbol” in c++ compiling问一个machine learning/SVM 问题
INIT_WORK从Linux kernel 2.6.20后改了?C++ delete
segfaultGO似乎是目前最难反编译的代码了
vert.x就是一个小型的eai*** help needed! on MATLAB GUI ***
相关话题的讨论汇总
话题: printk话题: unwind话题: entries话题: would话题: know