Add huge_memory:trace_mm_khugepaged_scan_file tracepoint to hpage_collapse_scan_file() analogously to hpage_collapse_scan_pmd(). While this change is targeted at debugging MADV_COLLAPSE pathway, the "mm_khugepaged" prefix is retained for symmetry with huge_memory:trace_mm_khugepaged_scan_pmd, which retains it's legacy name to prevent changing kernel ABI as much as possible.
Showing the changes to include/trace (1 of 2 files). Show all
Unified · Split
| @@ -169,5 +169,39 @@ TRACE_EVENT(mm_collapse_huge_page_swapin, · 168 unmodified lines | |||
| 169 | __entry->ret) | 169 | __entry->ret) |
| 170 | ); | 170 | ); |
| 171 | 171 | ||
| 172 | TRACE_EVENT(mm_khugepaged_scan_file, | ||
| 173 | |||
| 174 | TP_PROTO(struct mm_struct *mm, struct page *page, const char *filename, | ||
| 175 | int present, int swap, int result), | ||
| 176 | |||
| 177 | TP_ARGS(mm, page, filename, present, swap, result), | ||
| 178 | |||
| 179 | TP_STRUCT__entry( | ||
| 180 | __field(struct mm_struct *, mm) | ||
| 181 | __field(unsigned long, pfn) | ||
| 182 | __string(filename, filename) | ||
| 183 | __field(int, present) | ||
| 184 | __field(int, swap) | ||
| 185 | __field(int, result) | ||
| 186 | ), | ||
| 187 | |||
| 188 | TP_fast_assign( | ||
| 189 | __entry->mm = mm; | ||
| 190 | __entry->pfn = page ? page_to_pfn(page) : -1; | ||
| 191 | __assign_str(filename, filename); | ||
| 192 | __entry->present = present; | ||
| 193 | __entry->swap = swap; | ||
| 194 | __entry->result = result; | ||
| 195 | ), | ||
| 196 | |||
| 197 | TP_printk("mm=%p, scan_pfn=0x%lx, filename=%s, present=%d, swap=%d, result=%s", | ||
| 198 | __entry->mm, | ||
| 199 | __entry->pfn, | ||
| 200 | __get_str(filename), | ||
| 201 | __entry->present, | ||
| 202 | __entry->swap, | ||
| 203 | __print_symbolic(__entry->result, SCAN_STATUS)) | ||
| 204 | ); | ||
| 205 | |||
| 172 | #endif /* __HUGE_MEMORY_H */ | 206 | #endif /* __HUGE_MEMORY_H */ |
| 173 | #include <trace/define_trace.h> | 207 | #include <trace/define_trace.h> |