From: Romain Cledat Date: Tue, 18 Jul 2017 00:09:13 +0000 (-0700) Subject: Increased allowed path name for USDT probes X-Git-Tag: submit/tizen_4.0/20171018.110122~10 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d9641befa640d4659b090f3b96e84ae8000f41c1;p=platform%2Fupstream%2Fbcc.git Increased allowed path name for USDT probes Also added a warning if the length is exceeded --- diff --git a/src/cc/libbpf.c b/src/cc/libbpf.c index 928d7d79..55f960ec 100644 --- a/src/cc/libbpf.c +++ b/src/cc/libbpf.c @@ -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; @@ -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; }