Browse Source

Do not try to take sample lock if there is no listener anyway

Samuel Thibault 5 years ago
parent
commit
2fbf9def37
1 changed files with 3 additions and 0 deletions
  1. 3 0
      src/common/knobs.c

+ 3 - 0
src/common/knobs.c

@@ -462,6 +462,9 @@ void _starpu_perf_counter_register_updater(enum starpu_perf_counter_scope scope,
 
 static void update_sample(struct starpu_perf_counter_sample *sample, void *context)
 {
+	if (sample->listener == NULL)
+		return;
+
 	_starpu_spin_lock(&sample->lock);
 	struct perf_counter_array *counters = _get_counters(sample->scope);