Browse Source

Add starpu_fxt_stop_profiling, document it and starpu_fxt_start_profiling

Samuel Thibault 12 years ago
parent
commit
3ebe909edf
3 changed files with 28 additions and 2 deletions
  1. 19 0
      doc/chapters/advanced-api.texi
  2. 3 2
      include/starpu_fxt.h
  3. 6 0
      src/common/fxt.c

+ 19 - 0
doc/chapters/advanced-api.texi

@@ -8,6 +8,7 @@
 
 @menu
 * Insert Task::
+* Tracing support::
 * MPI Interface::
 * Defining a new data interface::
 * Multiformat Data Interface::
@@ -96,6 +97,24 @@ task automatically created using the function
 @code{starpu_insert_task} defined above.
 @end deftypefun
 
+@node Tracing support
+@section Tracing support
+
+@deftypefun void starpu_fxt_start_profiling (void)
+Start recording the trace. The trace is by default started from
+@code{starpu_init()} call, unless setting @code{no_auto_start_trace} to 1 in
+@code{starpu_conf}, in which case @code{starpu_fxt_start_profiling} should be
+called to specify when to start recording events.
+@end deftypefun
+
+@deftypefun void starpu_fxt_stop_profiling (void)
+Stop recording the trace. The trace is by default stopped at
+@code{starpu_shutdown()} call. @code{starpu_fxt_stop_profiling} can however be
+used to stop it earlier. @code{starpu_fxt_start_profiling} can then be called to
+start recording it again, etc.
+@end deftypefun
+
+
 @node MPI Interface
 @section MPI Interface
 

+ 3 - 2
include/starpu_fxt.h

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2010-2011  Université de Bordeaux 1
+ * Copyright (C) 2010-2011, 2013  Université de Bordeaux 1
  * Copyright (C) 2010, 2011, 2013  Centre National de la Recherche Scientifique
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -70,7 +70,8 @@ struct starpu_fxt_options
 
 void starpu_fxt_options_init(struct starpu_fxt_options *options);
 void starpu_fxt_generate_trace(struct starpu_fxt_options *options);
-void starpu_fxt_start_profiling();
+void starpu_fxt_start_profiling(void);
+void starpu_fxt_stop_profiling(void);
 
 #ifdef __cplusplus
 }

+ 6 - 0
src/common/fxt.c

@@ -109,6 +109,12 @@ void starpu_fxt_start_profiling()
 	fut_keychange(FUT_ENABLE, FUT_KEYMASKALL, threadid);
 }
 
+void starpu_fxt_stop_profiling()
+{
+	unsigned threadid = _starpu_gettid();
+	fut_keychange(FUT_DISABLE, FUT_KEYMASKALL, threadid);
+}
+
 void _starpu_init_fxt_profiling(unsigned no_auto_start_trace, unsigned trace_buffer_size)
 {
 	unsigned threadid;