Commit be0d60b4 authored by Derek's avatar Derek

Merge branch 'mybcc' of https://github.com/derek0883/bcc into mybcc

parents 7174d93c 4114d0d8
...@@ -362,7 +362,7 @@ void * bpf_attach_kprobe(int progfd, enum bpf_probe_attach_type attach_type, con ...@@ -362,7 +362,7 @@ void * bpf_attach_kprobe(int progfd, enum bpf_probe_attach_type attach_type, con
goto error; goto error;
} }
snprintf(buf, sizeof(buf), "%c:%ss/%s %s", attach_type==BPF_PROBE_ENTRY ? 'p' : 'r', snprintf(buf, sizeof(buf), "%c:%ss/%s %s", attach_type==probe_entry ? 'p' : 'r',
event_type, new_name, fn_name); event_type, new_name, fn_name);
if (write(kfd, buf, strlen(buf)) < 0) { if (write(kfd, buf, strlen(buf)) < 0) {
if (errno == EINVAL) if (errno == EINVAL)
...@@ -420,7 +420,7 @@ void * bpf_attach_uprobe(int progfd, enum bpf_probe_attach_type attach_type, con ...@@ -420,7 +420,7 @@ void * bpf_attach_uprobe(int progfd, enum bpf_probe_attach_type attach_type, con
goto error; goto error;
} }
n = snprintf(buf, sizeof(buf), "%c:%ss/%s %s:0x%lx", attach_type==BPF_PROBE_ENTRY ? 'p' : 'r', n = snprintf(buf, sizeof(buf), "%c:%ss/%s %s:0x%lx", attach_type==probe_entry ? 'p' : 'r',
event_type, new_name, binary_path, offset); event_type, new_name, binary_path, offset);
if (n >= sizeof(buf)) { if (n >= sizeof(buf)) {
close(kfd); close(kfd);
......
...@@ -28,8 +28,6 @@ enum bpf_probe_attach_type { ...@@ -28,8 +28,6 @@ enum bpf_probe_attach_type {
probe_entry, probe_entry,
probe_return probe_return
}; };
#define BPF_PROBE_ENTRY 0
#define BPF_PROBE_RETURN 1
int bpf_create_map(enum bpf_map_type map_type, int key_size, int value_size, int bpf_create_map(enum bpf_map_type map_type, int key_size, int value_size,
int max_entries, int map_flags); int max_entries, int map_flags);
...@@ -51,15 +49,15 @@ typedef void (*perf_reader_cb)(void *cb_cookie, int pid, uint64_t callchain_num, ...@@ -51,15 +49,15 @@ typedef void (*perf_reader_cb)(void *cb_cookie, int pid, uint64_t callchain_num,
void *callchain); void *callchain);
typedef void (*perf_reader_raw_cb)(void *cb_cookie, void *raw, int raw_size); typedef void (*perf_reader_raw_cb)(void *cb_cookie, void *raw, int raw_size);
void * bpf_attach_kprobe(int progfd, enum bpf_probe_attach_type attach_type, const char *ev_name, void * bpf_attach_kprobe(int progfd, enum bpf_probe_attach_type attach_type,
const char *fn_name, const char *ev_name, const char *fn_name,
pid_t pid, int cpu, int group_fd, pid_t pid, int cpu, int group_fd,
perf_reader_cb cb, void *cb_cookie); perf_reader_cb cb, void *cb_cookie);
int bpf_detach_kprobe(const char *ev_name); int bpf_detach_kprobe(const char *ev_name);
void * bpf_attach_uprobe(int progfd, enum bpf_probe_attach_type attach_type, const char *ev_name, void * bpf_attach_uprobe(int progfd, enum bpf_probe_attach_type attach_type,
const char *binary_path, uint64_t offset, const char *ev_name, const char *binary_path, uint64_t offset,
pid_t pid, int cpu, int group_fd, pid_t pid, int cpu, int group_fd,
perf_reader_cb cb, void *cb_cookie); perf_reader_cb cb, void *cb_cookie);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment