drivers/cpufreq/amd-pstate-trace.h

Source file repositories/reference/linux-study-clean/drivers/cpufreq/amd-pstate-trace.h

File Facts

System
Linux kernel
Corpus path
drivers/cpufreq/amd-pstate-trace.h
Extension
.h
Size
3692 bytes
Lines
178
Domain
Driver Families
Bucket
drivers/cpufreq
Inferred role
Driver Families: implementation source
Status
source implementation candidate

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

#if !defined(_AMD_PSTATE_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
#define _AMD_PSTATE_TRACE_H

#include <linux/cpufreq.h>
#include <linux/tracepoint.h>
#include <linux/trace_events.h>

#undef TRACE_SYSTEM
#define TRACE_SYSTEM amd_cpu

#undef TRACE_INCLUDE_FILE
#define TRACE_INCLUDE_FILE amd-pstate-trace

#define TPS(x)  tracepoint_string(x)

TRACE_EVENT(amd_pstate_perf,

	TP_PROTO(u8 min_perf,
		 u8 target_perf,
		 u8 capacity,
		 u64 freq,
		 u64 mperf,
		 u64 aperf,
		 u64 tsc,
		 unsigned int cpu_id,
		 bool fast_switch
		 ),

	TP_ARGS(min_perf,
		target_perf,
		capacity,
		freq,
		mperf,
		aperf,
		tsc,
		cpu_id,
		fast_switch
		),

	TP_STRUCT__entry(
		__field(u8, min_perf)
		__field(u8, target_perf)
		__field(u8, capacity)
		__field(unsigned long long, freq)
		__field(unsigned long long, mperf)
		__field(unsigned long long, aperf)
		__field(unsigned long long, tsc)
		__field(unsigned int, cpu_id)
		__field(bool, fast_switch)
		),

	TP_fast_assign(
		__entry->min_perf = min_perf;
		__entry->target_perf = target_perf;
		__entry->capacity = capacity;
		__entry->freq = freq;
		__entry->mperf = mperf;
		__entry->aperf = aperf;
		__entry->tsc = tsc;
		__entry->cpu_id = cpu_id;
		__entry->fast_switch = fast_switch;
		),

	TP_printk("amd_min_perf=%hhu amd_des_perf=%hhu amd_max_perf=%hhu freq=%llu mperf=%llu aperf=%llu tsc=%llu cpu_id=%u fast_switch=%s",
		  (u8)__entry->min_perf,
		  (u8)__entry->target_perf,
		  (u8)__entry->capacity,
		  (unsigned long long)__entry->freq,
		  (unsigned long long)__entry->mperf,
		  (unsigned long long)__entry->aperf,
		  (unsigned long long)__entry->tsc,
		  (unsigned int)__entry->cpu_id,
		  (__entry->fast_switch) ? "true" : "false"
		 )
);

TRACE_EVENT(amd_pstate_epp_perf,

	TP_PROTO(unsigned int cpu_id,
		 u8 highest_perf,
		 u8 epp,
		 u8 min_perf,
		 u8 max_perf,
		 bool boost,
		 bool changed
		 ),

	TP_ARGS(cpu_id,
		highest_perf,
		epp,

Annotation

Implementation Notes