mirror of
https://github.com/armbian/linux-cix.git
synced 2026-01-06 12:30:45 -08:00
CIX P1 2025Q3 RELEASE
This commit is contained in:
38
include/trace/events/dsu_pctrl.h
Normal file
38
include/trace/events/dsu_pctrl.h
Normal file
@@ -0,0 +1,38 @@
|
||||
#undef TRACE_SYSTEM
|
||||
#define TRACE_SYSTEM dsu_pctrl
|
||||
|
||||
#if !defined(_TRACE_DSU_PCTRL_H) || defined(TRACE_HEADER_MULTI_READ)
|
||||
#define _TRACE_DSU_PCTRL_H
|
||||
|
||||
#include <linux/tracepoint.h>
|
||||
|
||||
TRACE_EVENT(dsu_pctrl_dev_status,
|
||||
TP_PROTO(int dsu_id, unsigned long hits, unsigned long misses,
|
||||
unsigned long freq, unsigned long busy_time,
|
||||
unsigned long total_time),
|
||||
TP_ARGS(dsu_id, hits, misses, freq, busy_time, total_time),
|
||||
TP_STRUCT__entry(
|
||||
__field(int, dsu_id)
|
||||
__field(unsigned long, hits)
|
||||
__field(unsigned long, misses)
|
||||
__field(unsigned long, freq)
|
||||
__field(unsigned long, busy_time)
|
||||
__field(unsigned long, total_time)
|
||||
),
|
||||
TP_fast_assign(
|
||||
__entry->dsu_id = dsu_id;
|
||||
__entry->hits = hits;
|
||||
__entry->misses = misses;
|
||||
__entry->freq = freq;
|
||||
__entry->busy_time = busy_time;
|
||||
__entry->total_time = total_time;
|
||||
),
|
||||
|
||||
TP_printk("dsu_dev_id=%d hits=%lu misses=%lu cur_freq=%lu busy_time=%lu total_time=%lu",
|
||||
__entry->dsu_id, __entry->hits, __entry->misses,
|
||||
__entry->freq, __entry->busy_time, __entry->total_time)
|
||||
);
|
||||
#endif /* _TRACE_DSU_PCTRL_H */
|
||||
|
||||
/* This part must be outside protection */
|
||||
#include <trace/define_trace.h>
|
||||
64
include/trace/hooks/sched.h
Executable file
64
include/trace/hooks/sched.h
Executable file
@@ -0,0 +1,64 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
#undef TRACE_SYSTEM
|
||||
#define TRACE_SYSTEM sched
|
||||
#define TRACE_INCLUDE_PATH trace/hooks
|
||||
#if !defined(_TRACE_HOOK_SCHED_H) || defined(TRACE_HEADER_MULTI_READ)
|
||||
#define _TRACE_HOOK_SCHED_H
|
||||
|
||||
#include <trace/hooks/vendor_hooks.h>
|
||||
|
||||
/*
|
||||
* Following tracepoints are not exported in tracefs and provide a
|
||||
* mechanism for vendor modules to hook and extend functionality
|
||||
*/
|
||||
struct task_struct;
|
||||
|
||||
DECLARE_RESTRICTED_HOOK(android_rvh_enqueue_task_fair,
|
||||
TP_PROTO(struct rq *rq, struct task_struct *p, int flags),
|
||||
TP_ARGS(rq, p, flags), 1);
|
||||
|
||||
DECLARE_RESTRICTED_HOOK(android_rvh_dequeue_task_fair,
|
||||
TP_PROTO(struct rq *rq, struct task_struct *p, int flags),
|
||||
TP_ARGS(rq, p, flags), 1);
|
||||
|
||||
struct rq;
|
||||
DECLARE_HOOK(android_vh_scheduler_tick,
|
||||
TP_PROTO(struct rq *rq),
|
||||
TP_ARGS(rq));
|
||||
|
||||
DECLARE_RESTRICTED_HOOK(android_rvh_is_cpu_allowed,
|
||||
TP_PROTO(struct task_struct *p, int cpu, bool *allowed),
|
||||
TP_ARGS(p, cpu, allowed), 1);
|
||||
|
||||
DECLARE_RESTRICTED_HOOK(android_rvh_set_cpus_allowed_by_task,
|
||||
TP_PROTO(const struct cpumask *cpu_valid_mask, const struct cpumask *new_mask,
|
||||
struct task_struct *p, unsigned int *dest_cpu),
|
||||
TP_ARGS(cpu_valid_mask, new_mask, p, dest_cpu), 1);
|
||||
|
||||
DECLARE_RESTRICTED_HOOK(android_rvh_rto_next_cpu,
|
||||
TP_PROTO(int rto_cpu, struct cpumask *rto_mask, int *cpu),
|
||||
TP_ARGS(rto_cpu, rto_mask, cpu), 1);
|
||||
|
||||
DECLARE_RESTRICTED_HOOK(android_rvh_get_nohz_timer_target,
|
||||
TP_PROTO(int *cpu, bool *done),
|
||||
TP_ARGS(cpu, done), 1);
|
||||
|
||||
DECLARE_RESTRICTED_HOOK(android_rvh_can_migrate_task,
|
||||
TP_PROTO(struct task_struct *p, int dst_cpu, int *can_migrate),
|
||||
TP_ARGS(p, dst_cpu, can_migrate), 1);
|
||||
|
||||
DECLARE_RESTRICTED_HOOK(android_rvh_find_busiest_queue,
|
||||
TP_PROTO(int dst_cpu, struct sched_group *group,
|
||||
struct cpumask *env_cpus, struct rq **busiest,
|
||||
int *done),
|
||||
TP_ARGS(dst_cpu, group, env_cpus, busiest, done), 1);
|
||||
|
||||
DECLARE_RESTRICTED_HOOK(android_rvh_find_new_ilb,
|
||||
TP_PROTO(struct cpumask *nohz_idle_cpus_mask, int *ilb),
|
||||
TP_ARGS(nohz_idle_cpus_mask, ilb), 1);
|
||||
|
||||
/* macro versions of hooks are no longer required */
|
||||
|
||||
#endif /* _TRACE_HOOK_SCHED_H */
|
||||
/* This part must be outside protection */
|
||||
#include <trace/define_trace.h>
|
||||
122
include/trace/hooks/vendor_hooks.h
Executable file
122
include/trace/hooks/vendor_hooks.h
Executable file
@@ -0,0 +1,122 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
|
||||
/*
|
||||
* Note: we intentionally omit include file ifdef protection
|
||||
* This is due to the way trace events work. If a file includes two
|
||||
* trace event headers under one "CREATE_TRACE_POINTS" the first include
|
||||
* will override the DECLARE_RESTRICTED_HOOK and break the second include.
|
||||
*/
|
||||
|
||||
#ifndef __GENKSYMS__
|
||||
#include <linux/tracepoint.h>
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_TRACEPOINTS) && defined(CONFIG_CIX_VENDOR_HOOKS)
|
||||
|
||||
#define DECLARE_HOOK DECLARE_TRACE
|
||||
|
||||
int android_rvh_probe_register(struct tracepoint *tp, void *probe, void *data);
|
||||
|
||||
#ifdef TRACE_HEADER_MULTI_READ
|
||||
|
||||
#define DEFINE_HOOK_FN(_name, _reg, _unreg, proto, args) \
|
||||
static const char __tpstrtab_##_name[] \
|
||||
__section("__tracepoints_strings") = #_name; \
|
||||
extern struct static_call_key STATIC_CALL_KEY(tp_func_##_name); \
|
||||
int __traceiter_##_name(void *__data, proto); \
|
||||
struct tracepoint __tracepoint_##_name __used \
|
||||
__section("__tracepoints") = { \
|
||||
.name = __tpstrtab_##_name, \
|
||||
.key = STATIC_KEY_INIT_FALSE, \
|
||||
.static_call_key = &STATIC_CALL_KEY(tp_func_##_name), \
|
||||
.static_call_tramp = STATIC_CALL_TRAMP_ADDR(tp_func_##_name), \
|
||||
.iterator = &__traceiter_##_name, \
|
||||
.regfunc = _reg, \
|
||||
.unregfunc = _unreg, \
|
||||
.funcs = NULL }; \
|
||||
__TRACEPOINT_ENTRY(_name); \
|
||||
int __traceiter_##_name(void *__data, proto) \
|
||||
{ \
|
||||
struct tracepoint_func *it_func_ptr; \
|
||||
void *it_func; \
|
||||
\
|
||||
it_func_ptr = (&__tracepoint_##_name)->funcs; \
|
||||
it_func = (it_func_ptr)->func; \
|
||||
do { \
|
||||
__data = (it_func_ptr)->data; \
|
||||
((void(*)(void *, proto))(it_func))(__data, args); \
|
||||
it_func = READ_ONCE((++it_func_ptr)->func); \
|
||||
} while (it_func); \
|
||||
return 0; \
|
||||
} \
|
||||
DEFINE_STATIC_CALL(tp_func_##_name, __traceiter_##_name);
|
||||
|
||||
#undef DECLARE_RESTRICTED_HOOK
|
||||
#define DECLARE_RESTRICTED_HOOK(name, proto, args, cond) \
|
||||
DEFINE_HOOK_FN(name, NULL, NULL, PARAMS(proto), PARAMS(args))
|
||||
|
||||
/* prevent additional recursion */
|
||||
#undef TRACE_HEADER_MULTI_READ
|
||||
#else /* TRACE_HEADER_MULTI_READ */
|
||||
|
||||
#ifdef CONFIG_HAVE_STATIC_CALL
|
||||
#define __DO_RESTRICTED_HOOK_CALL(name, args) \
|
||||
do { \
|
||||
struct tracepoint_func *it_func_ptr; \
|
||||
void *__data; \
|
||||
it_func_ptr = (&__tracepoint_##name)->funcs; \
|
||||
if (it_func_ptr) { \
|
||||
__data = (it_func_ptr)->data; \
|
||||
static_call(tp_func_##name)(__data, args); \
|
||||
} \
|
||||
} while (0)
|
||||
#else
|
||||
#define __DO_RESTRICTED_HOOK_CALL(name, args) __traceiter_##name(NULL, args)
|
||||
#endif
|
||||
|
||||
#define DO_RESTRICTED_HOOK(name, args, cond) \
|
||||
do { \
|
||||
if (!(cond)) \
|
||||
return; \
|
||||
\
|
||||
__DO_RESTRICTED_HOOK_CALL(name, TP_ARGS(args)); \
|
||||
} while (0)
|
||||
|
||||
#define __DECLARE_RESTRICTED_HOOK(name, proto, args, cond, data_proto) \
|
||||
extern int __traceiter_##name(data_proto); \
|
||||
DECLARE_STATIC_CALL(tp_func_##name, __traceiter_##name); \
|
||||
extern struct tracepoint __tracepoint_##name; \
|
||||
static inline void trace_##name(proto) \
|
||||
{ \
|
||||
if (static_key_false(&__tracepoint_##name.key)) \
|
||||
DO_RESTRICTED_HOOK(name, \
|
||||
TP_ARGS(args), \
|
||||
TP_CONDITION(cond)); \
|
||||
} \
|
||||
static inline bool \
|
||||
trace_##name##_enabled(void) \
|
||||
{ \
|
||||
return static_key_false(&__tracepoint_##name.key); \
|
||||
} \
|
||||
static inline int \
|
||||
register_trace_##name(void (*probe)(data_proto), void *data) \
|
||||
{ \
|
||||
return android_rvh_probe_register(&__tracepoint_##name, \
|
||||
(void *)probe, data); \
|
||||
} \
|
||||
/* vendor hooks cannot be unregistered */ \
|
||||
|
||||
#undef DECLARE_RESTRICTED_HOOK
|
||||
#define DECLARE_RESTRICTED_HOOK(name, proto, args, cond) \
|
||||
__DECLARE_RESTRICTED_HOOK(name, PARAMS(proto), PARAMS(args), \
|
||||
cond, \
|
||||
PARAMS(void *__data, proto))
|
||||
|
||||
#endif /* TRACE_HEADER_MULTI_READ */
|
||||
|
||||
#else /* !CONFIG_TRACEPOINTS || !CONFIG_CIX_VENDOR_HOOKS */
|
||||
/* suppress trace hooks */
|
||||
#define DECLARE_HOOK DECLARE_EVENT_NOP
|
||||
#define DECLARE_RESTRICTED_HOOK(name, proto, args, cond) \
|
||||
DECLARE_EVENT_NOP(name, PARAMS(proto), PARAMS(args))
|
||||
#endif
|
||||
Reference in New Issue
Block a user