Skip to content

Commit

Permalink
Increased allowed path name for USDT probes
Browse files Browse the repository at this point in the history
Also added a warning if the length is exceeded
  • Loading branch information
Romain Cledat authored and drzaeus77 committed Aug 30, 2017
1 parent a91ec38 commit d9641be
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/cc/libbpf.c
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ void * bpf_attach_uprobe(int progfd, enum bpf_probe_attach_type attach_type, con
{
int kfd;
char buf[PATH_MAX];
char new_name[128];
char new_name[256];
struct perf_reader *reader = NULL;
static char *event_type = "uprobe";
int ns_fd = -1;
Expand All @@ -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',
event_type, new_name, binary_path, offset);
if (n >= sizeof(buf)) {
fprintf(stderr, "Name too long for uprobe; ev_name (%s) is probably too long\n", ev_name);
close(kfd);
goto error;
}
Expand Down

0 comments on commit d9641be

Please sign in to comment.