tools/tracing/rtla/src/cli_p.h

Source file repositories/reference/linux-study-clean/tools/tracing/rtla/src/cli_p.h

File Facts

System
Linux kernel
Corpus path
tools/tracing/rtla/src/cli_p.h
Extension
.h
Size
17633 bytes
Lines
688
Domain
Support Tooling And Documentation
Bucket
tools
Inferred role
Support Tooling And Documentation: implementation source
Status
source implementation candidate

Why This File Exists

Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.

Dependency Surface

Detected Declarations

Annotated Snippet

struct osnoise_cb_data {
	struct osnoise_params *params;
	char *trace_output;
};

struct timerlat_cb_data {
	struct timerlat_params *params;
	char *trace_output;
};

/*
 * Macros for command line options common to all tools
 *
 * Note: Some of the options are common to both timerlat and osnoise, but
 * have a slightly different meaning. Such options take additional arguments
 * that have to be provided by the *_parse_args() function of the corresponding
 * tool.
 *
 * All macros defined here assume the presence of a params variable of
 * the corresponding tool type (i.e struct timerlat_params or struct osnoise_params)
 * and a cb_data variable of the matching type.
 */

 #define RTLA_OPT_STOP(short, long, name) OPT_CALLBACK_FLAG(short, long, \
	&params->common.stop_us, \
	"us", \
	"stop trace if " name " is higher than the argument in us", \
	opt_llong_callback, PARSE_OPT_NOAUTONEG)

#define RTLA_OPT_STOP_TOTAL(short, long, name) OPT_CALLBACK_FLAG(short, long, \
	&params->common.stop_total_us, \
	"us", \
	"stop trace if " name " is higher than the argument in us", \
	opt_llong_callback, PARSE_OPT_NOAUTONEG)

#define RTLA_OPT_TRACE_OUTPUT(tracer, cb) OPT_CALLBACK_OPTARG('t', "trace", \
	(const char **)&cb_data.trace_output, \
	tracer "_trace.txt", \
	"[file]", \
	"save the stopped trace to [file|" tracer "_trace.txt]", \
	cb)

#define RTLA_OPT_CPUS OPT_CALLBACK('c', "cpus", &params->common, \
	"cpu-list", \
	"run the tracer only on the given cpus", \
	opt_cpus_cb)

#define RTLA_OPT_CGROUP OPT_CALLBACK_OPTARG('C', "cgroup", &params->common, \
	"[cgroup_name]", NULL, \
	"set cgroup, no argument means rtla's cgroup will be inherited", \
	opt_cgroup_cb)

#define RTLA_OPT_USER_THREADS OPT_CALLBACK_NOOPT('u', "user-threads", params, NULL, \
	"use rtla user-space threads instead of kernel-space timerlat threads", \
	opt_user_threads_cb)

#define RTLA_OPT_KERNEL_THREADS OPT_BOOLEAN('k', "kernel-threads", \
	&params->common.kernel_workload, \
	"use timerlat kernel-space threads instead of rtla user-space threads")

#define RTLA_OPT_USER_LOAD OPT_BOOLEAN('U', "user-load", &params->common.user_data, \
	"enable timerlat for user-defined user-space workload")

#define RTLA_OPT_DURATION OPT_CALLBACK('d', "duration", &params->common, \
	"time[s|m|h|d]", \
	"set the duration of the session", \
	opt_duration_cb)

#define RTLA_OPT_EVENT OPT_CALLBACK('e', "event", &params->common.events, \
	"sys:event", \
	"enable the <sys:event> in the trace instance, multiple -e are allowed", \
	opt_event_cb)

#define RTLA_OPT_HOUSEKEEPING OPT_CALLBACK('H', "house-keeping", &params->common, \
	"cpu-list", \
	"run rtla control threads only on the given cpus", \
	opt_housekeeping_cb)

#define RTLA_OPT_PRIORITY OPT_CALLBACK('P', "priority", &params->common, \
	"o:prio|r:prio|f:prio|d:runtime:period", \
	"set scheduling parameters", \
	opt_priority_cb)

#define RTLA_OPT_TRIGGER OPT_CALLBACK(0, "trigger", &params->common.events, \
	"trigger", \
	"enable a trace event trigger to the previous -e event", \
	opt_trigger_cb)

#define RTLA_OPT_FILTER OPT_CALLBACK(0, "filter", &params->common.events, \
	"filter", \

Annotation

Implementation Notes