Lines Matching defs:path

687 	char path[];
1249 static struct bpf_object *bpf_object__new(const char *path,
1257 obj = calloc(1, sizeof(struct bpf_object) + strlen(path) + 1);
1259 pr_warn("alloc memory failed for %s\n", path);
1263 strcpy(obj->path, path);
1268 libbpf_strlcpy(obj->name, basename((void *)path), sizeof(obj->name));
1327 obj->efile.fd = open(obj->path, O_RDONLY | O_CLOEXEC);
1333 pr_warn("elf: failed to open %s: %s\n", obj->path, cp);
1341 pr_warn("elf: failed to open %s as ELF file: %s\n", obj->path, elf_errmsg(-1));
1350 pr_warn("elf: '%s' is not a proper ELF object\n", obj->path);
1356 pr_warn("elf: '%s' is not a 64-bit ELF object\n", obj->path);
1362 pr_warn("elf: failed to get ELF header from %s: %s\n", obj->path, elf_errmsg(-1));
1369 obj->path, elf_errmsg(-1));
1377 obj->path, elf_errmsg(-1));
1384 pr_warn("elf: %s is not a valid eBPF object file\n", obj->path);
1406 pr_warn("elf: endianness mismatch in %s.\n", obj->path);
1414 pr_warn("invalid license section in %s\n", obj->path);
1421 pr_debug("license of %s is %s\n", obj->path, obj->license);
1431 pr_warn("invalid kver section in %s\n", obj->path);
1436 pr_debug("kernel version of %s is %x\n", obj->path, obj->kern_version);
2164 static int pathname_concat(char *buf, size_t buf_sz, const char *path, const char *name)
2168 len = snprintf(buf, buf_sz, "%s/%s", path, name);
2177 static int build_map_pin_path(struct bpf_map *map, const char *path)
2182 if (!path)
2183 path = "/sys/fs/bpf";
2185 err = pathname_concat(buf, sizeof(buf), path, bpf_map__name(map));
2589 pr_warn("map '%s': couldn't build pin path.\n", map->name);
2632 MAPS_ELF_SEC, obj->path);
3208 off, obj->path, elf_errmsg(-1));
3222 off, obj->path, elf_errmsg(-1));
3236 idx, obj->path, elf_errmsg(-1));
3271 elf_ndxscn(scn), obj->path, elf_errmsg(-1));
3293 elf_ndxscn(scn), obj->path, elf_errmsg(-1));
3311 obj->path, elf_errmsg(-1));
3405 obj->path, elf_errmsg(-1));
3423 pr_warn("elf: multiple symbol tables in %s\n", obj->path);
3441 obj->path);
3553 pr_warn("elf: symbol strings section missing or invalid in %s\n", obj->path);
4856 link_opts.uprobe_multi.path = "/";
7376 static struct bpf_object *bpf_object_open(const char *path, const void *obj_buf, size_t obj_buf_sz,
7389 path ? : "(mem buf)");
7404 path = obj_name;
7416 obj = bpf_object__new(path, obj_buf, obj_buf_sz, obj_name);
7466 bpf_object__open_file(const char *path, const struct bpf_object_open_opts *opts)
7468 if (!path)
7471 pr_debug("loading %s\n", path);
7473 return libbpf_ptr(bpf_object_open(path, NULL, 0, opts));
7476 struct bpf_object *bpf_object__open(const char *path)
7478 return bpf_object__open_file(path, NULL);
7984 pr_warn("failed to load object '%s'\n", obj->path);
7993 static int make_parent_dir(const char *path)
7999 dname = strdup(path);
8010 pr_warn("failed to mkdir %s: %s\n", path, cp);
8015 static int check_path(const char *path)
8022 if (path == NULL)
8025 dname = strdup(path);
8038 pr_warn("specified path %s is not on BPF FS\n", path);
8045 int bpf_program__pin(struct bpf_program *prog, const char *path)
8055 err = make_parent_dir(path);
8059 err = check_path(path);
8063 if (bpf_obj_pin(prog->fd, path)) {
8066 pr_warn("prog '%s': failed to pin at '%s': %s\n", prog->name, path, cp);
8070 pr_debug("prog '%s': pinned at '%s'\n", prog->name, path);
8074 int bpf_program__unpin(struct bpf_program *prog, const char *path)
8083 err = check_path(path);
8087 err = unlink(path);
8091 pr_debug("prog '%s': unpinned from '%s'\n", prog->name, path);
8095 int bpf_map__pin(struct bpf_map *map, const char *path)
8106 if (path && strcmp(path, map->pin_path)) {
8107 pr_warn("map '%s' already has pin path '%s' different from '%s'\n",
8108 bpf_map__name(map), map->pin_path, path);
8116 if (!path) {
8117 pr_warn("missing a path to pin map '%s' at\n",
8125 map->pin_path = strdup(path);
8156 int bpf_map__unpin(struct bpf_map *map, const char *path)
8166 if (path && strcmp(path, map->pin_path)) {
8167 pr_warn("map '%s' already has pin path '%s' different from '%s'\n",
8168 bpf_map__name(map), map->pin_path, path);
8171 path = map->pin_path;
8172 } else if (!path) {
8173 pr_warn("no path to unpin map '%s' from\n",
8178 err = check_path(path);
8182 err = unlink(path);
8187 pr_debug("unpinned map '%s' from '%s'\n", bpf_map__name(map), path);
8192 int bpf_map__set_pin_path(struct bpf_map *map, const char *path)
8196 if (path) {
8197 new = strdup(path);
8222 /* bpffs disallows periods in path names */
8230 int bpf_object__pin_maps(struct bpf_object *obj, const char *path)
8250 if (path) {
8251 err = pathname_concat(buf, sizeof(buf), path, bpf_map__name(map));
8278 int bpf_object__unpin_maps(struct bpf_object *obj, const char *path)
8290 if (path) {
8291 err = pathname_concat(buf, sizeof(buf), path, bpf_map__name(map));
8308 int bpf_object__pin_programs(struct bpf_object *obj, const char *path)
8323 err = pathname_concat(buf, sizeof(buf), path, prog->name);
8336 if (pathname_concat(buf, sizeof(buf), path, prog->name))
8345 int bpf_object__unpin_programs(struct bpf_object *obj, const char *path)
8356 err = pathname_concat(buf, sizeof(buf), path, prog->name);
8368 int bpf_object__pin(struct bpf_object *obj, const char *path)
8372 err = bpf_object__pin_maps(obj, path);
8376 err = bpf_object__pin_programs(obj, path);
8378 bpf_object__unpin_maps(obj, path);
8385 int bpf_object__unpin(struct bpf_object *obj, const char *path)
8389 err = bpf_object__unpin_programs(obj, path);
8393 err = bpf_object__unpin_maps(obj, path);
9985 struct bpf_link *bpf_link__open(const char *path)
9990 fd = bpf_obj_get(path);
9993 pr_warn("failed to open link at %s: %d\n", path, fd);
10005 link->pin_path = strdup(path);
10019 int bpf_link__pin(struct bpf_link *link, const char *path)
10025 err = make_parent_dir(path);
10028 err = check_path(path);
10032 link->pin_path = strdup(path);
11110 /* Find offset of function name in archive specified by path. Currently
11209 /* Get full path to program/shared library. */
11255 const char *path,
11282 * 1) use only path/func_pattern/pid arguments
11284 * 2) use path/pid with allowed combinations of:
11293 if (!path)
11307 if (!strchr(path, '/')) {
11308 err = resolve_full_path(path, full_path, sizeof(full_path));
11310 pr_warn("prog '%s': failed to resolve full path for '%s': %d\n",
11311 prog->name, path, err);
11314 path = full_path;
11317 err = elf_resolve_pattern_offsets(path, func_pattern,
11323 err = elf_resolve_syms_offsets(path, cnt, syms, &resolved_offsets);
11329 lopts.uprobe_multi.path = path;
11404 pr_warn("prog '%s': failed to resolve full path for '%s': %d\n",
11505 * binary can be an absolute/relative path or a filename; the latter is resolved to a
11506 * full binary path via bpf_program__attach_uprobe_opts.
11593 pr_warn("prog '%s': failed to resolve full path for '%s': %d\n",
11622 char *path = NULL, *provider = NULL, *name = NULL;
11633 n = sscanf(sec_name, "usdt/%m[^:]:%m[^:]:%m[^:]", &path, &provider, &name);
11635 pr_warn("invalid section '%s', expected SEC(\"usdt/<path>:<provider>:<name>\")\n",
11639 *link = bpf_program__attach_usdt(prog, -1 /* any process */, path,
11643 free(path);
11660 pr_debug("tracepoint %s/%s path is too long\n",