Skip to content

Commit

Permalink
fix compilation issues
Browse files Browse the repository at this point in the history
  • Loading branch information
mmat11 committed Sep 29, 2023
1 parent 80b7397 commit fe80cd3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 5 additions & 3 deletions contrib/libbpf/src/libbpf.c
Original file line number Diff line number Diff line change
Expand Up @@ -8322,7 +8322,7 @@ void bpf_object__close(struct bpf_object *obj)
if (IS_ERR_OR_NULL(obj))
return;

usdt_manager_free(obj->usdt_man);
//usdt_manager_free(obj->usdt_man);
obj->usdt_man = NULL;

bpf_gen__free(obj->gen_loader);
Expand Down Expand Up @@ -8642,7 +8642,7 @@ int bpf_program__set_log_buf(struct bpf_program *prog, char *log_buf, size_t log
static int attach_kprobe(const struct bpf_program *prog, long cookie, struct bpf_link **link);
static int attach_uprobe(const struct bpf_program *prog, long cookie, struct bpf_link **link);
static int attach_ksyscall(const struct bpf_program *prog, long cookie, struct bpf_link **link);
static int attach_usdt(const struct bpf_program *prog, long cookie, struct bpf_link **link);
//static int attach_usdt(const struct bpf_program *prog, long cookie, struct bpf_link **link);
static int attach_tp(const struct bpf_program *prog, long cookie, struct bpf_link **link);
static int attach_raw_tp(const struct bpf_program *prog, long cookie, struct bpf_link **link);
static int attach_trace(const struct bpf_program *prog, long cookie, struct bpf_link **link);
Expand All @@ -8664,7 +8664,7 @@ static const struct bpf_sec_def section_defs[] = {
SEC_DEF("kretprobe.multi+", KPROBE, BPF_TRACE_KPROBE_MULTI, SEC_NONE, attach_kprobe_multi),
SEC_DEF("ksyscall+", KPROBE, 0, SEC_NONE, attach_ksyscall),
SEC_DEF("kretsyscall+", KPROBE, 0, SEC_NONE, attach_ksyscall),
SEC_DEF("usdt+", KPROBE, 0, SEC_NONE, attach_usdt),
//SEC_DEF("usdt+", KPROBE, 0, SEC_NONE, attach_usdt),
SEC_DEF("tc", SCHED_CLS, 0, SEC_NONE),
SEC_DEF("classifier", SCHED_CLS, 0, SEC_NONE),
SEC_DEF("action", SCHED_ACT, 0, SEC_NONE),
Expand Down Expand Up @@ -11236,6 +11236,7 @@ struct bpf_link *bpf_program__attach_uprobe(const struct bpf_program *prog,
return bpf_program__attach_uprobe_opts(prog, pid, binary_path, func_offset, &opts);
}

#if 0
struct bpf_link *bpf_program__attach_usdt(const struct bpf_program *prog,
pid_t pid, const char *binary_path,
const char *usdt_provider, const char *usdt_name,
Expand Down Expand Up @@ -11288,6 +11289,7 @@ struct bpf_link *bpf_program__attach_usdt(const struct bpf_program *prog,
return libbpf_err_ptr(err);
return link;
}
#endif

static int attach_usdt(const struct bpf_program *prog, long cookie, struct bpf_link **link)
{
Expand Down
4 changes: 4 additions & 0 deletions contrib/libbpf/src/usdt.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if 0
// SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause)
/* Copyright (c) 2022 Meta Platforms, Inc. and affiliates. */
#include <ctype.h>
Expand Down Expand Up @@ -612,6 +613,7 @@ static int collect_usdt_targets(struct usdt_manager *man, Elf *elf, const char *

data = elf_getdata(notes_scn, 0);
off = 0;
#if 0
while ((off = gelf_getnote(data, off, &nhdr, &name_off, &desc_off)) > 0) {
long usdt_abs_ip, usdt_rel_ip, usdt_sema_off = 0;
struct usdt_note note;
Expand Down Expand Up @@ -782,6 +784,7 @@ static int collect_usdt_targets(struct usdt_manager *man, Elf *elf, const char *

target_cnt++;
}
#endif

*out_targets = targets;
*out_target_cnt = target_cnt;
Expand Down Expand Up @@ -1557,3 +1560,4 @@ static int parse_usdt_arg(const char *arg_str, int arg_num, struct usdt_arg_spec
}

#endif
#endif

0 comments on commit fe80cd3

Please sign in to comment.