summaryrefslogtreecommitdiff
path: root/perf
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2009-07-20 22:17:30 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2009-07-20 22:20:01 +0100
commitf30cee70f5fadd1f2af60310a148f61ed4fc7069 (patch)
tree05c592580d2abc6a23ae9979ebaba60c88bd9031 /perf
parentebac096648d638d6405152d37d7b58a0f6ad3242 (diff)
[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.
Diffstat (limited to 'perf')
-rw-r--r--perf/cairo-perf-trace.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/perf/cairo-perf-trace.c b/perf/cairo-perf-trace.c
index d8d2f7a3..b79f516e 100644
--- a/perf/cairo-perf-trace.c
+++ b/perf/cairo-perf-trace.c
@@ -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;
}