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

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

Version: ~ [ linux-5.15-rc1 ] ~ [ linux-5.14.5 ] ~ [ linux-5.13.18 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.66 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.147 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.206 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.246 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.282 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.283 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.18.140 ] ~ [ linux-3.16.85 ] ~ [ linux-3.14.79 ] ~ [ linux-3.12.74 ] ~ [ 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.5 ] ~ [ 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         EMe(MR_CMA,             "cma")
 24 
 25 /*
 26  * First define the enums in the above macros to be exported to userspace
 27  * via TRACE_DEFINE_ENUM().
 28  */
 29 #undef EM
 30 #undef EMe
 31 #define EM(a, b)        TRACE_DEFINE_ENUM(a);
 32 #define EMe(a, b)       TRACE_DEFINE_ENUM(a);
 33 
 34 MIGRATE_MODE
 35 MIGRATE_REASON
 36 
 37 /*
 38  * Now redefine the EM() and EMe() macros to map the enums to the strings
 39  * that will be printed in the output.
 40  */
 41 #undef EM
 42 #undef EMe
 43 #define EM(a, b)        {a, b},
 44 #define EMe(a, b)       {a, b}
 45 
 46 TRACE_EVENT(mm_migrate_pages,
 47 
 48         TP_PROTO(unsigned long succeeded, unsigned long failed,
 49                  enum migrate_mode mode, int reason),
 50 
 51         TP_ARGS(succeeded, failed, mode, reason),
 52 
 53         TP_STRUCT__entry(
 54                 __field(        unsigned long,          succeeded)
 55                 __field(        unsigned long,          failed)
 56                 __field(        enum migrate_mode,      mode)
 57                 __field(        int,                    reason)
 58         ),
 59 
 60         TP_fast_assign(
 61                 __entry->succeeded      = succeeded;
 62                 __entry->failed         = failed;
 63                 __entry->mode           = mode;
 64                 __entry->reason         = reason;
 65         ),
 66 
 67         TP_printk("nr_succeeded=%lu nr_failed=%lu mode=%s reason=%s",
 68                 __entry->succeeded,
 69                 __entry->failed,
 70                 __print_symbolic(__entry->mode, MIGRATE_MODE),
 71                 __print_symbolic(__entry->reason, MIGRATE_REASON))
 72 );
 73 
 74 TRACE_EVENT(mm_numa_migrate_ratelimit,
 75 
 76         TP_PROTO(struct task_struct *p, int dst_nid, unsigned long nr_pages),
 77 
 78         TP_ARGS(p, dst_nid, nr_pages),
 79 
 80         TP_STRUCT__entry(
 81                 __array(        char,           comm,   TASK_COMM_LEN)
 82                 __field(        pid_t,          pid)
 83                 __field(        int,            dst_nid)
 84                 __field(        unsigned long,  nr_pages)
 85         ),
 86 
 87         TP_fast_assign(
 88                 memcpy(__entry->comm, p->comm, TASK_COMM_LEN);
 89                 __entry->pid            = p->pid;
 90                 __entry->dst_nid        = dst_nid;
 91                 __entry->nr_pages       = nr_pages;
 92         ),
 93 
 94         TP_printk("comm=%s pid=%d dst_nid=%d nr_pages=%lu",
 95                 __entry->comm,
 96                 __entry->pid,
 97                 __entry->dst_nid,
 98                 __entry->nr_pages)
 99 );
100 #endif /* _TRACE_MIGRATE_H */
101 
102 /* This part must be outside protection */
103 #include <trace/define_trace.h>
104 

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

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | 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.

osdn.jp