hc
2023-12-08 01573e231f18eb2d99162747186f59511f56b64d
kernel/tools/perf/bench/sched-messaging.c
....@@ -10,10 +10,7 @@
1010 *
1111 */
1212
13
-#include "../perf.h"
14
-#include "../util/util.h"
1513 #include <subcmd/parse-options.h>
16
-#include "../builtin.h"
1714 #include "bench.h"
1815
1916 /* Test groups of 20 processes spraying to 20 receivers */
....@@ -43,7 +40,7 @@
4340 unsigned int num_fds;
4441 int ready_out;
4542 int wakefd;
46
- int out_fds[0];
43
+ int out_fds[];
4744 };
4845
4946 struct receiver_context {
....@@ -69,11 +66,10 @@
6966 /* Block until we're ready to go */
7067 static void ready(int ready_out, int wakefd)
7168 {
72
- char dummy;
7369 struct pollfd pollfd = { .fd = wakefd, .events = POLLIN };
7470
7571 /* Tell them we're ready. */
76
- if (write(ready_out, &dummy, 1) != 1)
72
+ if (write(ready_out, "R", 1) != 1)
7773 err(EXIT_FAILURE, "CLIENT: ready write");
7874
7975 /* Wait for "GO" signal */
....@@ -88,6 +84,7 @@
8884 unsigned int i, j;
8985
9086 ready(ctx->ready_out, ctx->wakefd);
87
+ memset(data, 'S', sizeof(data));
9188
9289 /* Now pump to every receiver. */
9390 for (i = 0; i < nr_loops; i++) {