Mirror of strace – the linux syscall tracer
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

print_sg_req_info.c 995B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*
  2. * Decode struct sg_req_info.
  3. *
  4. * Copyright (c) 2017-2018 Dmitry V. Levin <ldv@altlinux.org>
  5. * All rights reserved.
  6. *
  7. * SPDX-License-Identifier: LGPL-2.1-or-later
  8. */
  9. #include "defs.h"
  10. #ifdef HAVE_SCSI_SG_H
  11. # include DEF_MPERS_TYPE(struct_sg_req_info)
  12. # include <scsi/sg.h>
  13. typedef struct sg_req_info struct_sg_req_info;
  14. #endif /* HAVE_SCSI_SG_H */
  15. #include MPERS_DEFS
  16. #ifdef HAVE_SCSI_SG_H
  17. MPERS_PRINTER_DECL(int, decode_sg_req_info,
  18. struct tcb *const tcp, const kernel_ulong_t arg)
  19. {
  20. struct_sg_req_info info;
  21. if (entering(tcp))
  22. return 0;
  23. tprints(", ");
  24. if (!umove_or_printaddr(tcp, arg, &info)) {
  25. tprintf("{req_state=%hhd"
  26. ", orphan=%hhd"
  27. ", sg_io_owned=%hhd"
  28. ", problem=%hhd"
  29. ", pack_id=%d"
  30. ", usr_ptr=",
  31. info.req_state,
  32. info.orphan,
  33. info.sg_io_owned,
  34. info.problem,
  35. info.pack_id);
  36. printaddr(ptr_to_kulong(info.usr_ptr));
  37. tprintf(", duration=%u}", info.duration);
  38. }
  39. return RVAL_IOCTL_DECODED;
  40. }
  41. #endif /* HAVE_SCSI_SG_H */