[Bf-blender-cvs] [47f9360] depsgraph_refactor: Debug cleanup: removed the build step debuggging.

Lukas Tönne noreply at git.blender.org
Tue May 27 07:58:11 CEST 2014


Commit: 47f93607dc7343275cb28284bab69794993fd10e
Author: Lukas Tönne
Date:   Tue May 27 07:47:12 2014 +0200
https://developer.blender.org/rB47f93607dc7343275cb28284bab69794993fd10e

Debug cleanup: removed the build step debuggging.

Build debugging is not very useful and pollutes the API somewhat.
Also moved eval debug methods into the common DepsgraphDebug class.

===================================================================

M	source/blender/depsgraph/DEG_depsgraph_debug.h
M	source/blender/depsgraph/intern/depsgraph.cpp
M	source/blender/depsgraph/intern/depsgraph_debug.cpp
M	source/blender/depsgraph/intern/depsgraph_debug.h
M	source/blender/depsgraph/intern/depsgraph_eval.cpp
M	source/blender/depsgraph/intern/depsgraph_intern.h
M	source/blender/depsgraph/intern/depsgraph_tag.cpp
M	source/blender/makesrna/intern/rna_scene.c

===================================================================

diff --git a/source/blender/depsgraph/DEG_depsgraph_debug.h b/source/blender/depsgraph/DEG_depsgraph_debug.h
index 24174f5..e990fe3 100644
--- a/source/blender/depsgraph/DEG_depsgraph_debug.h
+++ b/source/blender/depsgraph/DEG_depsgraph_debug.h
@@ -42,12 +42,6 @@ extern "C" {
 
 void DEG_debug_graphviz(const struct Depsgraph *graph, FILE *stream, const char *label, bool show_eval);
 
-typedef void (*DEG_DebugBuildCb_NodeAdded)(void *userdata, const struct DepsNode *node);
-typedef void (*DEG_DebugBuildCb_RelationAdded)(void *userdata, const struct DepsRelation *rel);
-
-void DEG_debug_build_init(void *userdata, DEG_DebugBuildCb_NodeAdded node_added_cb, DEG_DebugBuildCb_RelationAdded rel_added_cb);
-void DEG_debug_build_end(void);
-
 typedef void (*DEG_DebugEvalCb)(void *userdata, const char *message);
 
 void DEG_debug_eval_init(void *userdata, DEG_DebugEvalCb cb);
diff --git a/source/blender/depsgraph/intern/depsgraph.cpp b/source/blender/depsgraph/intern/depsgraph.cpp
index 920e0b1..4456400 100644
--- a/source/blender/depsgraph/intern/depsgraph.cpp
+++ b/source/blender/depsgraph/intern/depsgraph.cpp
@@ -40,7 +40,7 @@ extern "C" {
 #include "depsnode_component.h"
 #include "depsnode_operation.h"
 #include "depsgraph_intern.h"
-
+#include "depsgraph_debug.h"
 
 Depsgraph::Depsgraph()
 {
@@ -203,9 +203,6 @@ DepsRelation *Depsgraph::add_new_relation(OperationDepsNode *from, OperationDeps
 {
 	/* create new relation, and add it to the graph */
 	DepsRelation *rel = new DepsRelation(from, to, type, description);
-	
-	DEG_debug_build_relation_added(rel);
-	
 	return rel;
 }
 
diff --git a/source/blender/depsgraph/intern/depsgraph_debug.cpp b/source/blender/depsgraph/intern/depsgraph_debug.cpp
index a9ed63e..c4c6b62 100644
--- a/source/blender/depsgraph/intern/depsgraph_debug.cpp
+++ b/source/blender/depsgraph/intern/depsgraph_debug.cpp
@@ -671,46 +671,9 @@ void DEG_debug_graphviz(const Depsgraph *graph, FILE *f, const char *label, bool
 
 #ifdef DEG_DEBUG_BUILD
 
-static void *deg_debug_build_userdata;
 static void *deg_debug_eval_userdata;
-DEG_DebugBuildCb_NodeAdded deg_debug_build_node_added_cb;
-DEG_DebugBuildCb_RelationAdded deg_debug_build_rel_added_cb;
 DEG_DebugEvalCb deg_debug_eval_cb;
 
-void DEG_debug_build_init(void *userdata, DEG_DebugBuildCb_NodeAdded node_added_cb, DEG_DebugBuildCb_RelationAdded rel_added_cb)
-{
-	deg_debug_build_userdata = userdata;
-	deg_debug_build_node_added_cb = node_added_cb;
-	deg_debug_build_rel_added_cb = rel_added_cb;
-}
-
-void DEG_debug_build_node_added(const DepsNode *node)
-{
-	if (deg_debug_build_node_added_cb) {
-		deg_debug_build_node_added_cb(deg_debug_build_userdata, node);
-	}
-}
-
-void DEG_debug_build_relation_added(const DepsRelation *rel)
-{
-	if (deg_debug_build_rel_added_cb) {
-		deg_debug_build_rel_added_cb(deg_debug_build_userdata, rel);
-	}
-}
-
-void DEG_debug_eval_step(const char *message)
-{
-	if (deg_debug_eval_cb)
-		deg_debug_eval_cb(deg_debug_eval_userdata, message);
-}
-
-void DEG_debug_build_end(void)
-{
-	deg_debug_build_userdata = NULL;
-	deg_debug_build_node_added_cb = NULL;
-	deg_debug_build_rel_added_cb = NULL;
-}
-
 void DEG_debug_eval_init(void *userdata, DEG_DebugEvalCb cb)
 {
 	deg_debug_eval_userdata = userdata;
@@ -725,11 +688,6 @@ void DEG_debug_eval_end(void)
 
 #else /* DEG_DEBUG_BUILD */
 
-void DEG_debug_build_init(void *userdata, DEG_DebugBuildCb_NodeAdded node_added_cb, DEG_DebugBuildCb_RelationAdded rel_added_cb) {}
-void DEG_debug_build_node_added(const DepsNode *node) {}
-void DEG_debug_build_relation_added(const DepsRelation *rel) {}
-void DEG_debug_build_end(void) {}
-
 void DEG_debug_eval_init(void *userdata, DEG_DebugEvalCb cb) {}
 void DEG_debug_eval_end(void) {}
 void DEG_debug_eval_step(const char *message) {}
@@ -740,17 +698,20 @@ void DEG_debug_eval_step(const char *message) {}
 
 void DepsgraphDebug::eval_begin(eEvaluationContextType context_type)
 {
-	
 }
 
 void DepsgraphDebug::eval_end(eEvaluationContextType context_type, double time)
 {
-	
+}
+
+void DepsgraphDebug::eval_step(eEvaluationContextType context_type, const char *message)
+{
+	if (deg_debug_eval_cb)
+		deg_debug_eval_cb(deg_debug_eval_userdata, message);
 }
 
 void DepsgraphDebug::task_started(const DepsgraphTask &task)
 {
-	
 }
 
 void DepsgraphDebug::task_completed(const DepsgraphTask &task, double time)
diff --git a/source/blender/depsgraph/intern/depsgraph_debug.h b/source/blender/depsgraph/intern/depsgraph_debug.h
index 58da903..10fb34a 100644
--- a/source/blender/depsgraph/intern/depsgraph_debug.h
+++ b/source/blender/depsgraph/intern/depsgraph_debug.h
@@ -47,6 +47,7 @@ struct DepsgraphTask;
 struct DepsgraphDebug {
 	static void eval_begin(eEvaluationContextType context_type);
 	static void eval_end(eEvaluationContextType context_type, double time);
+	static void eval_step(eEvaluationContextType context_type, const char *message);
 	
 	static void task_started(const DepsgraphTask &task);
 	static void task_completed(const DepsgraphTask &task, double time);
diff --git a/source/blender/depsgraph/intern/depsgraph_eval.cpp b/source/blender/depsgraph/intern/depsgraph_eval.cpp
index d85cacc..24a23ea 100644
--- a/source/blender/depsgraph/intern/depsgraph_eval.cpp
+++ b/source/blender/depsgraph/intern/depsgraph_eval.cpp
@@ -64,6 +64,7 @@ extern "C" {
 #include "depsgraph_eval.h"
 #include "depsgraph_queue.h"
 #include "depsgraph_intern.h"
+#include "depsgraph_debug.h"
 
 /* *************************************************** */
 /* Multi-Threaded Evaluation Internals */
@@ -168,7 +169,7 @@ void DEG_evaluate_on_refresh(Depsgraph *graph, eEvaluationContextType context_ty
 		calculate_eval_priority(node);
 	}
 	
-	DEG_debug_eval_step("Eval Priority Calculation");
+	DepsgraphDebug::eval_step(context_type, "Eval Priority Calculation");
 	
 	schedule_graph(task_pool, graph, context_type);
 	
diff --git a/source/blender/depsgraph/intern/depsgraph_intern.h b/source/blender/depsgraph/intern/depsgraph_intern.h
index e9fab36..c110948 100644
--- a/source/blender/depsgraph/intern/depsgraph_intern.h
+++ b/source/blender/depsgraph/intern/depsgraph_intern.h
@@ -158,11 +158,4 @@ DepsNodeFactory *DEG_get_node_factory(const eDepsNode_Type type);
 /* Get typeinfo for provided node */
 DepsNodeFactory *DEG_node_get_factory(const DepsNode *node);
 
-/* Debugging ========================================================= */
-
-void DEG_debug_build_node_added(const DepsNode *node);
-void DEG_debug_build_relation_added(const DepsRelation *rel);
-void DEG_debug_eval_step(const char *message);
-
-
 #endif // __DEPSGRAPH_INTERN_H__
diff --git a/source/blender/depsgraph/intern/depsgraph_tag.cpp b/source/blender/depsgraph/intern/depsgraph_tag.cpp
index 4bfe879..61b7295 100644
--- a/source/blender/depsgraph/intern/depsgraph_tag.cpp
+++ b/source/blender/depsgraph/intern/depsgraph_tag.cpp
@@ -96,8 +96,6 @@ void DEG_graph_flush_updates(Depsgraph *graph)
 	if (graph == NULL)
 		return;
 	
-	DEG_debug_eval_step("Flush Begin");
-	
 	FlushQueue queue;
 	/* starting from the tagged "entry" nodes, flush outwards... */
 	// NOTE: also need to ensure that for each of these, there is a path back to root, or else they won't be done
@@ -112,7 +110,6 @@ void DEG_graph_flush_updates(Depsgraph *graph)
 		queue.pop();
 		
 		/* flush to nodes along links... */
-		bool flushed_relations = false;
 		for (OperationDepsNode::Relations::const_iterator it = node->outlinks.begin(); it != node->outlinks.end(); ++it) {
 			DepsRelation *rel = *it;
 			OperationDepsNode *to_node = rel->to;
@@ -120,19 +117,12 @@ void DEG_graph_flush_updates(Depsgraph *graph)
 			if (!(to_node->flag & DEPSOP_FLAG_NEEDS_UPDATE)) {
 				to_node->flag |= DEPSOP_FLAG_NEEDS_UPDATE;
 				queue.push(to_node);
-				
-				flushed_relations = true;
 			}
 		}
-		
-		if (flushed_relations)
-			DEG_debug_eval_step(string_format("Flush Dependencies: %s", node->name.c_str()).c_str());
 	}
 	
 	/* clear entry tags, since all tagged nodes should now be reachable from root */
 	graph->entry_tags.clear();
-	
-	DEG_debug_eval_step("Flush End");
 }
 
 /* Clear tags from all operation nodes */
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index eceaa72..44e9f6d 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -1570,27 +1570,13 @@ static void rna_Scene_depsgraph_debug(SceneDepsgraphDebugInfo *info, void *UNUSE
 	++info->step;
 }
 
-static void rna_Scene_depsgraph_rebuild(Scene *scene, Main *bmain, const char *debug_filename)
+static void rna_Scene_depsgraph_rebuild(Scene *scene, Main *bmain)
 {
-	SceneDepsgraphDebugInfo debug_info;
-	debug_info.filename = debug_filename;
-	debug_info.step = 0;
-	
 	if (scene->depsgraph)
 		DEG_graph_free(scene->depsgraph);
 	
 	scene->depsgraph = DEG_graph_new();
-	debug_info.graph = scene->depsgraph;
-	
-	if (debug_filename && debug_filename[0])
-		DEG_debug_build_init(&debug_info,
-		                     (DEG_DebugBuildCb_NodeAdded)rna_Scene_depsgraph_debug,
-		                     (DEG_DebugBuildCb_RelationAdded)rna_Scene_depsgraph_debug);
-	
 	DEG_graph_build_from_scene(scene->depsgraph, bmain, scene);
-	
-	if (debug_filename && debug_filename[0])
-		DEG_debug_build_end();
 }
 
 /* note: without this, when Multi-Paint is activated/deactivated, the colors
@@ -5765,7 +5751,6 @@ void RNA_def_scene(BlenderRNA *brna)
 	RNA_def_property_struct_type(prop, "ColorManagedSequencerColorspaceSettings");
 	RNA_def_property_ui_text(prop, "Sequencer Color Space Settings", "Settings of color space sequencer is working in");
 
-
 	/* Dependency Graph */
 	prop = RNA_def_property(srna, "depsgraph", PROP_POINTER, PROP_NONE);
 	RNA_def_property_struct_type(prop, "Depsgraph");
@@ -5774,8 +5759,7 @@ void RNA_def_scene(BlenderRNA *brna)
 	func = RNA_def_function(srna, "depsgraph_rebuild", "rna_Scene_depsgraph_rebuild");
 	RNA_def_function_flag(func, FUNC_USE_MAIN);
 	RNA_def_function_ui_description(func, "Rebuild the dependency graph");
-	parm = RNA_def_string_file_path(func, "debug_filename", NULL, FILE_MAX, "Debug File Name",
-	                                "Optional file in which to store graphviz debug output");
+
 	/* Nestled Data  */
 	/* *** Non-Anim

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list