test: add benchmark-mode to clear attach-flags
authorDavid Herrmann <dh.herrmann@gmail.com>
Thu, 2 Oct 2014 10:35:33 +0000 (12:35 +0200)
committerDavid Herrmann <dh.herrmann@gmail.com>
Thu, 2 Oct 2014 10:36:53 +0000 (12:36 +0200)
Processing message attachments can take quite some time. Add a mode to
skip those.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
test/test-benchmark.c

index 82fe038fbe0a5f35a5d8ba51b52fa7e2b225a14b..3467ad9f42d2accf8db8682cf86625a1659ad96d 100644 (file)
@@ -24,6 +24,7 @@
 
 static const bool use_memfd = true;            /* transmit memfd? */
 static const bool compare_uds = false;         /* unix-socket comparison? */
+static const bool attach_none = false;         /* clear attach-flags? */
 static char stress_payload[8192];
 
 struct stats {
@@ -224,6 +225,11 @@ int kdbus_test_benchmark(struct kdbus_test_env *env)
        ret = kdbus_name_acquire(conn_a, SERVICE_NAME, NULL);
        ASSERT_RETURN(ret == 0);
 
+       if (attach_none) {
+               ret = kdbus_conn_update_attach_flags(conn_a, 0);
+               ASSERT_RETURN(ret == 0);
+       }
+
        /* setup UDS pair */
 
        ret = socketpair(AF_UNIX, SOCK_SEQPACKET | SOCK_NONBLOCK, 0, uds);