Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #undef TRACE_SYSTEM
0003 #define TRACE_SYSTEM ipi
0004 
0005 #if !defined(_TRACE_IPI_H) || defined(TRACE_HEADER_MULTI_READ)
0006 #define _TRACE_IPI_H
0007 
0008 #include <linux/tracepoint.h>
0009 
0010 /**
0011  * ipi_raise - called when a smp cross call is made
0012  *
0013  * @mask: mask of recipient CPUs for the IPI
0014  * @reason: string identifying the IPI purpose
0015  *
0016  * It is necessary for @reason to be a static string declared with
0017  * __tracepoint_string.
0018  */
0019 TRACE_EVENT(ipi_raise,
0020 
0021     TP_PROTO(const struct cpumask *mask, const char *reason),
0022 
0023     TP_ARGS(mask, reason),
0024 
0025     TP_STRUCT__entry(
0026         __bitmask(target_cpus, nr_cpumask_bits)
0027         __field(const char *, reason)
0028     ),
0029 
0030     TP_fast_assign(
0031         __assign_bitmask(target_cpus, cpumask_bits(mask), nr_cpumask_bits);
0032         __entry->reason = reason;
0033     ),
0034 
0035     TP_printk("target_mask=%s (%s)", __get_bitmask(target_cpus), __entry->reason)
0036 );
0037 
0038 DECLARE_EVENT_CLASS(ipi_handler,
0039 
0040     TP_PROTO(const char *reason),
0041 
0042     TP_ARGS(reason),
0043 
0044     TP_STRUCT__entry(
0045         __field(const char *, reason)
0046     ),
0047 
0048     TP_fast_assign(
0049         __entry->reason = reason;
0050     ),
0051 
0052     TP_printk("(%s)", __entry->reason)
0053 );
0054 
0055 /**
0056  * ipi_entry - called immediately before the IPI handler
0057  *
0058  * @reason: string identifying the IPI purpose
0059  *
0060  * It is necessary for @reason to be a static string declared with
0061  * __tracepoint_string, ideally the same as used with trace_ipi_raise
0062  * for that IPI.
0063  */
0064 DEFINE_EVENT(ipi_handler, ipi_entry,
0065 
0066     TP_PROTO(const char *reason),
0067 
0068     TP_ARGS(reason)
0069 );
0070 
0071 /**
0072  * ipi_exit - called immediately after the IPI handler returns
0073  *
0074  * @reason: string identifying the IPI purpose
0075  *
0076  * It is necessary for @reason to be a static string declared with
0077  * __tracepoint_string, ideally the same as used with trace_ipi_raise for
0078  * that IPI.
0079  */
0080 DEFINE_EVENT(ipi_handler, ipi_exit,
0081 
0082     TP_PROTO(const char *reason),
0083 
0084     TP_ARGS(reason)
0085 );
0086 
0087 #endif /* _TRACE_IPI_H */
0088 
0089 /* This part must be outside protection */
0090 #include <trace/define_trace.h>