6장 IRQ thread ftrace log

코드를 분석한 내용을 자기의 것으로 만들기 위한 과정으로 실습이 중요합니다.

p432. 디버깅을 통해 배우는 리눅스 커널의 구조와 원리.

프로그램을 디버깅을 통해 배워야 된다 생각했는데, 저자역시 같은 생각이다. 따라서 왜 코드만 보고 이해할 수 없었는지 명확하다. 사람이 코드만 보고 어떻게 동작하는지 이해할 수 없다.

          <idle>-0     [000] d.h. 43045.401470: irq_handler_exit: irq=37 ret=handled
          <idle>-0     [000] d.h. 43045.417578: irq_handler_entry: irq=36 name=mmc1
          <idle>-0     [000] d.h. 43045.417581: __handle_irq_event_percpu+0x88/0x294: [+] irq:[36] handler: bcm2835_mmc_irq+0x0/0x6e8 caller: (handle_irq_event_percpu+0x3c/0x90) 
          <idle>-0     [000] d.h. 43045.417583: bcm2835_mmc_irq+0x14/0x6e8 <-__handle_irq_event_percpu+0xb8/0x294
          <idle>-0     [000] d.h. 43045.417629: <stack trace>
 => bcm2835_mmc_irq+0x18/0x6e8
 => __handle_irq_event_percpu+0xb8/0x294
 => handle_irq_event_percpu+0x3c/0x90
 => handle_irq_event+0x54/0x78
 => handle_fasteoi_irq+0xd4/0x18c
 => generic_handle_irq+0x34/0x44
 => __handle_domain_irq+0x6c/0xc4
 => gic_handle_irq+0x4c/0x88
 => __irq_svc+0x5c/0x7c
 => arch_cpu_idle+0x34/0x4c
 => arch_cpu_idle+0x34/0x4c
 => default_idle_call+0x40/0x48
 => do_idle+0x124/0x164
 => cpu_startup_entry+0x28/0x2c
 => rest_init+0xb8/0xbc
 => start_kernel+0x4b0/0x4e4
          <idle>-0     [000] d.h. 43045.417638: irq_handler_exit: irq=36 ret=handled
          <idle>-0     [000] dnh. 43045.417648: sched_wakeup: comm=irq/36-mmc1 pid=82 prio=49 target_cpu=000
          <idle>-0     [000] dnh. 43045.417651: irq_handler_entry: irq=36 name=mmc0
          <idle>-0     [000] dnh. 43045.417653: __handle_irq_event_percpu+0x88/0x294: [+] irq:[36] handler: sdhci_irq+0x0/0xdc0 caller: (handle_irq_event_percpu+0x3c/0x90) 
          <idle>-0     [000] dnh. 43045.417656: irq_handler_exit: irq=36 ret=unhandled
          <idle>-0     [000] dnh. 43045.417668: sched_wakeup: comm=kworker/0:4 pid=5757 prio=120 target_cpu=000
          <idle>-0     [000] d... 43045.417684: sched_switch: prev_comm=swapper/0 prev_pid=0 prev_prio=120 prev_state=R ==> next_comm=irq/36-mmc1 next_pid=82 next_prio=49
     irq/36-mmc1-82    [000] .... 43045.417690: bcm2835_mmc_thread_irq+0x10/0x98 <-irq_thread_fn+0x2c/0x88
     irq/36-mmc1-82    [000] .... 43045.417704: <stack trace>
 => bcm2835_mmc_thread_irq+0x14/0x98
 => irq_thread_fn+0x2c/0x88
 => irq_thread+0x164/0x240
 => kthread+0x16c/0x174
 => ret_from_fork+0x14/0x28
 => 0
     irq/36-mmc1-82    [000] d.h. 43045.417731: irq_handler_entry: irq=36 name=mmc1

인터럽트가 bcm2835_mmc_irq를 먼저 실행하고, thread로 bcm2835_mmc_thread_irq를 깨워 동작함을 알 수 있다.

코멘트

댓글 남기기

이 사이트는 Akismet을 사용하여 스팸을 줄입니다. 댓글 데이터가 어떻게 처리되는지 알아보세요.