你可以打印IDT表中的IRQ处理函数名称吗?

huangapple go评论69阅读模式
英文:

How can I print the Irq handler function name from idt table?

问题

I managed to print my IDT Table with my kernel module. It will show me the irq number, Stub Address, Segment, DPL, Type, and Handler Name. But unfortunately, my handler name always return the stub of the address not the actual handlers name.

For example, for irq number 34 it will return

34     0xffffffffa6600180  10            0     Interrupt gate     irq_entries_start+0x10/0x660

I believe irq number 34 is for handling nvme irq, as I look it up on proc/interrupts. But it wont return like nvme_irq or nvme_irq_handler or something like that show me the irq_handler function. How I can show the actual handler name of the idt table using the address?

If you interested to look my github source code for checking the idt table, here is the GitHub link: GitHub Check IDT Repo.

Thank you in advance

英文:

For background, I managed to print my IDT Table with my kernel module. It will show me the irq number, Stub Address, Segment, DPL, Type, and Handler Name. But unfortunately, my handler name always return the stub of the address not the actual handlers name.

For example, for irq number 34 it will return

34     0xffffffffa6600180  10            0     Interrupt gate     irq_entries_start+0x10/0x660

I believe irq number 34 is for handling nvme irq, as I look it up on proc/interrupts. But it wont return like nvme_irq or nvme_irq_handler or something like that show me the irq_handler function. How I can show the actual handler name of the idt table using the address?
If you interested to look my github source code for checking the idt table, here is the GitHub link: GitHub Check IDT Repo.

Thank you in advance

答案1

得分: 1

我已经找到了一种打印它的方法,通过使用irq_to_desc()函数。它将返回中断描述符,然后我获取action->handler地址。然后,我调用sprint_symbol函数传入该地址,它将返回其处理程序名称。谢谢大家。

英文:

I already found a way to print it, by using irq_to_desc() function. It will return the irq desc and then I get the action->handler address. Then, I call sprint_symbol on the address, which returns its handler name. Thank you all.

答案2

得分: 0

尝试使用 char *name = symbol_lookup(address); 以获取函数名称,而不是使用 sprint_symbol

英文:

Try using char *name = symbol_lookup(address); to obtain the name of the function instead of sprint_symbol

huangapple
  • 本文由 发表于 2023年6月12日 00:45:59
  • 转载请务必保留本文链接:https://go.coder-hub.com/76451511.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定