ftrace如何跟踪中断服务程序? [英] How does ftrace track interrupt service routines?

查看:344
本文介绍了ftrace如何跟踪中断服务程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

ftrace用于内核的功能跟踪.现在,它如何处理中断.它可以在中断模式下跟踪内核功能吗?如果可以的话,您能解释一下它是如何工作的.我正在尝试编写一个跟踪函数调用的函数,它在 Supervisor 模式下工作正常,但在中断模式下不起作用(进入循环).我需要使其在 IRQ 模式下工作.

ftrace is used for function tracing of kernel. Now how does it work for interrupts. Can it track kernel functions in interrupt mode. If so can you explain how it works. I am trying to write a function that tracks function calls and it works fine in Supervisor mode but does not work in interrupt mode (goes into loop). I need to make it work in IRQ mode.

推荐答案

Linux中内核ARM异常堆栈init 的详细信息,Linux使用的IRQ堆栈数量很少. ARM具有用于IRQ模式的多个存储寄存器,包括lrsp.在Linux ARM内核中,这些寄存器仅短暂使用以将信息传输到超级用户(8K)堆栈.该管理程序堆栈是按内核进程分配的,还包含一个任务上下文块,其中包含指向内存管理器调度程序文件系统的指针信息.

As in Linux kernel ARM exception stack init details, the amount of IRQ stack used by Linux is minimal. ARM has several banked registers including lr and sp for the IRQ modes. In the Linux ARM kernel, these registers are used only briefly to transfer information to the supervisor (8K) stack. This supervisor stack is allocate per kernel process and also contain a task context block with pointers to the memory manager, scheduler and file system information.

因此,在Linux中,超级用户堆栈具有所有模式的堆栈信息,包括FIQ,IRQ,未定义指令,数据和指令错误.这意味着只需要跟踪一个堆栈.特殊信息(伪汇编程序)包含在

So in Linux, the supervisor stack has the stack information for all modes, including FIQ, IRQ, undefined instruction, data and instruction faults. This means only one stack needs to be traced. Special information (pseudo assembler) is included in entry-armv.S, such as UNWIND(.fnend) and ENDPROC(__irq_usr) which annotate the kernel with ELF information to create unwind tables that allow the stack tracing code to understand the layout of data on the stack.

ARM Linux中的矢量页面映射具有一些其他详细信息,例如作为 vector_name 进行堆栈/模式切换的汇编宏. vector_name汇编程序宏是IRQ模式下实际执行的唯一代码. irq_usrirq_svc在超级用户模式下与超级用户堆栈一起执行.

Vector page mapping in ARM Linux has some additional details such as the vector_name assembler macro which does the stack/mode switching. The vector_name assembler macro is the only code that actually executes in IRQ mode. irq_usr and irq_svc execute in supervisor mode, with the supervisor stack.

这篇关于ftrace如何跟踪中断服务程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆