-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathtrace_lse.h
More file actions
88 lines (69 loc) · 2.25 KB
/
Copy pathtrace_lse.h
File metadata and controls
88 lines (69 loc) · 2.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (C) 2025, LunarKernel Project. All rights reserved.
*/
#undef TRACE_SYSTEM
#define TRACE_SYSTEM lse
#if !defined(_TRACE_LSE_H_) || defined(TRACE_HEADER_MULTI_READ)
#define _TRACE_LSE_H_
#include <linux/sched.h>
#include <linux/types.h>
#include <linux/tracepoint.h>
#include "lse_main.h"
TRACE_EVENT(lse_update_history,
TP_PROTO(struct lse_task_struct *lts, struct rq *rq, struct task_struct *p, u32 runtime, int samples, int event),
TP_ARGS(lts, rq, p, runtime, samples, event),
TP_STRUCT__entry(
__array(char, comm, TASK_COMM_LEN)
__field(pid_t, pid)
__field(unsigned int, runtime)
__field(int, samples)
__field(int, event)
__field(unsigned int, demand)
__array(u32, hist, RAVG_HIST_SIZE)
__field(u16, task_util)
__field(int, cpu)),
TP_fast_assign(
memcpy(__entry->comm, p->comm, TASK_COMM_LEN);
__entry->pid = p->pid;
__entry->runtime = runtime;
__entry->samples = samples;
__entry->event = event;
__entry->demand = lts->demand;
memcpy(__entry->hist, lts->sum_history, RAVG_HIST_SIZE * sizeof(u32));
__entry->task_util = lts->demand_scaled,
__entry->cpu = rq->cpu;),
TP_printk("comm=%s[%d]: runtime %u samples %d event %d demand %u (hist: %u %u %u %u %u) task_util %u cpu %d",
__entry->comm, __entry->pid,
__entry->runtime, __entry->samples,
__entry->event,
__entry->demand,
__entry->hist[0], __entry->hist[1],
__entry->hist[2], __entry->hist[3],
__entry->hist[4],
__entry->task_util,
__entry->cpu)
);
TRACE_EVENT(lse_run_window_rollover,
TP_PROTO(u64 old_window_start, u64 new_window_start),
TP_ARGS(old_window_start, new_window_start),
TP_STRUCT__entry(
__field(u64, old_window_start)
__field(u64, new_window_start)
__field(int, cpu)),
TP_fast_assign(
__entry->old_window_start = old_window_start;
__entry->new_window_start = new_window_start;
__entry->cpu = raw_smp_processor_id();),
TP_printk("old_window_start=%llu new_window_start=%llu cpu=%d",
__entry->old_window_start,
__entry->new_window_start,
__entry->cpu)
);
#endif /*_TRACE_LSE_H_ */
#undef TRACE_INCLUDE_PATH
#define TRACE_INCLUDE_PATH .
#undef TRACE_INCLUDE_FILE
#define TRACE_INCLUDE_FILE trace_lse
/* This part must be outside protection */
#include <trace/define_trace.h>