shithub: riscv

Download patch

ref: 423b54a0aeea198c8d4c0cbb23a17236d68910ec
parent: 69352f66684cbc75e2cd68c80cd028324964c5aa
author: Sigrid Solveig Haflínudóttir <sigrid@ftrv.se>
date: Mon Aug 15 14:30:42 EDT 2022

mkdevc: fix dtracy-disabled builds (thanks ori)

--- a/sys/src/9/port/mkdevc
+++ b/sys/src/9/port/mkdevc
@@ -25,6 +25,8 @@
 		devuart = 1;
 	else if($1 == "vga")
 		devvga = 1;
+	else if($1 == "dtracy")
+		devdtracy = 1
 	for(i = 2; i <= NF; i++){
 		if($i == "dma" && objtype ~ "(386|alpha|amd64)")
 			i8237dma++;
@@ -195,14 +197,18 @@
 		printf "\n";
 	}
 	
-	if(ndtracyprov){
-		printf "#include <dtracy.h>\n";
-		for(i = 0; i < ndtracyprov; i++)
-			printf "extern DTProvider %sprov;\n", dtracyprov[i]
-		printf "DTProvider *dtproviders[] = {\n"
-		for(i = 0; i < ndtracyprov; i++)
-			printf "\t&%sprov,\n", dtracyprov[i]
-		printf "\tnil,\n};\n\n"
+	if(devdtracy){
+		if(ndtracyprov){
+			printf "#include <dtracy.h>\n";
+			for(i = 0; i < ndtracyprov; i++)
+				printf "extern DTProvider %sprov;\n", dtracyprov[i]
+			printf "DTProvider *dtproviders[] = {\n"
+			for(i = 0; i < ndtracyprov; i++)
+				printf "\t&%sprov,\n", dtracyprov[i]
+			printf "\tnil,\n};\n\n"
+		}
+	}else{
+		printf "void dtracytick(Ureg*)\n{\n}\n\n";
 	}
 
 	printf "char* conffile = \"%s/%s\";\n", pwd, ARGV[1];