Debug Facility in Lego¶
Lego provides several handy debug helpers to ease our coding pain. We category them by layers, namely 1) Core Kernel
, the lowest level of Lego, which is shared by all managers. 2) Processor Manager
, which controls processor components. 3) Memory Manager
, which controls memory components.
Core Kernel¶
void dump_pte(pte_t *ptep, const char *reason);
void dump_page(struct page *page, const char *reason);
void ptdump_walk_pgd_level(pgd_t *pgd);
void show_state_filter(unsigned long state_filter, bool print_rq);
void sched_show_task(struct task_struct *p);
void sysrq_sched_debug_show(void);
runqueue
. Use this set of functions if you are developing code related to scheduler.
Processor Manager¶
void dump_pcache_meta(struct pcache_meta *pcm, const char *reason);
void dump_pcache_victim(struct pcache_victim_meta *victim, const char *reason);
void dump_pcache_rmap(struct pcache_rmap *rmap, const char *reason);
void dump_pcache_line(struct pcache_meta *pcm, const char *reason);
Memory Manager¶
void dump_lego_mm(const struct lego_mm_struct *mm);
void dump_vma(const struct vm_area_struct *vma);