~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/trace/events/migrate.h

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 */
  2 #undef TRACE_SYSTEM
  3 #define TRACE_SYSTEM migrate
  4 
  5 #if !defined(_TRACE_MIGRATE_H) || defined(TRACE_HEADER_MULTI_READ)
  6 #define _TRACE_MIGRATE_H
  7 
  8 #include <linux/tracepoint.h>
  9 
 10 #define MIGRATE_MODE                                            \
 11         EM( MIGRATE_ASYNC,      "MIGRATE_ASYNC")                \
 12         EM( MIGRATE_SYNC_LIGHT, "MIGRATE_SYNC_LIGHT")           \
 13         EMe(MIGRATE_SYNC,       "MIGRATE_SYNC")
 14 
 15 
 16 #define MIGRATE_REASON                                          \
 17         EM( MR_COMPACTION,      "compaction")                   \
 18         EM( MR_MEMORY_FAILURE,  "memory_failure")               \
 19         EM( MR_MEMORY_HOTPLUG,  "memory_hotplug")               \
 20         EM( MR_SYSCALL,         "syscall_or_cpuset")            \
 21         EM( MR_MEMPOLICY_MBIND, "mempolicy_mbind")              \
 22         EM( MR_NUMA_MISPLACED,  "numa_misplaced")               \
 23         EM( MR_CONTIG_RANGE,    "contig_range")                 \
 24         EM( MR_LONGTERM_PIN,    "longterm_pin")                 \
 25         EM( MR_DEMOTION,        "demotion")                     \
 26         EMe(MR_DAMON,           "damon")
 27 
 28 /*
 29  * First define the enums in the above macros to be exported to userspace
 30  * via TRACE_DEFINE_ENUM().
 31  */
 32 #undef EM
 33 #undef EMe
 34 #define EM(a, b)        TRACE_DEFINE_ENUM(a);
 35 #define EMe(a, b)       TRACE_DEFINE_ENUM(a);
 36 
 37 MIGRATE_MODE
 38 MIGRATE_REASON
 39 
 40 /*
 41  * Now redefine the EM() and EMe() macros to map the enums to the strings
 42  * that will be printed in the output.
 43  */
 44 #undef EM
 45 #undef EMe
 46 #define EM(a, b)        {a, b},
 47 #define EMe(a, b)       {a, b}
 48 
 49 TRACE_EVENT(mm_migrate_pages,
 50 
 51         TP_PROTO(unsigned long succeeded, unsigned long failed,
 52                  unsigned long thp_succeeded, unsigned long thp_failed,
 53                  unsigned long thp_split, unsigned long large_folio_split,
 54                  enum migrate_mode mode, int reason),
 55 
 56         TP_ARGS(succeeded, failed, thp_succeeded, thp_failed,
 57                 thp_split, large_folio_split, mode, reason),
 58 
 59         TP_STRUCT__entry(
 60                 __field(        unsigned long,          succeeded)
 61                 __field(        unsigned long,          failed)
 62                 __field(        unsigned long,          thp_succeeded)
 63                 __field(        unsigned long,          thp_failed)
 64                 __field(        unsigned long,          thp_split)
 65                 __field(        unsigned long,          large_folio_split)
 66                 __field(        enum migrate_mode,      mode)
 67                 __field(        int,                    reason)
 68         ),
 69 
 70         TP_fast_assign(
 71                 __entry->succeeded                      = succeeded;
 72                 __entry->failed                         = failed;
 73                 __entry->thp_succeeded          = thp_succeeded;
 74                 __entry->thp_failed                     = thp_failed;
 75                 __entry->thp_split                      = thp_split;
 76                 __entry->large_folio_split      = large_folio_split;
 77                 __entry->mode                           = mode;
 78                 __entry->reason                         = reason;
 79         ),
 80 
 81         TP_printk("nr_succeeded=%lu nr_failed=%lu nr_thp_succeeded=%lu nr_thp_failed=%lu nr_thp_split=%lu nr_split=%lu mode=%s reason=%s",
 82                 __entry->succeeded,
 83                 __entry->failed,
 84                 __entry->thp_succeeded,
 85                 __entry->thp_failed,
 86                 __entry->thp_split,
 87                 __entry->large_folio_split,
 88                 __print_symbolic(__entry->mode, MIGRATE_MODE),
 89                 __print_symbolic(__entry->reason, MIGRATE_REASON))
 90 );
 91 
 92 TRACE_EVENT(mm_migrate_pages_start,
 93 
 94         TP_PROTO(enum migrate_mode mode, int reason),
 95 
 96         TP_ARGS(mode, reason),
 97 
 98         TP_STRUCT__entry(
 99                 __field(enum migrate_mode, mode)
100                 __field(int, reason)
101         ),
102 
103         TP_fast_assign(
104                 __entry->mode   = mode;
105                 __entry->reason = reason;
106         ),
107 
108         TP_printk("mode=%s reason=%s",
109                   __print_symbolic(__entry->mode, MIGRATE_MODE),
110                   __print_symbolic(__entry->reason, MIGRATE_REASON))
111 );
112 
113 DECLARE_EVENT_CLASS(migration_pte,
114 
115                 TP_PROTO(unsigned long addr, unsigned long pte, int order),
116 
117                 TP_ARGS(addr, pte, order),
118 
119                 TP_STRUCT__entry(
120                         __field(unsigned long, addr)
121                         __field(unsigned long, pte)
122                         __field(int, order)
123                 ),
124 
125                 TP_fast_assign(
126                         __entry->addr = addr;
127                         __entry->pte = pte;
128                         __entry->order = order;
129                 ),
130 
131                 TP_printk("addr=%lx, pte=%lx order=%d", __entry->addr, __entry->pte, __entry->order)
132 );
133 
134 DEFINE_EVENT(migration_pte, set_migration_pte,
135         TP_PROTO(unsigned long addr, unsigned long pte, int order),
136         TP_ARGS(addr, pte, order)
137 );
138 
139 DEFINE_EVENT(migration_pte, remove_migration_pte,
140         TP_PROTO(unsigned long addr, unsigned long pte, int order),
141         TP_ARGS(addr, pte, order)
142 );
143 
144 #endif /* _TRACE_MIGRATE_H */
145 
146 /* This part must be outside protection */
147 #include <trace/define_trace.h>
148 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php