1 #undef TRACE_SYSTEM 2 #define TRACE_SYSTEM migrate 3 4 #if !defined(_TRACE_MIGRATE_H) || defined(TRACE_HEADER_MULTI_READ) 5 #define _TRACE_MIGRATE_H 6 7 #include <linux/tracepoint.h> 8 9 #define MIGRATE_MODE \ 10 {MIGRATE_ASYNC, "MIGRATE_ASYNC"}, \ 11 {MIGRATE_SYNC_LIGHT, "MIGRATE_SYNC_LIGHT"}, \ 12 {MIGRATE_SYNC, "MIGRATE_SYNC"} 13 14 #define MIGRATE_REASON \ 15 {MR_COMPACTION, "compaction"}, \ 16 {MR_MEMORY_FAILURE, "memory_failure"}, \ 17 {MR_MEMORY_HOTPLUG, "memory_hotplug"}, \ 18 {MR_SYSCALL, "syscall_or_cpuset"}, \ 19 {MR_MEMPOLICY_MBIND, "mempolicy_mbind"}, \ 20 {MR_NUMA_MISPLACED, "numa_misplaced"}, \ 21 {MR_CMA, "cma"} 22 23 TRACE_EVENT(mm_migrate_pages, 24 25 TP_PROTO(unsigned long succeeded, unsigned long failed, 26 enum migrate_mode mode, int reason), 27 28 TP_ARGS(succeeded, failed, mode, reason), 29 30 TP_STRUCT__entry( 31 __field( unsigned long, succeeded) 32 __field( unsigned long, failed) 33 __field( enum migrate_mode, mode) 34 __field( int, reason) 35 ), 36 37 TP_fast_assign( 38 __entry->succeeded = succeeded; 39 __entry->failed = failed; 40 __entry->mode = mode; 41 __entry->reason = reason; 42 ), 43 44 TP_printk("nr_succeeded=%lu nr_failed=%lu mode=%s reason=%s", 45 __entry->succeeded, 46 __entry->failed, 47 __print_symbolic(__entry->mode, MIGRATE_MODE), 48 __print_symbolic(__entry->reason, MIGRATE_REASON)) 49 ); 50 51 TRACE_EVENT(mm_numa_migrate_ratelimit, 52 53 TP_PROTO(struct task_struct *p, int dst_nid, unsigned long nr_pages), 54 55 TP_ARGS(p, dst_nid, nr_pages), 56 57 TP_STRUCT__entry( 58 __array( char, comm, TASK_COMM_LEN) 59 __field( pid_t, pid) 60 __field( int, dst_nid) 61 __field( unsigned long, nr_pages) 62 ), 63 64 TP_fast_assign( 65 memcpy(__entry->comm, p->comm, TASK_COMM_LEN); 66 __entry->pid = p->pid; 67 __entry->dst_nid = dst_nid; 68 __entry->nr_pages = nr_pages; 69 ), 70 71 TP_printk("comm=%s pid=%d dst_nid=%d nr_pages=%lu", 72 __entry->comm, 73 __entry->pid, 74 __entry->dst_nid, 75 __entry->nr_pages) 76 ); 77 #endif /* _TRACE_MIGRATE_H */ 78 79 /* This part must be outside protection */ 80 #include <trace/define_trace.h> 81