From b76961e3a21a820f15ebff9d115ff67feb910cec Mon Sep 17 00:00:00 2001 From: Mark Johnston Date: Tue, 10 Sep 2024 16:51:26 +0000 Subject: [PATCH] kdump: Print splice structures MFC after: 3 months Sponsored by: Klara, Inc. Sponsored by: Stormshield --- lib/libsysdecode/ktrace.out | Bin 0 -> 23596 bytes usr.bin/kdump/kdump.c | 16 ++++++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 lib/libsysdecode/ktrace.out diff --git a/lib/libsysdecode/ktrace.out b/lib/libsysdecode/ktrace.out new file mode 100644 index 0000000000000000000000000000000000000000..29d35f0de3ce35204a3022afb88fe0b21bbc239c GIT binary patch literal 23596 zcmd6v4RBP|6@YI7!2}EhC=$xVJW4SjBpZYT1_oUI3aJV~XoUg;o6TZYHp!ArhzwFT zDwYl^sgY79Qwbsil<741Q>+vPEkzpx2&J@A7$|f=Qw54?WhkZhzI)HIyE*&rc}p_o z4cYsCmhb%BbI(2R?(XZ%80+dxV2|x*Y)NH>%kAMO!nQT7&5OmMyJt(1Xm_to5DhaA zc$<>AiKX#2k-*s43uk2W{~x{?{2+nA+dT&7jb)uoTtia+p<#D1_I5YfUQ}%|zuJkw z&nv+BjzE#O%u(j1+P%3D=LkI$O-<#C!5fO*OJ-a1V%g1IL9+Xr3+FrRnVssxG4Yz+ zT5ipYW%k`fvj?oe`HreUh21V+5X4#W+TQ$(H7}O!-H5jDeG%uIw##n+1`&1jd<>M& zTjY7t<97Ipvpv4WIf3$=;hi}XvQL?tA4F}CeVXq22PyklG5ROtjInGJ`|r)0H$n7h zz5}DsiZ}P0IPX+Kmk1t9lVe=wB%Ucn+Ta@(8ImcE!?TH%+~JwA$`pMwM&P^~ibM6|)O>4>!m)Is zUZ0J}dE*jg|A+jxLHd)b=fR2AT+q`X>KS+l=OwBBe&W(@+25+e({p7!34LMKw2IFI zvv9t{Q_07^x2V+R&vBQREvDLkcn;13ePLWt`)TQXoR_8g33wlV@T;czgBklfw>w!? z3s!bFxo~cv(pAaw$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.bin/kdump/kdump.c index f7ac82c757fa..41d3eb594149 100644 --- a/usr.bin/kdump/kdump.c +++ b/usr.bin/kdump/kdump.c @@ -105,6 +105,7 @@ void ktruser(int, void *); void ktrcaprights(cap_rights_t *); void ktritimerval(struct itimerval *it); void ktrsockaddr(struct sockaddr *); +void ktrsplice(struct splice *); void ktrstat(struct stat *); void ktrstruct(char *, size_t); void ktrcapfail(struct ktr_cap_fail *); @@ -1923,6 +1924,14 @@ ktrsockaddr(struct sockaddr *sa) printf(" }\n"); } +void +ktrsplice(struct splice *sp) +{ + printf("struct splice { fd=%d, max=%#jx, idle=%jd.%06jd }\n", + sp->sp_fd, (uintmax_t)sp->sp_max, (intmax_t)sp->sp_idle.tv_sec, + (intmax_t)sp->sp_idle.tv_usec); +} + void ktrstat(struct stat *statp) { @@ -2111,6 +2120,13 @@ ktrstruct(char *buf, size_t buflen) memcpy(set, data, datalen); ktrbitset(name, set, datalen); free(set); + } else if (strcmp(name, "splice") == 0) { + struct splice sp; + + if (datalen != sizeof(sp)) + goto invalid; + memcpy(&sp, data, datalen); + ktrsplice(&sp); } else { #ifdef SYSDECODE_HAVE_LINUX if (ktrstruct_linux(name, data, datalen) == false)