-static void
-init_domain_name(struct ctf_trace *td)
-{
- char *start, *end;
-
- start = td->path + strlen(td->collection_path);
- while (start[0] == '/')
- start++; /* skip / */
- end = strchr(start, '/');
- if (!end)
- end = start + strlen(start);
- memcpy(td->domain, start, end - start);
- td->domain[end - start] = '\0';
-}
-
-static void
-init_proc_name(struct ctf_trace *td)
-{
- char buf[PATH_MAX];
- char *start, *end;
-
- if (td->domain[0] == '\0')
- return;
- memcpy(buf, td->path, PATH_MAX);
- start = buf + strlen(td->collection_path);
- while (start[0] == '/')
- start++; /* skip / */
- start = strchr(start, '/'); /* get begin of domain content */
- if (!start)
- return;
- while (start[0] == '/')
- start++; /* skip / */
- /* find last -, skips time */
- end = strrchr(start, '-');
- if (!end)
- return;
- *end = '\0';
- /* find previous -, skips date */
- end = strrchr(start, '-');
- if (!end)
- return;
- *end = '\0';
- /* find previous -, skips pid */
- end = strrchr(start, '-');
- if (!end)
- return;
- *end = '\0';
-
- memcpy(td->procname, start, end - start);
- td->procname[end - start] = '\0';
-}
-
-static void
-init_vpid(struct ctf_trace *td)
-{
- char buf[PATH_MAX];
- char *start, *end;
-
- if (td->domain[0] == '\0')
- return;
- memcpy(buf, td->path, PATH_MAX);
- start = buf + strlen(td->collection_path);
- while (start[0] == '/')
- start++; /* skip / */
- start = strchr(start, '/'); /* get begin of domain content */
- if (!start)
- return;
- while (start[0] == '/')
- start++; /* skip / */
- /* find last -, skips time */
- end = strrchr(start, '-');
- if (!end)
- return;
- *end = '\0';
- /* find previous -, skips date */
- end = strrchr(start, '-');
- if (!end)
- return;
- *end = '\0';
- /* find previous -, skips pid */
- start = strrchr(start, '-');
- if (!start)
- return;
- start++; /* skip - */
-
- memcpy(td->vpid, start, end - start);
- td->vpid[end - start] = '\0';
-}
-