-
Notifications
You must be signed in to change notification settings - Fork 1
/
rt-plot.h
87 lines (74 loc) · 2.56 KB
/
rt-plot.h
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
/**
* Common functionality for all real-time plots.
*/
#ifndef __RT_PLOT_H
#define __RT_PLOT_H
#include <gtk/gtk.h>
#include "trace-cmd.h"
struct graph_plot;
struct graph_info;
struct rt_plot_common;
typedef int (*record_matches_cb)(struct rt_plot_common *rt,
struct graph_info *ginfo,
struct record *record);
typedef int (*is_drawn_cb)(struct graph_info *ginfo, int eid);
typedef struct record* (*write_header_cb)(struct rt_plot_common *rt,
struct graph_info *ginfo,
struct trace_seq *s,
unsigned long long time);
typedef int (*iterate_cb)(struct graph_info *ginfo, struct record *record, void *data);
struct job_info {
unsigned long long release;
unsigned long long deadline;
unsigned long long start;
unsigned long long end;
unsigned long long no;
};
struct rt_plot_common {
record_matches_cb record_matches;
is_drawn_cb is_drawn;
write_header_cb write_header;
/* Cache the current job info. Used in mouseovers to avoid recalulating
* job information when the mouse does not cross job boundaries.
*/
struct job_info last_job;
};
int
rt_plot_display_info(struct graph_info *ginfo, struct graph_plot *plot,
struct trace_seq *s, unsigned long long time);
struct record*
rt_plot_find_record(struct graph_info *ginfo, struct graph_plot *plot,
unsigned long long time);
int
rt_plot_match_time(struct graph_info *ginfo, struct graph_plot *plot,
unsigned long long time);
struct record*
__find_rt_record(struct graph_info *ginfo, struct rt_plot_common *rt,
guint64 time, int display, unsigned long long range);
static inline struct record*
find_rt_record(struct graph_info *ginfo, struct rt_plot_common *rt, guint64 time)
{
return __find_rt_record(ginfo, rt, time, 0, 0);
}
static inline struct record*
find_rt_display_record(struct graph_info *ginfo,
struct rt_plot_common *rt, guint64 time)
{
return __find_rt_record(ginfo, rt, time, 1, 0);
}
long long next_rts(struct graph_info *ginfo, int cpu,
unsigned long long ft_target);
unsigned long long set_cpu_to_rts(struct graph_info *ginfo,
unsigned long long rt_target, int cpu);
unsigned long long set_cpus_to_rts(struct graph_info *ginfo,
unsigned long long rt_target);
int is_task_running(struct graph_info *ginfo,
unsigned long long time,
int pid);
void get_previous_release(struct graph_info *ginfo, struct rt_plot_common *common,
int tid,
unsigned long long time, int *job,
unsigned long long *release,
unsigned long long *deadline);
void iterate(struct graph_info *ginfo, int reverse, iterate_cb cb, void *data);
#endif