1 /* SPDX-License-Identifier: GPL-2.0 */
3 * amd-pstate-trace.h - AMD Processor P-state Frequency Driver Tracer
5 * Copyright (C) 2021 Advanced Micro Devices, Inc. All Rights Reserved.
10 #if !defined(_AMD_PSTATE_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
11 #define _AMD_PSTATE_TRACE_H
13 #include <linux/cpufreq.h>
14 #include <linux/tracepoint.h>
15 #include <linux/trace_events.h>
18 #define TRACE_SYSTEM amd_cpu
20 #undef TRACE_INCLUDE_FILE
21 #define TRACE_INCLUDE_FILE amd-pstate-trace
23 #define TPS(x) tracepoint_string(x)
25 TRACE_EVENT(amd_pstate_perf,
27 TP_PROTO(unsigned long min_perf,
28 unsigned long target_perf,
29 unsigned long capacity,
44 __field(unsigned long, min_perf)
45 __field(unsigned long, target_perf)
46 __field(unsigned long, capacity)
47 __field(unsigned int, cpu_id)
48 __field(bool, changed)
49 __field(bool, fast_switch)
53 __entry->min_perf = min_perf;
54 __entry->target_perf = target_perf;
55 __entry->capacity = capacity;
56 __entry->cpu_id = cpu_id;
57 __entry->changed = changed;
58 __entry->fast_switch = fast_switch;
61 TP_printk("amd_min_perf=%lu amd_des_perf=%lu amd_max_perf=%lu cpu_id=%u changed=%s fast_switch=%s",
62 (unsigned long)__entry->min_perf,
63 (unsigned long)__entry->target_perf,
64 (unsigned long)__entry->capacity,
65 (unsigned int)__entry->cpu_id,
66 (__entry->changed) ? "true" : "false",
67 (__entry->fast_switch) ? "true" : "false"
71 #endif /* _AMD_PSTATE_TRACE_H */
73 /* This part must be outside protection */
74 #undef TRACE_INCLUDE_PATH
75 #define TRACE_INCLUDE_PATH .
77 #include <trace/define_trace.h>