瀏覽代碼

Add debugging

Samuel Thibault 12 年之前
父節點
當前提交
ff0b27d843
共有 2 個文件被更改,包括 7 次插入1 次删除
  1. 1 0
      src/drivers/mp_common/sink_common.c
  2. 6 1
      src/drivers/mp_common/source_common.c

+ 1 - 0
src/drivers/mp_common/sink_common.c

@@ -129,6 +129,7 @@ static void _starpu_sink_common_lookup(const struct _starpu_mp_node *node,
 	void *dl_handle = dlopen(NULL, RTLD_NOW);
 	func = dlsym(dl_handle, func_name);
 
+	//_STARPU_DEBUG("Looked up %s, got %p\n", func_name, func);
 
 	/* If we couldn't find the function, let's send an error to the host.
 	 * The user probably made a mistake in the name */

+ 6 - 1
src/drivers/mp_common/source_common.c

@@ -57,13 +57,16 @@ int _starpu_src_common_lookup(struct _starpu_mp_node *node,
 	/* strlen ignore the terminating '\0' */
 	arg_size = (strlen(func_name) + 1) * sizeof(char);
 
+	//_STARPU_DEBUG("Looking up %s\n", func_name);
 	_starpu_mp_common_send_command(node, STARPU_LOOKUP, (void *) func_name,
 				       arg_size);
 	answer = _starpu_mp_common_recv_command(node, (void **) &arg,
 						&arg_size);
 
-	if (answer == STARPU_ERROR_LOOKUP)
+	if (answer == STARPU_ERROR_LOOKUP) {
+		_STARPU_DISP("Error looking up %s\n", func_name);
 		return -ESPIPE;
+	}
 
 	/* We have to be sure the device answered the right question and the
 	 * answer has the right size */
@@ -72,6 +75,8 @@ int _starpu_src_common_lookup(struct _starpu_mp_node *node,
 
 	memcpy(func_ptr, arg, arg_size);
 
+	//_STARPU_DEBUG("got %p\n", *func_ptr);
+
 	return 0;
 }