Commit d9641bef authored by Romain Cledat's avatar Romain Cledat Committed by Brenden Blanco

Increased allowed path name for USDT probes

Also added a warning if the length is exceeded
parent a91ec385
...@@ -513,7 +513,7 @@ void * bpf_attach_uprobe(int progfd, enum bpf_probe_attach_type attach_type, con ...@@ -513,7 +513,7 @@ void * bpf_attach_uprobe(int progfd, enum bpf_probe_attach_type attach_type, con
{ {
int kfd; int kfd;
char buf[PATH_MAX]; char buf[PATH_MAX];
char new_name[128]; char new_name[256];
struct perf_reader *reader = NULL; struct perf_reader *reader = NULL;
static char *event_type = "uprobe"; static char *event_type = "uprobe";
int ns_fd = -1; int ns_fd = -1;
...@@ -534,6 +534,7 @@ void * bpf_attach_uprobe(int progfd, enum bpf_probe_attach_type attach_type, con ...@@ -534,6 +534,7 @@ void * bpf_attach_uprobe(int progfd, enum bpf_probe_attach_type attach_type, con
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==BPF_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)) {
fprintf(stderr, "Name too long for uprobe; ev_name (%s) is probably too long\n", ev_name);
close(kfd); close(kfd);
goto error; goto error;
} }
......
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