瀏覽代碼

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

Samuel Thibault 5 年之前
父節點
當前提交
2fbf9def37
共有 1 個文件被更改,包括 3 次插入0 次删除
  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);