Skip to content

Commit

Permalink
[uapp][msgpipe-perf] Use 'channel' instead of deprecated 'msgpipe'
Browse files Browse the repository at this point in the history
Renamed the uapp to channel-perf as well.

Change-Id: I2c230269eb07b0ff9f9f4975ba8527e40efa0d2a
  • Loading branch information
tkilbourn committed Oct 28, 2016
1 parent 30c1a44 commit beb83d0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ void do_test(uint32_t duration, const TestArgs& test_args) {

// We'll write to mp[0] (and read from mp[1]).
mx_handle_t mp[2] = {MX_HANDLE_INVALID, MX_HANDLE_INVALID};
status = mx_msgpipe_create(mp, 0u);
status = mx_channel_create(0u, &mp[0], &mp[1]);
assert(status == NO_ERROR);

// We'll send/receive duplicates of this handle.
Expand All @@ -62,8 +62,8 @@ void do_test(uint32_t duration, const TestArgs& test_args) {
// Pre-queue |test_args.queue| messages (there'll always be this many messages in the queue).
for (uint32_t i = 0; i < test_args.queue; i++) {
duplicate_handles(test_args.handles, event, handles.get());
status = mx_msgpipe_write(mp[0], data.get(), test_args.size, handles.get(),
test_args.handles, 0u);
status = mx_channel_write(mp[0], 0u, data.get(), test_args.size,
handles.get(), test_args.handles);
assert(status == NO_ERROR);
}

Expand All @@ -76,13 +76,14 @@ void do_test(uint32_t duration, const TestArgs& test_args) {
for (;;) {
big_its++;
for (uint32_t i = 0; i < big_it_size; i++) {
status = mx_msgpipe_write(mp[0], data.get(), test_args.size, handles.get(),
test_args.handles, 0u);
status = mx_channel_write(mp[0], 0, data.get(), test_args.size,
handles.get(), test_args.handles);
assert(status == NO_ERROR);

uint32_t r_size = test_args.size;
uint32_t r_handles = test_args.handles;
status = mx_msgpipe_read(mp[1], data.get(), &r_size, handles.get(), &r_handles, 0u);
status = mx_channel_read(mp[1], 0u, data.get(), r_size, &r_size,
handles.get(), r_handles, &r_handles);
assert(status == NO_ERROR);
assert(r_size == test_args.size);
assert(r_handles == test_args.handles);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ MODULE_TYPE := userapp
MODULE_SRCS += \
$(LOCAL_DIR)/main.cpp \

MODULE_NAME := msgpipe-perf

MODULE_LIBS := ulib/magenta ulib/mxio ulib/musl ulib/mxcpp ulib/mxtl

include make/module.mk

0 comments on commit beb83d0

Please sign in to comment.