2 This file is part of GNUnet.
3 (C) 2011, 2012 Christian Grothoff (and other contributing authors)
5 GNUnet is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published
7 by the Free Software Foundation; either version 3, or (at your
8 option) any later version.
10 GNUnet is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with GNUnet; see the file COPYING. If not, write to the
17 Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA.
22 * @file stream/perf_stream_api.c
23 * @brief performance benchmarks for stream api
24 * @author Sree Harsha Totakura
27 #define LOG(kind, ...) \
28 GNUNET_log (kind, __VA_ARGS__);
30 /****************************************************************************************/
31 /* Test is setup into the following major steps: */
32 /* 1. Measurements over loopback (1 hop). i.e. we use only one peer and open */
33 /* stream connections over loopback. Messages will go through */
34 /* STREAM_API->MESH_API->MESH_SERVICE->MESH_API->STREAM_API. */
35 /* 2. Measurements over 2 peers (2 hops). We use testbed to create 2 peers, */
36 /* connect them and then create stream connections. Messages will go through */
37 /* STREAM_API->MESH_API->MESH_SERVICE->CORE1.....CORE2->MESH_API->STREAM_API */
38 /* 3. Measurements over 3 peers (3 hops). We use testbed to create 3 peers, */
39 /* connect them in a line topology: peer1->peer2->peer3. Messages will go */
41 /* STREAM_API->MESH_API->MESH_SERVICE->CORE1..CORE2..CORE3->MESH_API->STREAM_API. */
42 /****************************************************************************************/
45 #include "gnunet_common.h"
46 #include "gnunet_util_lib.h"
47 #include "gnunet_testing_lib.h"
48 #include "gnunet_testbed_service.h"
49 #include "gnunet_stream_lib.h"
54 * Simple struct to keep track of progress, and print a
55 * nice little percentage meter for long running tasks.
65 unsigned int completed;
79 * Single hop loopback testing
84 * Testing with 2 peers
89 * Testing with 3 peers
96 * Structure for holding peer's sockets and IO Handles
101 * Peer's stream socket
103 struct GNUNET_STREAM_Socket *socket;
106 * Peer's io write handle
108 struct GNUNET_STREAM_IOWriteHandle *io_write_handle;
111 * Peer's io read handle
113 struct GNUNET_STREAM_IOReadHandle *io_read_handle;
116 * The peer handle when we use the testbed servie
118 struct GNUNET_TESTBED_Peer *peer;
121 * Handle to peer specific opearations while using testbed service
123 struct GNUNET_TESTBED_Operation *op;
126 * The identity of this peer
128 struct GNUNET_PeerIdentity id;
131 * Bytes the peer has written
133 unsigned int bytes_wrote;
136 * Byte the peer has read
138 unsigned int bytes_read;
143 * Enumeration of stages in this testing
153 * Uplink testing stage
158 * Downlink testing stage
165 * Maximum size of the data which we will transfer during tests
167 #define DATA_SIZE 5000000 /* 5mB */
170 * Listen socket of peer2
172 struct GNUNET_STREAM_ListenSocket *peer2_listen_socket;
175 * Handle to configuration during TEST_STEP_1_HOP
177 const struct GNUNET_CONFIGURATION_Handle *config;
180 * Handle for the progress meter
182 static struct ProgressMeter *meter;
185 * Placeholder for peer data
187 static struct PeerData peer_data[3];
190 * Handle to common operations while using testbed
192 static struct GNUNET_TESTBED_Operation *common_op;
195 * Task ID for abort task
197 static GNUNET_SCHEDULER_TaskIdentifier abort_task;
200 * Task ID for write task
202 static GNUNET_SCHEDULER_TaskIdentifier write_task;
205 * Task ID for read task
207 static GNUNET_SCHEDULER_TaskIdentifier read_task;
210 * Absolute time when profiling starts
212 static struct GNUNET_TIME_Absolute prof_start_time;
215 * Test time taken for sending the data
217 static struct GNUNET_TIME_Relative prof_time;
220 * Random data block. Should generate data first
222 static uint32_t data[DATA_SIZE / 4];
225 * Payload sizes to test each major test with
227 static uint16_t payload_size[] =
228 { 20, 500, 2000, 7000, 13000, 25000, 50000, 60000, 63000, 64000 };
231 * Current step of testing
233 static enum TestStep test_step;
236 * Index for choosing payload size
238 static unsigned int payload_size_index;
241 * Number of peers we want to create while using the testbed service
243 static int num_peers;
246 * Testing result of a major test
248 static enum TestStage result;
251 * Create a meter to keep track of the progress of some task.
253 * @param total the total number of items to complete
254 * @param start_string a string to prefix the meter with (if printing)
255 * @param print GNUNET_YES to print the meter, GNUNET_NO to count
258 * @return the progress meter
260 static struct ProgressMeter *
261 create_meter (unsigned int total, char *start_string, int print)
263 struct ProgressMeter *ret;
265 ret = GNUNET_malloc (sizeof (struct ProgressMeter));
268 ret->modnum = total / 4;
269 if (ret->modnum == 0) /* Divide by zero check */
271 ret->dotnum = (total / 50) + 1;
272 if (start_string != NULL)
273 ret->startup_string = GNUNET_strdup (start_string);
275 ret->startup_string = GNUNET_strdup ("");
282 * Update progress meter (increment by one).
284 * @param meter the meter to update and print info for
286 * @return GNUNET_YES if called the total requested,
287 * GNUNET_NO if more items expected
290 update_meter (struct ProgressMeter *meter)
292 if (meter->print == GNUNET_YES)
294 if (meter->completed % meter->modnum == 0)
296 if (meter->completed == 0)
298 FPRINTF (stdout, "%sProgress: [0%%", meter->startup_string);
301 FPRINTF (stdout, "%d%%",
302 (int) (((float) meter->completed / meter->total) * 100));
304 else if (meter->completed % meter->dotnum == 0)
305 FPRINTF (stdout, "%s", ".");
307 if (meter->completed + 1 == meter->total)
308 FPRINTF (stdout, "%d%%]\n", 100);
313 if (meter->completed == meter->total)
315 if (meter->completed > meter->total)
316 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Progress meter overflow!!\n");
322 * Reset progress meter.
324 * @param meter the meter to reset
326 * @return GNUNET_YES if meter reset,
327 * GNUNET_SYSERR on error
330 reset_meter (struct ProgressMeter *meter)
333 return GNUNET_SYSERR;
335 meter->completed = 0;
341 * Release resources for meter
343 * @param meter the meter to free
346 free_meter (struct ProgressMeter *meter)
348 GNUNET_free_non_null (meter->startup_string);
357 do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
361 case TEST_STEP_1_HOP:
362 if (NULL != peer_data[0].socket)
363 GNUNET_STREAM_close (peer_data[0].socket);
364 if (NULL != peer_data[1].socket)
365 GNUNET_STREAM_close (peer_data[1].socket);
366 if (NULL != peer2_listen_socket)
367 GNUNET_STREAM_listen_close (peer2_listen_socket); /* Close listen socket */
369 case TEST_STEP_2_HOP:
370 if (NULL != peer_data[1].socket)
371 GNUNET_STREAM_close (peer_data[1].socket);
372 if (NULL != peer_data[0].op)
373 GNUNET_TESTBED_operation_done (peer_data[0].op);
374 if (NULL != peer_data[1].op)
375 GNUNET_TESTBED_operation_done (peer_data[1].op);
377 case TEST_STEP_3_HOP:
380 if (GNUNET_SCHEDULER_NO_TASK != abort_task)
381 GNUNET_SCHEDULER_cancel (abort_task);
382 if (GNUNET_SCHEDULER_NO_TASK != write_task)
383 GNUNET_SCHEDULER_cancel (write_task);
384 GNUNET_SCHEDULER_shutdown (); /* Shutdown this testcase */
394 * Something went wrong and timed out. Kill everything and set error flag
397 do_abort (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
399 abort_task = GNUNET_SCHEDULER_NO_TASK;
400 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: ABORT\n");
401 if (GNUNET_SCHEDULER_NO_TASK != read_task)
402 GNUNET_SCHEDULER_cancel (read_task);
403 result = GNUNET_SYSERR;
404 do_shutdown (cls, tc);
409 * Scheduler call back; to be executed when a new stream is connected
410 * Called from listen connect for peer2
413 stream_read_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
417 * Task for calling STREAM_write with a chunk of random data
419 * @param cls the peer data entity
420 * @param tc the task context
423 stream_write_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
427 * The write completion function; called upon writing some data to stream or
430 * @param cls the closure from GNUNET_STREAM_write/read
431 * @param status the status of the stream at the time this function is called
432 * @param size the number of bytes read or written
435 write_completion (void *cls, enum GNUNET_STREAM_Status status, size_t size)
437 struct PeerData *pdata = cls;
439 double prof_time_sec;
441 GNUNET_assert (GNUNET_STREAM_OK == status);
442 GNUNET_assert (size <= DATA_SIZE);
443 pdata->bytes_wrote += size;
444 for (;size > 0; size--)
445 update_meter (meter);
446 if (pdata->bytes_wrote < DATA_SIZE) /* Have more data to send */
448 pdata->io_write_handle =
449 GNUNET_STREAM_write (pdata->socket,
450 ((void *) data) + pdata->bytes_wrote,
451 sizeof (data) - pdata->bytes_wrote,
452 GNUNET_TIME_UNIT_FOREVER_REL, &write_completion,
454 GNUNET_assert (NULL != pdata->io_write_handle);
460 prof_time = GNUNET_TIME_absolute_get_duration (prof_start_time);
461 prof_time_sec = (((double) prof_time.rel_value)/ ((double) 1000));
462 throughput = (((float) sizeof (data)) / prof_time_sec);
463 PRINTF ("Throughput %.2f kB/sec\n", throughput / 1000.00);
468 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == read_task);
469 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == write_task);
470 pdata->bytes_read = 0;
471 meter = create_meter (sizeof (data), "Testing Downlink\n", GNUNET_YES);
472 read_task = GNUNET_SCHEDULER_add_now (&stream_read_task, &peer_data[0]);
473 write_task = GNUNET_SCHEDULER_add_now (&stream_write_task, &peer_data[1]);
476 result = DOWNLINK_OK;
477 GNUNET_SCHEDULER_add_now (&do_shutdown, NULL);
487 * Task for calling STREAM_write with a chunk of random data
489 * @param cls the peer data entity
490 * @param tc the task context
493 stream_write_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
495 struct PeerData *pdata = cls;
497 if (GNUNET_SCHEDULER_NO_TASK != abort_task)
499 GNUNET_SCHEDULER_cancel (abort_task);
501 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply
502 (GNUNET_TIME_UNIT_SECONDS, 300), &do_abort,
505 write_task = GNUNET_SCHEDULER_NO_TASK;
506 prof_start_time = GNUNET_TIME_absolute_get ();
507 pdata->bytes_wrote = 0;
508 pdata->io_write_handle = GNUNET_STREAM_write (pdata->socket, data,
510 GNUNET_TIME_UNIT_FOREVER_REL,
511 &write_completion, pdata);
512 GNUNET_assert (NULL != pdata->io_write_handle);
517 * Scheduler call back; to be executed when a new stream is connected
518 * Called from listen connect for peer2
521 stream_read_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
528 * @param status the status of the stream at the time this function is called
529 * @param data traffic from the other side
530 * @param size the number of bytes available in data read
531 * @return number of bytes of processed from 'data' (any data remaining should be
532 * given to the next time the read processor is called).
535 input_processor (void *cls, enum GNUNET_STREAM_Status status,
536 const void *input_data, size_t size)
538 struct PeerData *pdata = cls;
540 GNUNET_assert (GNUNET_STREAM_OK == status);
541 GNUNET_assert (size < DATA_SIZE);
542 GNUNET_assert (0 == memcmp (((void *)data ) + pdata->bytes_read,
544 pdata->bytes_read += size;
545 if (pdata->bytes_read < DATA_SIZE)
547 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == read_task);
548 read_task = GNUNET_SCHEDULER_add_now (&stream_read_task, pdata);
552 LOG (GNUNET_ERROR_TYPE_DEBUG, "Reading finished successfully\n");
559 * Scheduler call back; to be executed when a new stream is connected
560 * Called from listen connect for peer2
563 stream_read_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
565 struct PeerData *pdata = cls;
567 read_task = GNUNET_SCHEDULER_NO_TASK;
568 pdata->io_read_handle =
569 GNUNET_STREAM_read (pdata->socket, GNUNET_TIME_UNIT_FOREVER_REL,
570 &input_processor, pdata);
571 GNUNET_assert (NULL != pdata->io_read_handle);
576 * Functions of this type are called upon new stream connection from other peers
578 * @param cls the closure from GNUNET_STREAM_listen
579 * @param socket the socket representing the stream
580 * @param initiator the identity of the peer who wants to establish a stream
582 * @return GNUNET_OK to keep the socket open, GNUNET_SYSERR to close the
583 * stream (the socket will be invalid after the call)
586 stream_listen_cb (void *cls, struct GNUNET_STREAM_Socket *socket,
587 const struct GNUNET_PeerIdentity *initiator)
589 struct PeerData *pdata = cls;
591 GNUNET_assert (NULL != socket);
592 GNUNET_assert (pdata == &peer_data[1]);
593 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Peer connected: %s\n",
594 GNUNET_i2s(initiator));
595 pdata->socket = socket;
596 pdata->bytes_read = 0;
597 read_task = GNUNET_SCHEDULER_add_now (&stream_read_task, pdata);
603 * Function executed after stream has been established
605 * @param cls the closure from GNUNET_STREAM_open
606 * @param socket socket to use to communicate with the other side (read/write)
609 stream_open_cb (void *cls,
610 struct GNUNET_STREAM_Socket *socket)
612 struct PeerData *pdata = cls;
614 GNUNET_assert (socket == pdata->socket);
615 meter = create_meter (sizeof (data), "Testing Uplink\n", GNUNET_YES);
616 write_task = GNUNET_SCHEDULER_add_now (&stream_write_task, pdata);
621 * Listen success callback; connects a peer to stream as client
624 stream_connect (void)
626 peer_data[0].socket =
627 GNUNET_STREAM_open (config, &peer_data[1].id, 10, &stream_open_cb,
629 GNUNET_STREAM_OPTION_MAX_PAYLOAD_SIZE,
630 payload_size[payload_size_index],
631 GNUNET_STREAM_OPTION_END);
632 GNUNET_assert (NULL != peer_data[0].socket);
637 * Initialize framework and start test
640 * @param cfg configuration of the peer that was started
641 * @param peer identity of the peer that was created
645 const struct GNUNET_CONFIGURATION_Handle *cfg,
646 struct GNUNET_TESTING_Peer *peer)
648 struct GNUNET_PeerIdentity id;
650 GNUNET_TESTING_peer_get_identity (peer, &id);
652 peer2_listen_socket =
653 GNUNET_STREAM_listen (config, 10, &stream_listen_cb, &peer_data[1],
654 GNUNET_STREAM_OPTION_SIGNAL_LISTEN_SUCCESS,
656 GNUNET_STREAM_OPTION_MAX_PAYLOAD_SIZE,
657 payload_size[payload_size_index],
658 GNUNET_STREAM_OPTION_END);
659 GNUNET_assert (NULL != peer2_listen_socket);
660 peer_data[0].id = id;
661 peer_data[1].id = id;
663 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply
664 (GNUNET_TIME_UNIT_SECONDS, 300), &do_abort,
670 * Adapter function called to establish a connection to
674 * @param cfg configuration of the peer to connect to; will be available until
675 * GNUNET_TESTBED_operation_done() is called on the operation returned
676 * from GNUNET_TESTBED_service_connect()
677 * @return service handle to return in 'op_result', NULL on error
680 stream_ca (void *cls, const struct GNUNET_CONFIGURATION_Handle *cfg);
684 * Adapter function called to destroy a connection to
688 * @param op_result service handle returned from the connect adapter
691 stream_da (void *cls, void *op_result)
693 if (&peer_data[1] == cls)
695 GNUNET_STREAM_listen_close (op_result);
698 else if (&peer_data[0] == cls)
700 GNUNET_STREAM_close (op_result);
708 * Listen success callback; connects a peer to stream as client. Called from
712 stream_connect2 (void)
714 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Stream listen open successful\n");
716 GNUNET_TESTBED_service_connect (&peer_data[0], peer_data[0].peer,
717 "stream", NULL, NULL, stream_ca,
718 stream_da, &peer_data[0]);
723 * Adapter function called to establish a connection to
727 * @param cfg configuration of the peer to connect to; will be available until
728 * GNUNET_TESTBED_operation_done() is called on the operation returned
729 * from GNUNET_TESTBED_service_connect()
730 * @return service handle to return in 'op_result', NULL on error
733 stream_ca (void *cls, const struct GNUNET_CONFIGURATION_Handle *cfg)
735 struct PeerData *pdata = cls;
737 if (&peer_data[1] == pdata)
739 peer2_listen_socket = NULL;
740 peer2_listen_socket =
741 GNUNET_STREAM_listen (cfg, 10, &stream_listen_cb, &peer_data[1],
742 GNUNET_STREAM_OPTION_SIGNAL_LISTEN_SUCCESS,
744 GNUNET_STREAM_OPTION_MAX_PAYLOAD_SIZE,
745 payload_size[payload_size_index],
746 GNUNET_STREAM_OPTION_END);
747 GNUNET_assert (NULL != peer2_listen_socket);
748 return peer2_listen_socket;
750 if (&peer_data[0] == pdata)
753 GNUNET_STREAM_open (cfg, &peer_data[1].id, 10, &stream_open_cb,
755 GNUNET_STREAM_OPTION_MAX_PAYLOAD_SIZE,
756 payload_size[payload_size_index],
757 GNUNET_STREAM_OPTION_END);
758 GNUNET_assert (NULL != pdata->socket);
759 return pdata->socket;
767 * Callback to be called when the requested peer information is available
769 * @param cb_cls the closure from GNUNET_TETSBED_peer_get_information()
770 * @param op the operation this callback corresponds to
771 * @param pinfo the result; will be NULL if the operation has failed
772 * @param emsg error message if the operation has failed; will be NULL if the
773 * operation is successfull
776 peerinfo_cb (void *cb_cls, struct GNUNET_TESTBED_Operation *op,
777 const struct GNUNET_TESTBED_PeerInformation *pinfo,
780 struct PeerData *pdata = cb_cls;
782 GNUNET_assert (NULL == emsg);
783 GNUNET_assert (common_op == op);
784 GNUNET_assert (NULL != pdata);
785 memcpy (&pdata->id, pinfo->result.id, sizeof (struct GNUNET_PeerIdentity));
786 GNUNET_TESTBED_operation_done (op);
787 if (pdata == &peer_data[0])
789 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Peer 1 id: %s\n",
790 GNUNET_i2s (&pdata->id));
791 common_op = GNUNET_TESTBED_peer_get_information (peer_data[1].peer,
792 GNUNET_TESTBED_PIT_IDENTITY,
793 &peerinfo_cb, &peer_data[1]);
795 else if (pdata == &peer_data[1])
797 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Peer 2 id: %s\n",
798 GNUNET_i2s (&pdata->id));
799 if (TEST_STEP_2_HOP == test_step)
801 GNUNET_TESTBED_service_connect (&peer_data[1], peer_data[1].peer,
802 "stream", NULL, NULL, stream_ca,
803 stream_da, &peer_data[1]);
805 GNUNET_break (0); /* FIXME: 3 hop test case here... */
811 * Controller event callback
814 * @param event the controller event
817 controller_event_cb (void *cls,
818 const struct GNUNET_TESTBED_EventInformation *event)
822 case GNUNET_TESTBED_ET_OPERATION_FINISHED:
823 if (NULL != event->details.operation_finished.emsg)
825 FPRINTF (stderr, "Error while expecting an operation to succeed:%s \n",
826 event->details.operation_finished.emsg);
830 case GNUNET_TESTBED_ET_CONNECT:
831 GNUNET_TESTBED_operation_done (common_op);
832 /* Get the peer identity and configuration of peers */
834 GNUNET_TESTBED_peer_get_information (peer_data[0].peer,
835 GNUNET_TESTBED_PIT_IDENTITY,
836 &peerinfo_cb, &peer_data[0]);
845 * Signature of a main function for a testcase.
848 * @param num_peers number of peers in 'peers'
849 * @param peers handle to peers run in the testbed
852 test_master (void *cls, unsigned int num_peers_,
853 struct GNUNET_TESTBED_Peer **peers)
855 GNUNET_assert (NULL != peers);
856 GNUNET_assert (NULL != peers[0]);
857 GNUNET_assert (NULL != peers[1]);
858 GNUNET_assert (num_peers_ == num_peers);
859 peer_data[0].peer = peers[0];
860 peer_data[1].peer = peers[1];
862 common_op = GNUNET_TESTBED_overlay_connect (NULL, NULL, NULL,
868 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply
869 (GNUNET_TIME_UNIT_SECONDS, 120), &do_abort,
877 int main (int argc, char **argv)
879 char *test_name = "perf_stream_api";
880 char *cfg_file = "test_stream_local.conf";
885 meter = create_meter ((sizeof (data) / 4), "Generating random data\n", GNUNET_YES);
886 for (count=0; count < (sizeof (data) / 4); count++)
888 data[count] = GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK,
890 update_meter (meter);
895 test_step = TEST_STEP_1_HOP;
896 for (payload_size_index = 0;
897 payload_size_index < (sizeof (payload_size) / sizeof (uint16_t));
898 payload_size_index++)
900 PRINTF ("\nTesting over loopback with payload size %hu\n",
901 payload_size[payload_size_index]);
902 (void) memset (peer_data, 0, sizeof (peer_data));
904 ret = GNUNET_TESTING_peer_run (test_name, cfg_file, &run, NULL);
905 if ((0 != ret) || (DOWNLINK_OK != result))
908 test_step = TEST_STEP_2_HOP;
911 event_mask |= (1LL << GNUNET_TESTBED_ET_CONNECT);
912 event_mask |= (1LL << GNUNET_TESTBED_ET_OPERATION_FINISHED);
913 for (payload_size_index = 0;
914 payload_size_index < (sizeof (payload_size) / sizeof (uint16_t));
915 payload_size_index++)
917 PRINTF ("\nTesting over 1 hop with payload size %hu\n",
918 payload_size[payload_size_index]);
919 (void) memset (peer_data, 0, sizeof (peer_data));
920 result = GNUNET_SYSERR;
921 GNUNET_TESTBED_test_run (test_name, cfg_file, num_peers, event_mask,
922 &controller_event_cb, NULL, &test_master, NULL);
923 if (DOWNLINK_OK != result)
926 test_step = TEST_STEP_3_HOP;
927 for (payload_size_index = 0;
928 payload_size_index < (sizeof (payload_size) / sizeof (uint16_t));
929 payload_size_index++)
931 /* Initialize testbed here */
936 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Test failed\n");
940 /* end of perf_stream_api.c */