*/
int common_parse_options(int argc, char **argv, struct common_params *common)
{
+ struct trace_events *tevent;
int saved_state = optind;
int c;
{"cgroup", optional_argument, 0, 'C'},
{"debug", no_argument, 0, 'D'},
{"duration", required_argument, 0, 'd'},
+ {"event", required_argument, 0, 'e'},
{0, 0, 0, 0}
};
opterr = 0;
- c = getopt_long(argc, argv, "c:C::Dd:", long_options, NULL);
+ c = getopt_long(argc, argv, "c:C::Dd:e:", long_options, NULL);
opterr = 1;
switch (c) {
if (!common->duration)
fatal("Invalid -d duration");
break;
+ case 'e':
+ tevent = trace_event_alloc(optarg);
+ if (!tevent)
+ fatal("Error alloc trace event");
+
+ if (common->events)
+ tevent->next = common->events;
+ common->events = tevent;
+ break;
default:
optind = saved_state;
return 0;
*osnoise_hist_parse_args(int argc, char *argv[])
{
struct osnoise_params *params;
- struct trace_events *tevent;
int retval;
int c;
char *trace_output = NULL;
{"stop", required_argument, 0, 's'},
{"stop-total", required_argument, 0, 'S'},
{"trace", optional_argument, 0, 't'},
- {"event", required_argument, 0, 'e'},
{"threshold", required_argument, 0, 'T'},
{"no-header", no_argument, 0, '0'},
{"no-summary", no_argument, 0, '1'},
if (common_parse_options(argc, argv, ¶ms->common))
continue;
- c = getopt_long(argc, argv, "a:b:e:E:hH:p:P:r:s:S:t::T:01234:5:6:7:",
+ c = getopt_long(argc, argv, "a:b:E:hH:p:P:r:s:S:t::T:01234:5:6:7:",
long_options, NULL);
/* detect the end of the options. */
params->common.hist.bucket_size >= 1000000)
fatal("Bucket size needs to be > 0 and <= 1000000");
break;
- case 'e':
- tevent = trace_event_alloc(optarg);
- if (!tevent)
- fatal("Error alloc trace event");
-
- if (params->common.events)
- tevent->next = params->common.events;
-
- params->common.events = tevent;
- break;
case 'E':
params->common.hist.entries = get_llong_from_str(optarg);
if (params->common.hist.entries < 10 ||
struct common_params *osnoise_top_parse_args(int argc, char **argv)
{
struct osnoise_params *params;
- struct trace_events *tevent;
int retval;
int c;
char *trace_output = NULL;
while (1) {
static struct option long_options[] = {
{"auto", required_argument, 0, 'a'},
- {"event", required_argument, 0, 'e'},
{"house-keeping", required_argument, 0, 'H'},
{"help", no_argument, 0, 'h'},
{"period", required_argument, 0, 'p'},
if (common_parse_options(argc, argv, ¶ms->common))
continue;
- c = getopt_long(argc, argv, "a:e:hH:p:P:qr:s:S:t::T:0:1:2:3:",
+ c = getopt_long(argc, argv, "a:hH:p:P:qr:s:S:t::T:0:1:2:3:",
long_options, NULL);
/* Detect the end of the options. */
if (!trace_output)
trace_output = "osnoise_trace.txt";
- break;
- case 'e':
- tevent = trace_event_alloc(optarg);
- if (!tevent)
- fatal("Error alloc trace event");
-
- if (params->common.events)
- tevent->next = params->common.events;
- params->common.events = tevent;
-
break;
case 'h':
case '?':
*timerlat_hist_parse_args(int argc, char *argv[])
{
struct timerlat_params *params;
- struct trace_events *tevent;
int auto_thresh;
int retval;
int c;
{"user-threads", no_argument, 0, 'u'},
{"kernel-threads", no_argument, 0, 'k'},
{"user-load", no_argument, 0, 'U'},
- {"event", required_argument, 0, 'e'},
{"no-irq", no_argument, 0, '0'},
{"no-thread", no_argument, 0, '1'},
{"no-header", no_argument, 0, '2'},
if (common_parse_options(argc, argv, ¶ms->common))
continue;
- c = getopt_long(argc, argv, "a:b:e:E:hH:i:knp:P:s:t::T:uU0123456:7:8:9\1\2:\3:",
+ c = getopt_long(argc, argv, "a:b:E:hH:i:knp:P:s:t::T:uU0123456:7:8:9\1\2:\3:",
long_options, NULL);
/* detect the end of the options. */
params->common.hist.bucket_size >= 1000000)
fatal("Bucket size needs to be > 0 and <= 1000000");
break;
- case 'e':
- tevent = trace_event_alloc(optarg);
- if (!tevent)
- fatal("Error alloc trace event");
-
- if (params->common.events)
- tevent->next = params->common.events;
-
- params->common.events = tevent;
- break;
case 'E':
params->common.hist.entries = get_llong_from_str(optarg);
if (params->common.hist.entries < 10 ||
*timerlat_top_parse_args(int argc, char **argv)
{
struct timerlat_params *params;
- struct trace_events *tevent;
long long auto_thresh;
int retval;
int c;
while (1) {
static struct option long_options[] = {
{"auto", required_argument, 0, 'a'},
- {"event", required_argument, 0, 'e'},
{"help", no_argument, 0, 'h'},
{"house-keeping", required_argument, 0, 'H'},
{"irq", required_argument, 0, 'i'},
if (common_parse_options(argc, argv, ¶ms->common))
continue;
- c = getopt_long(argc, argv, "a:e:hH:i:knp:P:qs:t::T:uU0:1:2:345:6:7:",
+ c = getopt_long(argc, argv, "a:hH:i:knp:P:qs:t::T:uU0:1:2:345:6:7:",
long_options, NULL);
/* detect the end of the options. */
/* set aa_only to avoid parsing the trace */
params->common.aa_only = 1;
break;
- case 'e':
- tevent = trace_event_alloc(optarg);
- if (!tevent)
- fatal("Error alloc trace event");
-
- if (params->common.events)
- tevent->next = params->common.events;
- params->common.events = tevent;
- break;
case 'h':
case '?':
timerlat_top_usage();