aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/hud/hud_context.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2017-02-16 13:29:16 +0100
committerMarek Olšák <[email protected]>2017-02-18 01:22:08 +0100
commitc8d84801b76aa0bfb04f5adcfb83335ee54b01e6 (patch)
treee0ee22a677dcea9c05fdf47a6d4365b369c19eab /src/gallium/auxiliary/hud/hud_context.c
parent22c34bbc55a4f2db956780221b251731885cd162 (diff)
gallium/hud: create files after graphs are created to get final names
Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Edmondo Tommasina <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/hud/hud_context.c')
-rw-r--r--src/gallium/auxiliary/hud/hud_context.c25
1 files changed, 23 insertions, 2 deletions
diff --git a/src/gallium/auxiliary/hud/hud_context.c b/src/gallium/auxiliary/hud/hud_context.c
index 9de260c6cbb..aaa52d5b173 100644
--- a/src/gallium/auxiliary/hud/hud_context.c
+++ b/src/gallium/auxiliary/hud/hud_context.c
@@ -939,7 +939,20 @@ hud_graph_destroy(struct hud_graph *graph)
FREE(graph);
}
-void
+static void strcat_without_spaces(char *dst, const char *src)
+{
+ dst += strlen(dst);
+ while (*src) {
+ if (*src == ' ')
+ *dst++ = '_';
+ else
+ *dst++ = *src;
+ src++;
+ }
+ *dst = 0;
+}
+
+static void
hud_graph_set_dump_file(struct hud_graph *gr)
{
#ifndef PIPE_OS_WINDOWS
@@ -951,7 +964,7 @@ hud_graph_set_dump_file(struct hud_graph *gr)
if (dump_file) {
strcpy(dump_file, hud_dump_dir);
strcat(dump_file, "/");
- strcat(dump_file, gr->name);
+ strcat_without_spaces(dump_file, gr->name);
gr->fd = fopen(dump_file, "w+");
free(dump_file);
}
@@ -1376,6 +1389,14 @@ hud_parse_env_var(struct hud_context *hud, const char *env)
FREE(pane);
}
}
+
+ LIST_FOR_EACH_ENTRY(pane, &hud->pane_list, head) {
+ struct hud_graph *gr;
+
+ LIST_FOR_EACH_ENTRY(gr, &pane->graph_list, head) {
+ hud_graph_set_dump_file(gr);
+ }
+ }
}
static void