From owner-svn-src-all@freebsd.org Mon Oct 8 17:18:56 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 99A6610C55D1; Mon, 8 Oct 2018 17:18:56 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4F6E37305F; Mon, 8 Oct 2018 17:18:56 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4A44C25820; Mon, 8 Oct 2018 17:18:56 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w98HIu3h059047; Mon, 8 Oct 2018 17:18:56 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w98HIu7e059046; Mon, 8 Oct 2018 17:18:56 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201810081718.w98HIu7e059046@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 8 Oct 2018 17:18:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r339238 - stable/11/usr.bin/kdump X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: stable/11/usr.bin/kdump X-SVN-Commit-Revision: 339238 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Oct 2018 17:18:56 -0000 Author: jhb Date: Mon Oct 8 17:18:55 2018 New Revision: 339238 URL: https://svnweb.freebsd.org/changeset/base/339238 Log: MFC 337400: Remove spurious ABI tags from kdump output. The abidump routine output an ABI tag when -A was specified for records that were not displayed due to type or pid filtering. To fix, split the code to lookup the ABI from the code to display the ABI, move the code to display the ABI into dumpheader(), and move dumpheader() later in the main loop as a simplification. Previously dumpheader() was called under a condition that repeated conditions made later in the main loop. Modified: stable/11/usr.bin/kdump/kdump.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/kdump/kdump.c ============================================================================== --- stable/11/usr.bin/kdump/kdump.c Mon Oct 8 15:19:03 2018 (r339237) +++ stable/11/usr.bin/kdump/kdump.c Mon Oct 8 17:18:55 2018 (r339238) @@ -91,10 +91,10 @@ __FBSDID("$FreeBSD$"); #include #endif -u_int abidump(struct ktr_header *); int fetchprocinfo(struct ktr_header *, u_int *); +u_int findabi(struct ktr_header *); int fread_tail(void *, int, int); -void dumpheader(struct ktr_header *); +void dumpheader(struct ktr_header *, u_int); void ktrsyscall(struct ktr_syscall *, u_int); void ktrsysret(struct ktr_sysret *, u_int); void ktrnamei(char *, int); @@ -491,10 +491,6 @@ main(int argc, char *argv[]) drop_logged = 1; } } - if (trpoints & (1< size) { @@ -507,12 +503,13 @@ main(int argc, char *argv[]) errx(1, "data too short"); if (fetchprocinfo(&ktr_header, (u_int *)m) != 0) continue; - sv_flags = abidump(&ktr_header); if (pid && ktr_header.ktr_pid != pid && ktr_header.ktr_tid != pid) continue; if ((trpoints & (1<pid == kth->ktr_pid) { - flags = pi->sv_flags; - break; + return (pi->sv_flags); } } - - if (abiflag == 0) - return (flags); - - switch (flags & SV_ABI_MASK) { - case SV_ABI_LINUX: - abi = "L"; - break; - case SV_ABI_FREEBSD: - abi = "F"; - break; - case SV_ABI_CLOUDABI: - abi = "C"; - break; - default: - abi = "U"; - break; - } - - if (flags & SV_LP64) - arch = "64"; - else if (flags & SV_ILP32) - arch = "32"; - else - arch = "00"; - - printf("%s%s ", abi, arch); - - return (flags); + return (0); } void -dumpheader(struct ktr_header *kth) +dumpheader(struct ktr_header *kth, u_int sv_flags) { static char unknown[64]; static struct timeval prevtime, prevtime_e; struct timeval temp; + const char *abi; + const char *arch; const char *type; const char *sign; @@ -729,10 +696,6 @@ dumpheader(struct ktr_header *kth) case KTR_SYSCTL: type = "SCTL"; break; - case KTR_PROCCTOR: - /* FALLTHROUGH */ - case KTR_PROCDTOR: - return; case KTR_CAPFAIL: type = "CAP "; break; @@ -790,6 +753,31 @@ dumpheader(struct ktr_header *kth) } } printf("%s ", type); + if (abiflag != 0) { + switch (sv_flags & SV_ABI_MASK) { + case SV_ABI_LINUX: + abi = "L"; + break; + case SV_ABI_FREEBSD: + abi = "F"; + break; + case SV_ABI_CLOUDABI: + abi = "C"; + break; + default: + abi = "U"; + break; + } + + if ((sv_flags & SV_LP64) != 0) + arch = "64"; + else if ((sv_flags & SV_ILP32) != 0) + arch = "32"; + else + arch = "00"; + + printf("%s%s ", abi, arch); + } } #include