From d988eae6f983c5ac148786689f75b95c4fa16dee Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Thu, 21 Dec 2017 12:56:44 +0100 Subject: Depsgraph: Make it more clear that we dump relations into graphviz We might implement other things to dump into graphviz, so better to start having explicit names. --- source/blender/makesrna/intern/rna_depsgraph.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source/blender/makesrna/intern/rna_depsgraph.c') diff --git a/source/blender/makesrna/intern/rna_depsgraph.c b/source/blender/makesrna/intern/rna_depsgraph.c index 14668001428..041f01b6543 100644 --- a/source/blender/makesrna/intern/rna_depsgraph.c +++ b/source/blender/makesrna/intern/rna_depsgraph.c @@ -45,13 +45,13 @@ #include "DEG_depsgraph_build.h" #include "DEG_depsgraph_debug.h" -static void rna_Depsgraph_debug_graphviz(Depsgraph *graph, const char *filename) +static void rna_Depsgraph_debug_relations_graphviz(Depsgraph *graph, const char *filename) { FILE *f = fopen(filename, "w"); if (f == NULL) { return; } - DEG_debug_graphviz(graph, f, "Depsgraph"); + DEG_debug_relations_graphviz(graph, f, "Depsgraph"); fclose(f); } @@ -80,7 +80,7 @@ static void rna_def_depsgraph(BlenderRNA *brna) srna = RNA_def_struct(brna, "Depsgraph", NULL); RNA_def_struct_ui_text(srna, "Dependency Graph", ""); - func = RNA_def_function(srna, "debug_graphviz", "rna_Depsgraph_debug_graphviz"); + func = RNA_def_function(srna, "debug_relations_graphviz", "rna_Depsgraph_debug_relations_graphviz"); parm = RNA_def_string_file_path(func, "filename", NULL, FILE_MAX, "File Name", "File in which to store graphviz debug output"); RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); -- cgit v1.2.3 From 885bb5b137b5ea71869b741e6ee7acc1602ab5c6 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Thu, 21 Dec 2017 16:14:15 +0100 Subject: Depsgraph: Bring timing statistics to the new dependency graph This statistics is only collected when debug_value is different from 0. Stored in depsgraph node itself, so we can always have access to average data and other stats which requires persistent storage. This way we also don't waste time trying to find stats from a separately stored hash map. --- source/blender/makesrna/intern/rna_depsgraph.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'source/blender/makesrna/intern/rna_depsgraph.c') diff --git a/source/blender/makesrna/intern/rna_depsgraph.c b/source/blender/makesrna/intern/rna_depsgraph.c index 041f01b6543..1091239805f 100644 --- a/source/blender/makesrna/intern/rna_depsgraph.c +++ b/source/blender/makesrna/intern/rna_depsgraph.c @@ -45,7 +45,8 @@ #include "DEG_depsgraph_build.h" #include "DEG_depsgraph_debug.h" -static void rna_Depsgraph_debug_relations_graphviz(Depsgraph *graph, const char *filename) +static void rna_Depsgraph_debug_relations_graphviz(Depsgraph *graph, + const char *filename) { FILE *f = fopen(filename, "w"); if (f == NULL) { @@ -55,6 +56,18 @@ static void rna_Depsgraph_debug_relations_graphviz(Depsgraph *graph, const char fclose(f); } +static void rna_Depsgraph_debug_stats_gnuplot(Depsgraph *graph, + const char *filename, + const char *output_filename) +{ + FILE *f = fopen(filename, "w"); + if (f == NULL) { + return; + } + DEG_debug_stats_gnuplot(graph, f, "Timing Statistics", output_filename); + fclose(f); +} + static void rna_Depsgraph_debug_tag_update(Depsgraph *graph) { DEG_graph_tag_relations_update(graph); @@ -85,6 +98,14 @@ static void rna_def_depsgraph(BlenderRNA *brna) "File in which to store graphviz debug output"); RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); + func = RNA_def_function(srna, "debug_stats_gnuplot", "rna_Depsgraph_debug_stats_gnuplot"); + parm = RNA_def_string_file_path(func, "filename", NULL, FILE_MAX, "File Name", + "File in which to store graphviz debug output"); + RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); + parm = RNA_def_string_file_path(func, "output_filename", NULL, FILE_MAX, "Output File Name", + "File name where gnuplot script will save the result"); + RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); + func = RNA_def_function(srna, "debug_tag_update", "rna_Depsgraph_debug_tag_update"); func = RNA_def_function(srna, "debug_stats", "rna_Depsgraph_debug_stats"); -- cgit v1.2.3