Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #undef TRACE_SYSTEM
0003 #define TRACE_SYSTEM tlb
0004 
0005 #if !defined(_TRACE_TLB_H) || defined(TRACE_HEADER_MULTI_READ)
0006 #define _TRACE_TLB_H
0007 
0008 #include <linux/mm_types.h>
0009 #include <linux/tracepoint.h>
0010 
0011 #define TLB_FLUSH_REASON                        \
0012     EM(  TLB_FLUSH_ON_TASK_SWITCH,  "flush on task switch" )    \
0013     EM(  TLB_REMOTE_SHOOTDOWN,  "remote shootdown" )        \
0014     EM(  TLB_LOCAL_SHOOTDOWN,   "local shootdown" )     \
0015     EM(  TLB_LOCAL_MM_SHOOTDOWN,    "local mm shootdown" )      \
0016     EMe( TLB_REMOTE_SEND_IPI,   "remote ipi send" )
0017 
0018 /*
0019  * First define the enums in TLB_FLUSH_REASON to be exported to userspace
0020  * via TRACE_DEFINE_ENUM().
0021  */
0022 #undef EM
0023 #undef EMe
0024 #define EM(a,b)     TRACE_DEFINE_ENUM(a);
0025 #define EMe(a,b)    TRACE_DEFINE_ENUM(a);
0026 
0027 TLB_FLUSH_REASON
0028 
0029 /*
0030  * Now redefine the EM() and EMe() macros to map the enums to the strings
0031  * that will be printed in the output.
0032  */
0033 #undef EM
0034 #undef EMe
0035 #define EM(a,b)     { a, b },
0036 #define EMe(a,b)    { a, b }
0037 
0038 TRACE_EVENT(tlb_flush,
0039 
0040     TP_PROTO(int reason, unsigned long pages),
0041     TP_ARGS(reason, pages),
0042 
0043     TP_STRUCT__entry(
0044         __field(      int, reason)
0045         __field(unsigned long,  pages)
0046     ),
0047 
0048     TP_fast_assign(
0049         __entry->reason = reason;
0050         __entry->pages  = pages;
0051     ),
0052 
0053     TP_printk("pages:%ld reason:%s (%d)",
0054         __entry->pages,
0055         __print_symbolic(__entry->reason, TLB_FLUSH_REASON),
0056         __entry->reason)
0057 );
0058 
0059 #endif /* _TRACE_TLB_H */
0060 
0061 /* This part must be outside protection */
0062 #include <trace/define_trace.h>