diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-12-21 18:14:15 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-12-21 18:33:22 +0300 |
commit | 885bb5b137b5ea71869b741e6ee7acc1602ab5c6 (patch) | |
tree | c2f6170e2540106681a265a1aeab8b6dab622100 /source/blender/makesrna/intern/rna_depsgraph.c | |
parent | d988eae6f983c5ac148786689f75b95c4fa16dee (diff) |
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.
Diffstat (limited to 'source/blender/makesrna/intern/rna_depsgraph.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_depsgraph.c | 23 |
1 files changed, 22 insertions, 1 deletions
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"); |