mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-05 05:18:01 +02:00
[perf] Search multiple directories for traces
In view of sharing traces between multiple builder, add some system wide directories to the search path. This should be refined to a single canonical location before release.
This commit is contained in:
parent
ebac096648
commit
f30cee70f5
1 changed files with 21 additions and 2 deletions
|
|
@ -695,7 +695,7 @@ int
|
|||
main (int argc, char *argv[])
|
||||
{
|
||||
cairo_perf_t perf;
|
||||
const char *trace_dir = "cairo-traces";
|
||||
const char *trace_dir = "cairo-traces:/usr/src/cairo-traces:/usr/share/cairo-traces";
|
||||
unsigned int n;
|
||||
int i;
|
||||
|
||||
|
|
@ -745,7 +745,26 @@ main (int argc, char *argv[])
|
|||
}
|
||||
}
|
||||
} else {
|
||||
if (cairo_perf_trace_dir (&perf, target, trace_dir) == 0) {
|
||||
int num_traces = 0;
|
||||
const char *dir;
|
||||
|
||||
dir = trace_dir;
|
||||
do {
|
||||
char buf[1024];
|
||||
const char *end = strchr (dir, ':');
|
||||
if (end != NULL) {
|
||||
memcpy (buf, dir, end-dir);
|
||||
buf[end-dir] = '\0';
|
||||
end++;
|
||||
|
||||
dir = buf;
|
||||
}
|
||||
|
||||
num_traces += cairo_perf_trace_dir (&perf, target, dir);
|
||||
dir = end;
|
||||
} while (dir != NULL);
|
||||
|
||||
if (num_traces == 0) {
|
||||
warn_no_traces ("Found no traces in", trace_dir);
|
||||
return 1;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue