Lines Matching refs:argv
597 static int do_show_subset(int argc, char **argv)
608 nb_fds = prog_parse_fds(&argc, &argv, &fds);
631 static int do_show(int argc, char **argv)
649 return do_show_subset(argc, argv);
869 static int do_dump(int argc, char **argv)
884 if (is_prefix(*argv, "jited")) {
888 } else if (is_prefix(*argv, "xlated")) {
891 p_err("expected 'xlated' or 'jited', got: %s", *argv);
904 nb_fds = prog_parse_fds(&argc, &argv, &fds);
909 if (is_prefix(*argv, "file")) {
920 filepath = *argv;
922 } else if (is_prefix(*argv, "opcodes")) {
925 } else if (is_prefix(*argv, "visual")) {
933 } else if (is_prefix(*argv, "linum")) {
1005 static int do_pin(int argc, char **argv)
1009 err = do_pin_any(argc, argv, prog_parse_fd);
1028 static int parse_attach_detach_args(int argc, char **argv, int *progfd,
1035 *progfd = prog_parse_fd(&argc, &argv);
1039 *attach_type = parse_attach_type(*argv);
1054 *mapfd = map_parse_fd(&argc, &argv);
1061 static int do_attach(int argc, char **argv)
1067 err = parse_attach_detach_args(argc, argv,
1083 static int do_detach(int argc, char **argv)
1089 err = parse_attach_detach_args(argc, argv,
1264 static int do_run(int argc, char **argv)
1278 fd = prog_parse_fd(&argc, &argv);
1283 if (detect_common_prefix(*argv, "data_in", "data_out",
1286 if (detect_common_prefix(*argv, "ctx_in", "ctx_out",
1290 if (is_prefix(*argv, "data_in")) {
1298 } else if (is_prefix(*argv, "data_out")) {
1304 } else if (is_prefix(*argv, "data_size_out")) {
1311 test_attr.data_size_out = strtoul(*argv, &endptr, 0);
1314 *argv);
1318 } else if (is_prefix(*argv, "ctx_in")) {
1326 } else if (is_prefix(*argv, "ctx_out")) {
1332 } else if (is_prefix(*argv, "ctx_size_out")) {
1339 test_attr.ctx_size_out = strtoul(*argv, &endptr, 0);
1342 *argv);
1346 } else if (is_prefix(*argv, "repeat")) {
1353 repeat = strtoul(*argv, &endptr, 0);
1356 *argv);
1362 *argv);
1509 static int load_with_options(int argc, char **argv, bool first_prog_only)
1537 if (is_prefix(*argv, "type")) {
1547 err = libbpf_prog_type_by_name(*argv, &common_prog_type,
1551 char *type = malloc(strlen(*argv) + 2);
1558 strcat(type, *argv);
1569 } else if (is_prefix(*argv, "map")) {
1579 if (is_prefix(*argv, "idx")) {
1582 idx = strtoul(*argv, &endptr, 0);
1584 p_err("can't parse %s as IDX", *argv);
1588 } else if (is_prefix(*argv, "name")) {
1591 name = *argv;
1595 *argv);
1600 fd = map_parse_fd(&argc, &argv);
1617 } else if (is_prefix(*argv, "dev")) {
1622 } else if (is_prefix(*argv, "offload_dev")) {
1636 offload_ifindex = if_nametoindex(*argv);
1639 *argv, strerror(errno));
1643 } else if (is_prefix(*argv, "xdpmeta_dev")) {
1656 xdpmeta_ifindex = if_nametoindex(*argv);
1659 *argv, strerror(errno));
1663 } else if (is_prefix(*argv, "pinmaps")) {
1670 } else if (is_prefix(*argv, "autoattach")) {
1675 *argv);
1895 static int do_loader(int argc, char **argv)
1940 static int do_load(int argc, char **argv)
1943 return do_loader(argc, argv);
1944 return load_with_options(argc, argv, true);
1947 static int do_loadall(int argc, char **argv)
1949 return load_with_options(argc, argv, false);
1954 static int do_profile(int argc, char **argv)
2053 static int profile_parse_metrics(int argc, char **argv)
2063 if (is_prefix(argv[0], metrics[i].name)) {
2071 p_err("unknown metric %s", argv[0]);
2340 static int do_profile(int argc, char **argv)
2352 profile_tgt_fd = prog_parse_fd(&argc, &argv);
2359 if (argc > 2 && is_prefix(argv[0], "duration")) {
2361 duration = strtoul(*argv, &endptr, 0);
2369 num_metric = profile_parse_metrics(argc, argv);
2441 static int do_help(int argc, char **argv)
2490 bin_name, argv[-2]);
2511 int do_prog(int argc, char **argv)
2513 return cmd_select(cmds, argc, argv, do_help);