CVS commit: src/external/cddl/osnet/dist/tools/ctf/cvt

2024-05-04 Thread Valery Ushakov
Module Name:src
Committed By:   uwe
Date:   Sat May  4 18:22:59 UTC 2024

Modified Files:
src/external/cddl/osnet/dist/tools/ctf/cvt: ctfmerge.c

Log Message:
ctfmerge: obey CTFMERGE_TERMINATE_NO_UNLINK as a tool too


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 \
src/external/cddl/osnet/dist/tools/ctf/cvt/ctfmerge.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/cddl/osnet/dist/tools/ctf/cvt/ctfmerge.c
diff -u src/external/cddl/osnet/dist/tools/ctf/cvt/ctfmerge.c:1.19 src/external/cddl/osnet/dist/tools/ctf/cvt/ctfmerge.c:1.20
--- src/external/cddl/osnet/dist/tools/ctf/cvt/ctfmerge.c:1.19	Fri May  3 15:50:42 2024
+++ src/external/cddl/osnet/dist/tools/ctf/cvt/ctfmerge.c	Sat May  4 18:22:59 2024
@@ -682,7 +682,7 @@ terminate_cleanup(void)
 	if (outfile == NULL)
 		return;
 
-#if !defined (__FreeBSD__) && !defined(__NetBSD__)
+#if !defined (__FreeBSD__) && !(defined(__NetBSD__) || HAVE_NBTOOL_CONFIG_H)
 	if (dounlink) {
 		fprintf(stderr, "Removing %s\n", outfile);
 		unlink(outfile);



CVS commit: src/external/cddl/osnet/dist/tools/ctf/cvt

2024-05-04 Thread Valery Ushakov
Module Name:src
Committed By:   uwe
Date:   Sat May  4 18:22:59 UTC 2024

Modified Files:
src/external/cddl/osnet/dist/tools/ctf/cvt: ctfmerge.c

Log Message:
ctfmerge: obey CTFMERGE_TERMINATE_NO_UNLINK as a tool too


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 \
src/external/cddl/osnet/dist/tools/ctf/cvt/ctfmerge.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/cddl/osnet/dist/tools/ctf/cvt

2024-05-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri May  3 15:50:42 UTC 2024

Modified Files:
src/external/cddl/osnet/dist/tools/ctf/cvt: ctfmerge.c

Log Message:
add an environment variable to override the number ot threads.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 \
src/external/cddl/osnet/dist/tools/ctf/cvt/ctfmerge.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/cddl/osnet/dist/tools/ctf/cvt/ctfmerge.c
diff -u src/external/cddl/osnet/dist/tools/ctf/cvt/ctfmerge.c:1.18 src/external/cddl/osnet/dist/tools/ctf/cvt/ctfmerge.c:1.19
--- src/external/cddl/osnet/dist/tools/ctf/cvt/ctfmerge.c:1.18	Tue May 23 14:54:58 2023
+++ src/external/cddl/osnet/dist/tools/ctf/cvt/ctfmerge.c	Fri May  3 11:50:42 2024
@@ -712,6 +712,7 @@ static void
 wq_init(workqueue_t *wq, int nfiles)
 {
 	int throttle, nslots, i;
+	const char *e;
 
 	if (getenv("CTFMERGE_MAX_SLOTS"))
 		nslots = atoi(getenv("CTFMERGE_MAX_SLOTS"));
@@ -728,17 +729,21 @@ wq_init(workqueue_t *wq, int nfiles)
 
 	wq->wq_wip = xcalloc(sizeof (wip_t) * nslots);
 	wq->wq_nwipslots = nslots;
+	e = getenv("CTFMERGE_NUM_THREADS");
+	if (e) {
+		wq->wq_nthreads = atoi(e);
+	} else {
 #ifdef _SC_NPROCESSORS_ONLN
-	wq->wq_nthreads = MIN(sysconf(_SC_NPROCESSORS_ONLN) * 3 / 2, nslots);
+		wq->wq_nthreads = MIN(sysconf(_SC_NPROCESSORS_ONLN) * 3 / 2,
+		nslots);
 #else
-	wq->wq_nthreads = 2;
+		wq->wq_nthreads = 2;
 #endif
+	}
 	wq->wq_thread = xmalloc(sizeof (pthread_t) * wq->wq_nthreads);
 
-	if (getenv("CTFMERGE_INPUT_THROTTLE"))
-		throttle = atoi(getenv("CTFMERGE_INPUT_THROTTLE"));
-	else
-		throttle = MERGE_INPUT_THROTTLE_LEN;
+	e = getenv("CTFMERGE_INPUT_THROTTLE");
+	throttle = e ? atoi(e) : MERGE_INPUT_THROTTLE_LEN;
 	wq->wq_ithrottle = throttle * wq->wq_nthreads;
 
 	debug(1, "Using %d slots, %d threads\n", wq->wq_nwipslots,



CVS commit: src/external/cddl/osnet/dist/tools/ctf/cvt

2024-05-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri May  3 15:50:42 UTC 2024

Modified Files:
src/external/cddl/osnet/dist/tools/ctf/cvt: ctfmerge.c

Log Message:
add an environment variable to override the number ot threads.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 \
src/external/cddl/osnet/dist/tools/ctf/cvt/ctfmerge.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/cddl/osnet/dist/tools/ctf/cvt

2023-05-25 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Thu May 25 12:53:56 UTC 2023

Modified Files:
src/external/cddl/osnet/dist/tools/ctf/cvt: barrier.c

Log Message:
ctfmerge: fix macOS semaphore implementation, part 2

dispatch_semaphore_signal() doesn't return an error, just an
indicator of whether a thread was woken or not, so there's
no need to fail on non-zero return.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/external/cddl/osnet/dist/tools/ctf/cvt/barrier.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/cddl/osnet/dist/tools/ctf/cvt

2023-05-25 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Thu May 25 12:53:56 UTC 2023

Modified Files:
src/external/cddl/osnet/dist/tools/ctf/cvt: barrier.c

Log Message:
ctfmerge: fix macOS semaphore implementation, part 2

dispatch_semaphore_signal() doesn't return an error, just an
indicator of whether a thread was woken or not, so there's
no need to fail on non-zero return.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/external/cddl/osnet/dist/tools/ctf/cvt/barrier.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/cddl/osnet/dist/tools/ctf/cvt/barrier.c
diff -u src/external/cddl/osnet/dist/tools/ctf/cvt/barrier.c:1.7 src/external/cddl/osnet/dist/tools/ctf/cvt/barrier.c:1.8
--- src/external/cddl/osnet/dist/tools/ctf/cvt/barrier.c:1.7	Tue May 23 19:53:24 2023
+++ src/external/cddl/osnet/dist/tools/ctf/cvt/barrier.c	Thu May 25 12:53:56 2023
@@ -109,9 +109,8 @@ barrier_wait(barrier_t *bar)
 			if ((errno = sema_post(>bar_sem)) != 0)
 terminate("%s: sema_post(bar_sem)", __func__);
 #elif defined(HAVE_DISPATCH_SEMAPHORE_CREATE)
-			if ((error = dispatch_semaphore_signal(bar->bar_sem)) != 0)
-terminate("%s: dispatch_semaphore_signal(bar_sem) = %ld\n",
-__func__, error);
+			/* return value doesn't matter */
+			dispatch_semaphore_signal(bar->bar_sem);
 #else
 			if (sem_post(>bar_sem) == -1)
 terminate("%s: sem_post(bar_sem)", __func__);



CVS commit: src/external/cddl/osnet/dist/tools/ctf/cvt

2023-05-23 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Tue May 23 18:54:58 UTC 2023

Modified Files:
src/external/cddl/osnet/dist/tools/ctf/cvt: barrier.c ctfmerge.c
tdata.c

Log Message:
ctfmerge: error check sem_*() and pthread_*() APIs

terminate() if sem_*() returns -1 or pthread_*() returns != 0.
(Set errno from pthread_*() so terminate() prints the strerror message).

Note: Failing on errors instead of ignoring them helps identify
reasons for intermittent failures, such as those on macOS host builds:
  ERROR: nbctfmerge: barrier_init: sem_init(bar_sem): Function not implemented


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/cddl/osnet/dist/tools/ctf/cvt/barrier.c
cvs rdiff -u -r1.17 -r1.18 \
src/external/cddl/osnet/dist/tools/ctf/cvt/ctfmerge.c
cvs rdiff -u -r1.9 -r1.10 src/external/cddl/osnet/dist/tools/ctf/cvt/tdata.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/cddl/osnet/dist/tools/ctf/cvt/barrier.c
diff -u src/external/cddl/osnet/dist/tools/ctf/cvt/barrier.c:1.5 src/external/cddl/osnet/dist/tools/ctf/cvt/barrier.c:1.6
--- src/external/cddl/osnet/dist/tools/ctf/cvt/barrier.c:1.5	Thu Jun 20 14:33:04 2019
+++ src/external/cddl/osnet/dist/tools/ctf/cvt/barrier.c	Tue May 23 18:54:58 2023
@@ -42,6 +42,7 @@
  * get a return code of 0.
  */
 
+#include 
 #include 
 #ifdef illumos
 #include 
@@ -49,15 +50,19 @@
 #include 
 
 #include "barrier.h"
+#include "ctftools.h"
 
 void
 barrier_init(barrier_t *bar, int nthreads)
 {
-	pthread_mutex_init(>bar_lock, NULL);
+	if ((errno = pthread_mutex_init(>bar_lock, NULL)) != 0)
+		terminate("%s: pthread_mutex_init(bar_lock)", __func__);
 #ifdef illumos
-	sema_init(>bar_sem, 0, USYNC_THREAD, NULL);
+	if ((errno = sema_init(>bar_sem, 0, USYNC_THREAD, NULL)) != 0)
+		terminate("%s: sema_init(bar_sem)", __func__);
 #else
-	sem_init(>bar_sem, 0, 0);
+	if (sem_init(>bar_sem, 0, 0) == -1)
+		terminate("%s: sem_init(bar_sem)", __func__);
 #endif
 
 	bar->bar_numin = 0;
@@ -67,14 +72,19 @@ barrier_init(barrier_t *bar, int nthread
 int
 barrier_wait(barrier_t *bar)
 {
-	pthread_mutex_lock(>bar_lock);
+	if ((errno = pthread_mutex_lock(>bar_lock)) != 0)
+		terminate("%s: pthread_mutex_lock(bar_lock)", __func__);
 
 	if (++bar->bar_numin < bar->bar_nthr) {
-		pthread_mutex_unlock(>bar_lock);
+		if ((errno = pthread_mutex_unlock(>bar_lock)) != 0)
+			terminate("%s: pthread_mutex_unlock(bar_lock)",
+			__func__);
 #ifdef illumos
-		sema_wait(>bar_sem);
+		if ((errno = sema_wait(>bar_sem)) != 0)
+			terminate("%s: sema_wait(bar_sem)", __func__);
 #else
-		sem_wait(>bar_sem);
+		if (sem_wait(>bar_sem) == -1)
+			terminate("%s: sem_wait(bar_sem)", __func__);
 #endif
 
 		return (0);
@@ -86,11 +96,15 @@ barrier_wait(barrier_t *bar)
 		bar->bar_numin = 0;
 		for (i = 1; i < bar->bar_nthr; i++)
 #ifdef illumos
-			sema_post(>bar_sem);
+			if ((errno = sema_post(>bar_sem)) != 0)
+terminate("%s: sema_post(bar_sem)", __func__);
 #else
-			sem_post(>bar_sem);
+			if (sem_post(>bar_sem) == -1)
+terminate("%s: sem_post(bar_sem)", __func__);
 #endif
-		pthread_mutex_unlock(>bar_lock);
+		if ((errno = pthread_mutex_unlock(>bar_lock)) != 0)
+			terminate("%s: pthread_mutex_unlock(bar_lock)",
+			__func__);
 
 		return (1);
 	}

Index: src/external/cddl/osnet/dist/tools/ctf/cvt/ctfmerge.c
diff -u src/external/cddl/osnet/dist/tools/ctf/cvt/ctfmerge.c:1.17 src/external/cddl/osnet/dist/tools/ctf/cvt/ctfmerge.c:1.18
--- src/external/cddl/osnet/dist/tools/ctf/cvt/ctfmerge.c:1.17	Sun Oct 13 21:32:07 2019
+++ src/external/cddl/osnet/dist/tools/ctf/cvt/ctfmerge.c	Tue May 23 18:54:58 2023
@@ -373,22 +373,31 @@ init_phase_two(workqueue_t *wq)
 static void
 wip_save_work(workqueue_t *wq, wip_t *slot, int slotnum)
 {
-	pthread_mutex_lock(>wq_donequeue_lock);
-
-	while (wq->wq_lastdonebatch + 1 < slot->wip_batchid)
-		pthread_cond_wait(>wip_cv, >wq_donequeue_lock);
+	if ((errno = pthread_mutex_lock(>wq_donequeue_lock)) != 0)
+		terminate("%s: pthread_mutex_lock(wq_donequeue_lock)",
+		__func__);
+
+	while (wq->wq_lastdonebatch + 1 < slot->wip_batchid) {
+		if ((errno = pthread_cond_wait(>wip_cv, >wq_donequeue_lock)) != 0)
+			terminate("%s: pthread_cond_wait(wip_cv,wq_donequeue_lock)",
+			__func__);
+	}
 	assert(wq->wq_lastdonebatch + 1 == slot->wip_batchid);
 
 	fifo_add(wq->wq_donequeue, slot->wip_td);
 	wq->wq_lastdonebatch++;
-	pthread_cond_signal(>wq_wip[(slotnum + 1) %
-	wq->wq_nwipslots].wip_cv);
+	const int nextslot = (slotnum + 1) % wq->wq_nwipslots;
+	if ((errno = pthread_cond_signal(>wq_wip[nextslot].wip_cv)) != 0)
+		terminate("%s: pthread_cond_signal(wq_wip[%d].wip_cv)",
+		__func__, nextslot);
 
 	/* reset the slot for next use */
 	slot->wip_td = NULL;
 	slot->wip_batchid = wq->wq_next_batchid++;
 
-	pthread_mutex_unlock(>wq_donequeue_lock);
+	if ((errno = pthread_mutex_unlock(>wq_donequeue_lock)) != 0)

CVS commit: src/external/cddl/osnet/dist/tools/ctf/cvt

2023-05-23 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Tue May 23 18:54:58 UTC 2023

Modified Files:
src/external/cddl/osnet/dist/tools/ctf/cvt: barrier.c ctfmerge.c
tdata.c

Log Message:
ctfmerge: error check sem_*() and pthread_*() APIs

terminate() if sem_*() returns -1 or pthread_*() returns != 0.
(Set errno from pthread_*() so terminate() prints the strerror message).

Note: Failing on errors instead of ignoring them helps identify
reasons for intermittent failures, such as those on macOS host builds:
  ERROR: nbctfmerge: barrier_init: sem_init(bar_sem): Function not implemented


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/cddl/osnet/dist/tools/ctf/cvt/barrier.c
cvs rdiff -u -r1.17 -r1.18 \
src/external/cddl/osnet/dist/tools/ctf/cvt/ctfmerge.c
cvs rdiff -u -r1.9 -r1.10 src/external/cddl/osnet/dist/tools/ctf/cvt/tdata.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/cddl/osnet/dist/tools/ctf/cvt

2022-12-25 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Dec 25 20:23:43 UTC 2022

Modified Files:
src/external/cddl/osnet/dist/tools/ctf/cvt: output.c

Log Message:
Don't bail out if the input file does not have a symbol table. This happens
with crtn.o which used to have an empty symbol table with binutils 2.34,
with binutils 2.39 has no symbol table.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/external/cddl/osnet/dist/tools/ctf/cvt/output.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/cddl/osnet/dist/tools/ctf/cvt/output.c
diff -u src/external/cddl/osnet/dist/tools/ctf/cvt/output.c:1.9 src/external/cddl/osnet/dist/tools/ctf/cvt/output.c:1.10
--- src/external/cddl/osnet/dist/tools/ctf/cvt/output.c:1.9	Mon May 28 17:05:06 2018
+++ src/external/cddl/osnet/dist/tools/ctf/cvt/output.c	Sun Dec 25 15:23:42 2022
@@ -353,15 +353,17 @@ sort_iidescs(Elf *elf, const char *file,
 	match.iim_file = NULL;
 
 	if ((stidx = findelfsecidx(elf, file,
-	dynsym ? ".dynsym" : ".symtab")) < 0)
-		terminate("%s: Can't open symbol table\n", file);
-	scn = elf_getscn(elf, stidx);
-	data = elf_getdata(scn, NULL);
-	gelf_getshdr(scn, );
-	nent = shdr.sh_size / shdr.sh_entsize;
+	dynsym ? ".dynsym" : ".symtab")) < 0) {
+		nent = 0;
+	} else {
+		scn = elf_getscn(elf, stidx);
+		data = elf_getdata(scn, NULL);
+		gelf_getshdr(scn, );
+		nent = shdr.sh_size / shdr.sh_entsize;
 
-	scn = elf_getscn(elf, shdr.sh_link);
-	strdata = elf_getdata(scn, NULL);
+		scn = elf_getscn(elf, shdr.sh_link);
+		strdata = elf_getdata(scn, NULL);
+	}
 
 	iiburst = iiburst_new(td, nent);
 
@@ -665,8 +667,7 @@ write_file(Elf *src, const char *srcname
 	}
 
 	if (symtab_idx == -1) {
-		terminate("%s: Cannot find %s section\n", srcname,
-		dynsym ? "SHT_DYNSYM" : "SHT_SYMTAB");
+		goto out;
 	}
 
 	/* Add the ctf section */
@@ -709,6 +710,7 @@ write_file(Elf *src, const char *srcname
 	/* commit to disk */
 	dehdr.e_shstrndx = secxlate[sehdr.e_shstrndx];
 	gelf_update_ehdr(dst, );
+out:
 	if (elf_update(dst, ELF_C_WRITE) < 0)
 		elfterminate(dstname, "Cannot finalize temp file");
 



CVS commit: src/external/cddl/osnet/dist/tools/ctf/cvt

2022-12-25 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Dec 25 20:23:43 UTC 2022

Modified Files:
src/external/cddl/osnet/dist/tools/ctf/cvt: output.c

Log Message:
Don't bail out if the input file does not have a symbol table. This happens
with crtn.o which used to have an empty symbol table with binutils 2.34,
with binutils 2.39 has no symbol table.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/external/cddl/osnet/dist/tools/ctf/cvt/output.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/cddl/osnet/dist/tools/ctf/cvt

2019-10-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Oct 13 21:32:07 UTC 2019

Modified Files:
src/external/cddl/osnet/dist/tools/ctf/cvt: ctfmerge.c

Log Message:
make worker thread prototype match the pthread_create signature.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 \
src/external/cddl/osnet/dist/tools/ctf/cvt/ctfmerge.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/cddl/osnet/dist/tools/ctf/cvt/ctfmerge.c
diff -u src/external/cddl/osnet/dist/tools/ctf/cvt/ctfmerge.c:1.16 src/external/cddl/osnet/dist/tools/ctf/cvt/ctfmerge.c:1.17
--- src/external/cddl/osnet/dist/tools/ctf/cvt/ctfmerge.c:1.16	Mon May 28 17:05:06 2018
+++ src/external/cddl/osnet/dist/tools/ctf/cvt/ctfmerge.c	Sun Oct 13 17:32:07 2019
@@ -528,9 +528,10 @@ worker_runphase2(workqueue_t *wq)
 /*
  * Main loop for worker threads.
  */
-static void
-worker_thread(workqueue_t *wq)
+static void *
+worker_thread(void *v)
 {
+	workqueue_t *wq = v;
 	worker_runphase1(wq);
 
 	debug(2, "0x%jx: entering first barrier\n",
@@ -559,6 +560,7 @@ worker_thread(workqueue_t *wq)
 	(uintmax_t)(uintptr_t)pthread_self());
 
 	worker_runphase2(wq);
+	return NULL;
 }
 
 /*
@@ -728,8 +730,7 @@ start_threads(workqueue_t *wq)
 	pthread_sigmask(SIG_BLOCK, , NULL);
 
 	for (i = 0; i < wq->wq_nthreads; i++) {
-		pthread_create(>wq_thread[i], NULL,
-		(void *(*)(void *))worker_thread, wq);
+		pthread_create(>wq_thread[i], NULL, worker_thread, wq);
 	}
 
 #ifdef illumos



CVS commit: src/external/cddl/osnet/dist/tools/ctf/cvt

2019-10-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Oct 13 21:32:07 UTC 2019

Modified Files:
src/external/cddl/osnet/dist/tools/ctf/cvt: ctfmerge.c

Log Message:
make worker thread prototype match the pthread_create signature.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 \
src/external/cddl/osnet/dist/tools/ctf/cvt/ctfmerge.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



Re: CVS commit: src/external/cddl/osnet/dist/tools/ctf/cvt

2019-07-18 Thread Sevan Janiyan
On 18/07/2019 08:38, Sevan Janiyan wrote:
> I still need to pass noxlibs

I meant -xnolibs


Sevan


Re: CVS commit: src/external/cddl/osnet/dist/tools/ctf/cvt

2019-07-18 Thread Sevan Janiyan
On 16/07/2019 08:27, Juergen Hannken-Illjes wrote:
> Module Name:  src
> Committed By: hannken
> Date: Tue Jul 16 07:27:35 UTC 2019
> 
> Modified Files:
>   src/external/cddl/osnet/dist/tools/ctf/cvt: fixup_tdescs.c
> 
> Log Message:
> XXX: A crude hack to bring down the number of types for a
> GENRIC kernel below 2**15-1 (from ~34000 to ~29800).
> 
> Remove the type attributes "volatile", "const" and "restrict",
> for DTRACE these attributes are of little value.

With these latest batch of changes (not specifically this commit),
DTrace works for me again, I still need to pass noxlibs but I was able
to instrument the system once again. Thank you! :)


Sevan



CVS commit: src/external/cddl/osnet/dist/tools/ctf/cvt

2019-07-16 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Tue Jul 16 07:27:35 UTC 2019

Modified Files:
src/external/cddl/osnet/dist/tools/ctf/cvt: fixup_tdescs.c

Log Message:
XXX: A crude hack to bring down the number of types for a
GENRIC kernel below 2**15-1 (from ~34000 to ~29800).

Remove the type attributes "volatile", "const" and "restrict",
for DTRACE these attributes are of little value.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 \
src/external/cddl/osnet/dist/tools/ctf/cvt/fixup_tdescs.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/cddl/osnet/dist/tools/ctf/cvt

2019-07-16 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Tue Jul 16 07:27:35 UTC 2019

Modified Files:
src/external/cddl/osnet/dist/tools/ctf/cvt: fixup_tdescs.c

Log Message:
XXX: A crude hack to bring down the number of types for a
GENRIC kernel below 2**15-1 (from ~34000 to ~29800).

Remove the type attributes "volatile", "const" and "restrict",
for DTRACE these attributes are of little value.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 \
src/external/cddl/osnet/dist/tools/ctf/cvt/fixup_tdescs.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/cddl/osnet/dist/tools/ctf/cvt/fixup_tdescs.c
diff -u src/external/cddl/osnet/dist/tools/ctf/cvt/fixup_tdescs.c:1.4 src/external/cddl/osnet/dist/tools/ctf/cvt/fixup_tdescs.c:1.5
--- src/external/cddl/osnet/dist/tools/ctf/cvt/fixup_tdescs.c:1.4	Tue Jul 16 07:26:41 2019
+++ src/external/cddl/osnet/dist/tools/ctf/cvt/fixup_tdescs.c	Tue Jul 16 07:27:35 2019
@@ -41,6 +41,7 @@
 #include "ctftools.h"
 #include "hash.h"
 #include "memory.h"
+#include "traverse.h"
 
 /*
  * Due to 4432619, the 6.1 compiler will sometimes incorrectly generate pointer
@@ -320,6 +321,55 @@ fix_kmutex_private(tdata_t *td, size_t p
 	}
 }
 
+/*
+ * XXX: A crude hack to bring down the number of types for a
+ * GENRIC kernel below 2**15-1 (from ~34000 to ~29800).
+ *
+ * Remove the type attributes "volatile", "const" and "restrict",
+ * for DTRACE these attributes are of little value.
+ */
+
+static int
+fix_kill_attr_cb(tdesc_t *tdp, tdesc_t **tdpp, void *private __unused)
+{
+
+	while (tdp->t_type == VOLATILE ||
+	tdp->t_type == RESTRICT ||
+	tdp->t_type == CONST)
+		tdp = tdp->t_tdesc;
+
+	*tdpp = tdp;
+
+	return 1;
+}
+
+static tdtrav_cb_f fix_kill_attr_tab[] = {
+	NULL,
+	NULL,			/* intrinsic */
+	NULL,			/* pointer */
+	NULL,			/* reference */
+	NULL,			/* array */
+	NULL,			/* function */
+	NULL,			/* struct */
+	NULL,			/* union */
+	NULL,			/* class */
+	NULL,			/* enum */
+	NULL		,	/* forward */
+	NULL,			/* typedef */
+	NULL,			/* typedef unres */
+	fix_kill_attr_cb,	/* volatile */
+	fix_kill_attr_cb,	/* const */
+	fix_kill_attr_cb,	/* restrict */
+};
+
+static void
+fix_kill_attr(tdata_t *td, size_t ptrsize)
+{
+
+	(void) iitraverse_hash(td->td_iihash, >td_curvgen,
+	fix_kill_attr_tab, NULL, NULL, NULL);
+}
+
 #endif /* __NetBSD__ */
 
 void
@@ -328,5 +378,6 @@ cvt_fixups(tdata_t *td, size_t ptrsize)
 	fix_small_cpu_struct(td, ptrsize);
 #ifdef __NetBSD__
 	fix_kmutex_private(td, ptrsize);
+	fix_kill_attr(td, ptrsize);
 #endif
 }



CVS commit: src/external/cddl/osnet/dist/tools/ctf/cvt

2019-07-16 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Tue Jul 16 07:26:41 UTC 2019

Modified Files:
src/external/cddl/osnet/dist/tools/ctf/cvt: fixup_tdescs.c

Log Message:
Add fixup operation to remove private mutex types for x86.

For GENERIC the number of types goes down from 47351 to 33981.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 \
src/external/cddl/osnet/dist/tools/ctf/cvt/fixup_tdescs.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/cddl/osnet/dist/tools/ctf/cvt/fixup_tdescs.c
diff -u src/external/cddl/osnet/dist/tools/ctf/cvt/fixup_tdescs.c:1.3 src/external/cddl/osnet/dist/tools/ctf/cvt/fixup_tdescs.c:1.4
--- src/external/cddl/osnet/dist/tools/ctf/cvt/fixup_tdescs.c:1.3	Wed Feb 24 21:53:26 2010
+++ src/external/cddl/osnet/dist/tools/ctf/cvt/fixup_tdescs.c	Tue Jul 16 07:26:41 2019
@@ -276,8 +276,57 @@ fix_small_cpu_struct(tdata_t *td, size_t
 	lml->ml_next = cpum;
 }
 
+#ifdef __NetBSD__
+
+/*
+ * The kmutex structure comes in two flavours, with or without __MUTEX_PRIVATE
+ * defined.  Since many structures include kmutexes this causes massive amounts
+ * of duplication on merge (~ 40% for a GENERIC kernel).  Remove the private
+ * fields if we see them.
+ */
+static void
+fix_kmutex_private(tdata_t *td, size_t ptrsize)
+{
+	tdesc_t *desc;
+	mlist_t *ml;
+
+	/*
+	 * X86 kmutex is either
+	 *	union {
+	 *		volatile uintptr_t mtxa_owner;
+	 *	} u
+	 * or
+	 *	union {
+	 *		volatile uintptr_t mtxa_owner;
+	 *		struct {
+	 *			...
+	 *		} s;
+	 *	} u
+	 * so we remove "struct s" if we find it.
+	 */
+	if ((desc = lookup_tdesc(td, "kmutex")) != NULL &&
+	desc->t_type == STRUCT &&
+	(ml = desc->t_members) != NULL &&
+	streq(ml->ml_name, "u") &&
+	(desc = ml->ml_type) != NULL &&
+	desc->t_type == UNION &&
+	(ml = desc->t_members) != NULL &&
+	streq(ml->ml_name, "mtxa_owner") &&
+	(ml = ml->ml_next) != NULL &&
+	streq(ml->ml_name, "s") &&
+	ml->ml_next == NULL) {
+		/* Found, delete member "s". */
+		desc->t_members->ml_next = NULL;
+	}
+}
+
+#endif /* __NetBSD__ */
+
 void
 cvt_fixups(tdata_t *td, size_t ptrsize)
 {
 	fix_small_cpu_struct(td, ptrsize);
+#ifdef __NetBSD__
+	fix_kmutex_private(td, ptrsize);
+#endif
 }



CVS commit: src/external/cddl/osnet/dist/tools/ctf/cvt

2019-07-16 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Tue Jul 16 07:26:41 UTC 2019

Modified Files:
src/external/cddl/osnet/dist/tools/ctf/cvt: fixup_tdescs.c

Log Message:
Add fixup operation to remove private mutex types for x86.

For GENERIC the number of types goes down from 47351 to 33981.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 \
src/external/cddl/osnet/dist/tools/ctf/cvt/fixup_tdescs.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/cddl/osnet/dist/tools/ctf/cvt

2019-06-20 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Jun 20 14:33:05 UTC 2019

Modified Files:
src/external/cddl/osnet/dist/tools/ctf/cvt: alist.c barrier.c fifo.c
hash.c stack.c strtab.c

Log Message:
Toolify


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/cddl/osnet/dist/tools/ctf/cvt/alist.c
cvs rdiff -u -r1.4 -r1.5 src/external/cddl/osnet/dist/tools/ctf/cvt/barrier.c \
src/external/cddl/osnet/dist/tools/ctf/cvt/strtab.c
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/external/cddl/osnet/dist/tools/ctf/cvt/fifo.c \
src/external/cddl/osnet/dist/tools/ctf/cvt/stack.c
cvs rdiff -u -r1.2 -r1.3 src/external/cddl/osnet/dist/tools/ctf/cvt/hash.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.