Kaynağa Gözat

if prefix is empty (single-node trace), return 0

Lucas Schnorr 8 yıl önce
ebeveyn
işleme
685a1ef842
1 değiştirilmiş dosya ile 3 ekleme ve 0 silme
  1. 3 0
      src/debug/traces/starpu_fxt.c

+ 3 - 0
src/debug/traces/starpu_fxt.c

@@ -595,6 +595,9 @@ static int register_worker_id(unsigned long nodeid, unsigned long tid, int worke
 }
 static int prefixTOnodeid (const char *prefix)
 {
+	//if we are a single-node trace, prefix is empty, so return 0
+	if (strcmp(prefix, "")==0) return 0;
+
 	char *str = malloc(sizeof(char)*strlen(prefix));
 	strncpy (str, prefix, strlen(prefix));
 	str[strlen(prefix)-1] = '\0';