Lines Matching defs:argv

601 static int do_show_subset(int argc, char **argv)
612 nb_fds = prog_parse_fds(&argc, &argv, &fds);
635 static int do_show(int argc, char **argv)
653 return do_show_subset(argc, argv);
880 static int do_dump(int argc, char **argv)
895 if (is_prefix(*argv, "jited")) {
899 } else if (is_prefix(*argv, "xlated")) {
902 p_err("expected 'xlated' or 'jited', got: %s", *argv);
915 nb_fds = prog_parse_fds(&argc, &argv, &fds);
920 if (is_prefix(*argv, "file")) {
931 filepath = *argv;
933 } else if (is_prefix(*argv, "opcodes")) {
936 } else if (is_prefix(*argv, "visual")) {
944 } else if (is_prefix(*argv, "linum")) {
1016 static int do_pin(int argc, char **argv)
1020 err = do_pin_any(argc, argv, prog_parse_fd);
1039 static int parse_attach_detach_args(int argc, char **argv, int *progfd,
1046 *progfd = prog_parse_fd(&argc, &argv);
1050 *attach_type = parse_attach_type(*argv);
1065 *mapfd = map_parse_fd(&argc, &argv);
1072 static int do_attach(int argc, char **argv)
1078 err = parse_attach_detach_args(argc, argv,
1094 static int do_detach(int argc, char **argv)
1100 err = parse_attach_detach_args(argc, argv,
1275 static int do_run(int argc, char **argv)
1289 fd = prog_parse_fd(&argc, &argv);
1294 if (detect_common_prefix(*argv, "data_in", "data_out",
1297 if (detect_common_prefix(*argv, "ctx_in", "ctx_out",
1301 if (is_prefix(*argv, "data_in")) {
1309 } else if (is_prefix(*argv, "data_out")) {
1315 } else if (is_prefix(*argv, "data_size_out")) {
1322 test_attr.data_size_out = strtoul(*argv, &endptr, 0);
1325 *argv);
1329 } else if (is_prefix(*argv, "ctx_in")) {
1337 } else if (is_prefix(*argv, "ctx_out")) {
1343 } else if (is_prefix(*argv, "ctx_size_out")) {
1350 test_attr.ctx_size_out = strtoul(*argv, &endptr, 0);
1353 *argv);
1357 } else if (is_prefix(*argv, "repeat")) {
1364 repeat = strtoul(*argv, &endptr, 0);
1367 *argv);
1373 *argv);
1520 static int load_with_options(int argc, char **argv, bool first_prog_only)
1548 if (is_prefix(*argv, "type")) {
1558 err = libbpf_prog_type_by_name(*argv, &common_prog_type,
1562 char *type = malloc(strlen(*argv) + 2);
1569 strcat(type, *argv);
1580 } else if (is_prefix(*argv, "map")) {
1590 if (is_prefix(*argv, "idx")) {
1593 idx = strtoul(*argv, &endptr, 0);
1595 p_err("can't parse %s as IDX", *argv);
1599 } else if (is_prefix(*argv, "name")) {
1602 name = *argv;
1606 *argv);
1611 fd = map_parse_fd(&argc, &argv);
1628 } else if (is_prefix(*argv, "dev")) {
1633 } else if (is_prefix(*argv, "offload_dev")) {
1647 offload_ifindex = if_nametoindex(*argv);
1650 *argv, strerror(errno));
1654 } else if (is_prefix(*argv, "xdpmeta_dev")) {
1667 xdpmeta_ifindex = if_nametoindex(*argv);
1670 *argv, strerror(errno));
1674 } else if (is_prefix(*argv, "pinmaps")) {
1681 } else if (is_prefix(*argv, "autoattach")) {
1686 *argv);
1913 static int do_loader(int argc, char **argv)
1958 static int do_load(int argc, char **argv)
1961 return do_loader(argc, argv);
1962 return load_with_options(argc, argv, true);
1965 static int do_loadall(int argc, char **argv)
1967 return load_with_options(argc, argv, false);
1972 static int do_profile(int argc, char **argv)
2071 static int profile_parse_metrics(int argc, char **argv)
2081 if (is_prefix(argv[0], metrics[i].name)) {
2089 p_err("unknown metric %s", argv[0]);
2358 static int do_profile(int argc, char **argv)
2370 profile_tgt_fd = prog_parse_fd(&argc, &argv);
2377 if (argc > 2 && is_prefix(argv[0], "duration")) {
2379 duration = strtoul(*argv, &endptr, 0);
2387 num_metric = profile_parse_metrics(argc, argv);
2459 static int do_help(int argc, char **argv)
2509 bin_name, argv[-2]);
2530 int do_prog(int argc, char **argv)
2532 return cmd_select(cmds, argc, argv, do_help);