Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F102020901
D40311.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D40311.diff
View Options
diff --git a/tools/test/avx_sig/avx_sig.c b/tools/test/avx_sig/avx_sig.c
--- a/tools/test/avx_sig/avx_sig.c
+++ b/tools/test/avx_sig/avx_sig.c
@@ -36,6 +36,11 @@
#include <string.h>
#include <unistd.h>
+/* SIGALRM interval in seconds. */
+#ifndef TIMO
+#define TIMO 5
+#endif
+
#ifndef __unused
#define __unused __attribute__((__unused__))
#endif
@@ -79,19 +84,17 @@
atomic_fetch_add_explicit(&sigs, 1, memory_order_relaxed);
}
-#ifdef SIGINFO
static void
-siginfo_handler(int sig __unused)
+sigalrm_handler(int sig __unused)
{
struct rusage r;
if (getrusage(RUSAGE_SELF, &r) == 0) {
- printf("%lu vctx %lu nvctx %lu nsigs ",
- r.ru_nvcsw, r.ru_nivcsw, r.ru_nsignals);
+ printf("%lu vctx %lu nvctx %lu nsigs %u SIGUSR1\n",
+ r.ru_nvcsw, r.ru_nivcsw, r.ru_nsignals, sigs);
}
- printf("%u SIGUSR1\n", sigs);
+ alarm(TIMO);
}
-#endif
static struct xmm zero_xmm = {};
@@ -183,14 +186,12 @@
struct sigaction sa;
int error, i, ncpu;
-#ifdef SIGINFO
bzero(&sa, sizeof(sa));
- sa.sa_handler = siginfo_handler;
- if (sigaction(SIGINFO, &sa, NULL) == -1) {
- fprintf(stderr, "sigaction SIGINFO %s\n", strerror(errno));
+ sa.sa_handler = sigalrm_handler;
+ if (sigaction(SIGALRM, &sa, NULL) == -1) {
+ fprintf(stderr, "sigaction SIGALRM %s\n", strerror(errno));
exit(1);
}
-#endif
bzero(&sa, sizeof(sa));
sa.sa_sigaction = sigusr1_handler;
@@ -216,6 +217,7 @@
}
}
+ alarm(TIMO);
for (;;) {
for (i = 0; i < ncpu; i++) {
my_pause();
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Nov 7, 3:34 PM (21 h, 57 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14515825
Default Alt Text
D40311.diff (1 KB)
Attached To
Mode
D40311: avx_sig: Print statistics by interval if ^T is not supported
Attached
Detach File
Event Timeline
Log In to Comment