Lines Matching refs:tool
36 * set_signals - handles the signal to stop the tool
48 * unset_signals - unsets the signals to stop the tool
60 * common_apply_config - apply common configs to the initialized tool
63 common_apply_config(struct osnoise_tool *tool, struct common_params *params)
70 retval = osnoise_set_cpus(tool->context, params->cpus ? params->cpus : "all");
104 retval = osnoise_set_workload(tool->context, params->kernel_workload);
119 * @tool: pointer to the osnoise_tool instance containing trace contexts
128 common_threshold_handler(const struct osnoise_tool *tool)
130 actions_perform(&tool->params->threshold_actions);
132 if (!should_continue_tracing(tool->params))
137 if (tool->record && trace_instance_start(&tool->record->trace))
139 if (tool->aa && trace_instance_start(&tool->aa->trace))
153 struct osnoise_tool *tool;
162 tool = ops->init_tool(params);
163 if (!tool) {
164 err_msg("Could not init osnoise tool\n");
167 tool->ops = ops;
168 tool->params = params;
171 * Expose the tool to signal handlers so they can stop the trace.
174 trace_tool = tool;
176 retval = ops->apply_config(tool);
182 retval = enable_tracer_by_name(tool->trace.inst, ops->tracer);
207 tool->record = osnoise_init_trace_tool(ops->tracer);
208 if (!tool->record) {
212 params->threshold_actions.trace_output_inst = tool->record->trace.inst;
213 params->end_actions.trace_output_inst = tool->record->trace.inst;
216 retval = trace_events_enable(&tool->record->trace, params->events);
222 retval = trace_set_buffer_size(&tool->record->trace, params->buffer_size);
251 retval = ops->enable(tool);
255 tool->start_time = time(NULL);
258 retval = ops->main(tool);
267 ops->print_stats(tool);
273 stopped = osnoise_trace_is_off(tool, tool->record) && !stop_tracing;
280 ops->analyze(tool, stopped);
285 trace_events_destroy(&tool->record->trace, params->events);
288 ops->free(tool);
289 osnoise_destroy_tool(tool->record);
290 osnoise_destroy_tool(tool);
298 int top_main_loop(struct osnoise_tool *tool)
300 struct common_params *params = tool->params;
301 struct trace_instance *trace = &tool->trace;
302 struct osnoise_tool *record = tool->record;
308 if (params->aa_only && !osnoise_trace_is_off(tool, record))
323 tool->ops->print_stats(tool);
325 if (osnoise_trace_is_off(tool, record)) {
330 retval = common_threshold_handler(tool);
353 int hist_main_loop(struct osnoise_tool *tool)
355 struct common_params *params = tool->params;
356 struct trace_instance *trace = &tool->trace;
373 if (osnoise_trace_is_off(tool, tool->record)) {
378 retval = common_threshold_handler(tool);
400 int osn_set_stop(struct osnoise_tool *tool)
402 struct common_params *params = tool->params;
405 retval = osnoise_set_stop_us(tool->context, params->stop_us);
411 retval = osnoise_set_stop_total_us(tool->context, params->stop_total_us);
432 void common_usage(const char *tool, const char *mode,
439 fprintf(stderr, "rtla %s", tool);
443 fprintf(stderr, " usage: [rtla] %s ", tool);