1 // SPDX-License-Identifier: GPL-2.0
5 * osnoise_context - read, store, write, restore osnoise configs.
7 struct osnoise_context
{
15 unsigned long long orig_runtime_us
;
16 unsigned long long runtime_us
;
19 unsigned long long orig_period_us
;
20 unsigned long long period_us
;
23 long long orig_timerlat_period_us
;
24 long long timerlat_period_us
;
27 long long orig_tracing_thresh
;
28 long long tracing_thresh
;
30 /* -1 as init value because 0 is disabled */
31 long long orig_stop_us
;
34 /* -1 as init value because 0 is disabled */
35 long long orig_stop_total_us
;
36 long long stop_total_us
;
38 /* -1 as init value because 0 is disabled */
39 long long orig_print_stack
;
40 long long print_stack
;
42 /* -1 as init value because 0 is off */
43 int orig_opt_irq_disable
;
46 /* -1 as init value because 0 is off */
47 int orig_opt_workload
;
52 * *_INIT_VALs are also invalid values, they are used to
55 #define OSNOISE_OPTION_INIT_VAL (-1)
56 #define OSNOISE_TIME_INIT_VAL (0)
58 struct osnoise_context
*osnoise_context_alloc(void);
59 int osnoise_get_context(struct osnoise_context
*context
);
60 void osnoise_put_context(struct osnoise_context
*context
);
62 int osnoise_set_cpus(struct osnoise_context
*context
, char *cpus
);
63 void osnoise_restore_cpus(struct osnoise_context
*context
);
65 int osnoise_set_runtime_period(struct osnoise_context
*context
,
66 unsigned long long runtime
,
67 unsigned long long period
);
68 void osnoise_restore_runtime_period(struct osnoise_context
*context
);
70 int osnoise_set_stop_us(struct osnoise_context
*context
,
72 void osnoise_restore_stop_us(struct osnoise_context
*context
);
74 int osnoise_set_stop_total_us(struct osnoise_context
*context
,
75 long long stop_total_us
);
76 void osnoise_restore_stop_total_us(struct osnoise_context
*context
);
78 int osnoise_set_timerlat_period_us(struct osnoise_context
*context
,
79 long long timerlat_period_us
);
80 void osnoise_restore_timerlat_period_us(struct osnoise_context
*context
);
82 int osnoise_set_tracing_thresh(struct osnoise_context
*context
,
83 long long tracing_thresh
);
84 void osnoise_restore_tracing_thresh(struct osnoise_context
*context
);
86 void osnoise_restore_print_stack(struct osnoise_context
*context
);
87 int osnoise_set_print_stack(struct osnoise_context
*context
,
88 long long print_stack
);
90 int osnoise_set_irq_disable(struct osnoise_context
*context
, bool onoff
);
91 int osnoise_set_workload(struct osnoise_context
*context
, bool onoff
);
94 * osnoise_tool - osnoise based tool definition.
97 struct trace_instance trace
;
98 struct osnoise_context
*context
;
104 void osnoise_destroy_tool(struct osnoise_tool
*top
);
105 struct osnoise_tool
*osnoise_init_tool(char *tool_name
);
106 struct osnoise_tool
*osnoise_init_trace_tool(char *tracer
);
108 int osnoise_hist_main(int argc
, char *argv
[]);
109 int osnoise_top_main(int argc
, char **argv
);
110 int osnoise_main(int argc
, char **argv
);
111 int hwnoise_main(int argc
, char **argv
);