| 446 | } |
| 447 | |
| 448 | void |
| 449 | ktrsyscall(int code, int narg, register_t args[]) |
| 450 | { |
| 451 | struct ktr_request *req; |
| 452 | struct ktr_syscall *ktp; |
| 453 | size_t buflen; |
| 454 | char *buf = NULL; |
| 455 | |
| 456 | if (__predict_false(curthread->td_pflags & TDP_INKTRACE)) |
| 457 | return; |
| 458 | |
| 459 | buflen = sizeof(register_t) * narg; |
| 460 | if (buflen > 0) { |
| 461 | buf = malloc(buflen, M_KTRACE, M_WAITOK); |
| 462 | bcopy(args, buf, buflen); |
| 463 | } |
| 464 | req = ktr_getrequest(KTR_SYSCALL); |
| 465 | if (req == NULL) { |
| 466 | if (buf != NULL) |
| 467 | free(buf, M_KTRACE); |
| 468 | return; |
| 469 | } |
| 470 | ktp = &req->ktr_data.ktr_syscall; |
| 471 | ktp->ktr_code = code; |
| 472 | ktp->ktr_narg = narg; |
| 473 | if (buflen > 0) { |
| 474 | req->ktr_header.ktr_len = buflen; |
| 475 | req->ktr_buffer = buf; |
| 476 | } |
| 477 | ktr_submitrequest(curthread, req); |
| 478 | } |
| 479 | |
| 480 | void |
| 481 | ktrsysret(int code, int error, register_t retval) |
no test coverage detected