aio: make iocb array output more strucutred

* aio.c (print_iocb): Print curly brackets.
(print_iocbp): Do not print curly brackets.
* tests/aio.c: Update expected output.
This commit is contained in:
Eugene Syromyatnikov 2018-06-17 23:34:37 +02:00
parent b54134352a
commit bc8a91c115
2 changed files with 5 additions and 3 deletions

6
aio.c
View File

@ -125,6 +125,8 @@ print_iocb_header(struct tcb *tcp, const struct iocb *cb)
static void
print_iocb(struct tcb *tcp, const struct iocb *cb)
{
tprints("{");
enum iocb_sub sub = print_iocb_header(tcp, cb);
switch (sub) {
@ -156,6 +158,8 @@ print_iocb(struct tcb *tcp, const struct iocb *cb)
case SUB_NONE:
break;
}
tprints("}");
}
static bool
@ -170,10 +174,8 @@ print_iocbp(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data)
addr = *(kernel_ulong_t *) elem_buf;
}
tprints("{");
if (!umove_or_printaddr(tcp, addr, &cb))
print_iocb(tcp, &cb);
tprints("}");
return true;
}

View File

@ -335,7 +335,7 @@ main(void)
"}, {aio_key=%u, aio_lio_opcode=IOCB_CMD_PWRITEV"
", aio_reqprio=%hd, aio_fildes=%d, aio_buf=%#" PRI__x64
", aio_nbytes=%" PRI__u64 ", aio_offset=%" PRI__d64
"}, {NULL}, {%#lx}, ... /* %p */]) = %s\n",
"}, NULL, %#lx, ... /* %p */]) = %s\n",
*ctx, 1057L,
cbv2[0].aio_data, cbv2[0].aio_key,
cbv2[0].aio_lio_opcode, cbv2[0].aio_fildes,