2 #define TRACE_SYSTEM migrate
4 #if !defined(_TRACE_MIGRATE_H) || defined(TRACE_HEADER_MULTI_READ)
5 #define _TRACE_MIGRATE_H
7 #include <linux/tracepoint.h>
10 EM( MIGRATE_ASYNC, "MIGRATE_ASYNC") \
11 EM( MIGRATE_SYNC_LIGHT, "MIGRATE_SYNC_LIGHT") \
12 EMe(MIGRATE_SYNC, "MIGRATE_SYNC")
15 #define MIGRATE_REASON \
16 EM( MR_COMPACTION, "compaction") \
17 EM( MR_MEMORY_FAILURE, "memory_failure") \
18 EM( MR_MEMORY_HOTPLUG, "memory_hotplug") \
19 EM( MR_SYSCALL, "syscall_or_cpuset") \
20 EM( MR_MEMPOLICY_MBIND, "mempolicy_mbind") \
21 EM( MR_NUMA_MISPLACED, "numa_misplaced") \
25 * First define the enums in the above macros to be exported to userspace
26 * via TRACE_DEFINE_ENUM().
30 #define EM(a, b) TRACE_DEFINE_ENUM(a);
31 #define EMe(a, b) TRACE_DEFINE_ENUM(a);
37 * Now redefine the EM() and EMe() macros to map the enums to the strings
38 * that will be printed in the output.
42 #define EM(a, b) {a, b},
43 #define EMe(a, b) {a, b}
45 TRACE_EVENT(mm_migrate_pages
,
47 TP_PROTO(unsigned long succeeded
, unsigned long failed
,
48 enum migrate_mode mode
, int reason
),
50 TP_ARGS(succeeded
, failed
, mode
, reason
),
53 __field( unsigned long, succeeded
)
54 __field( unsigned long, failed
)
55 __field( enum migrate_mode
, mode
)
60 __entry
->succeeded
= succeeded
;
61 __entry
->failed
= failed
;
63 __entry
->reason
= reason
;
66 TP_printk("nr_succeeded=%lu nr_failed=%lu mode=%s reason=%s",
69 __print_symbolic(__entry
->mode
, MIGRATE_MODE
),
70 __print_symbolic(__entry
->reason
, MIGRATE_REASON
))
73 TRACE_EVENT(mm_numa_migrate_ratelimit
,
75 TP_PROTO(struct task_struct
*p
, int dst_nid
, unsigned long nr_pages
),
77 TP_ARGS(p
, dst_nid
, nr_pages
),
80 __array( char, comm
, TASK_COMM_LEN
)
82 __field( int, dst_nid
)
83 __field( unsigned long, nr_pages
)
87 memcpy(__entry
->comm
, p
->comm
, TASK_COMM_LEN
);
88 __entry
->pid
= p
->pid
;
89 __entry
->dst_nid
= dst_nid
;
90 __entry
->nr_pages
= nr_pages
;
93 TP_printk("comm=%s pid=%d dst_nid=%d nr_pages=%lu",
99 #endif /* _TRACE_MIGRATE_H */
101 /* This part must be outside protection */
102 #include <trace/define_trace.h>