From owner-freebsd-current@freebsd.org Fri Nov 29 21:09:54 2019 Return-Path: Delivered-To: freebsd-current@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 380581BBFD7 for ; Fri, 29 Nov 2019 21:09:54 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pg1-x541.google.com (mail-pg1-x541.google.com [IPv6:2607:f8b0:4864:20::541]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47PnFs2Wvyz4JfY for ; Fri, 29 Nov 2019 21:09:53 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pg1-x541.google.com with SMTP id i5so6711564pgj.9 for ; Fri, 29 Nov 2019 13:09:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=content-transfer-encoding:from:mime-version:subject:date:message-id :references:cc:in-reply-to:to; bh=4SJPx1OsDcAocEmbjiXcLXr6k1b2epD2De29sc4hVNw=; b=SjIsEtS574Q0rUhmrMkMYLHNQsiMtm+WwdAf4q3lSRmId6qH38DVB+iHOyuTIHbnRQ Fsw5t3mcSdpl5XqN+gclaa6anI77oRC/OoRxUNcVkmNyQBz4eRhx82ESxAZDoWU7tw7n FVgLcswC8oxnf16KFv9vhhcLz1Glrnvx5yviu3ipONDTbQI0uZ+uJyXRIJ7lB+Oh7kgO PCGpjedaAUixjsk2bf2rsKG+VTKqH4/LfxHKpke4r8KitWSo/UUmLZklG7lyU3tiAM/X nKATdoHSkc2aQ/6zcsbxlwST4QPZzB6rghctKlhsUShx0AELn16+thXPphKcjJncB3t1 ytGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:content-transfer-encoding:from:mime-version :subject:date:message-id:references:cc:in-reply-to:to; bh=4SJPx1OsDcAocEmbjiXcLXr6k1b2epD2De29sc4hVNw=; b=pJcQ7yEJam4XwZOt3S7JlhQ6S7YP1vcrMthwFlut/gsLRWZ/Pm8fCq/orT2Y/A/BR7 UzGTkp4486JQrFg6yQZPLkRoKxdE0qEWGNQTmTHdfp1OBbL5p+DY2TOM5a0HIvVJgbKW Wf7D7M0L7/m7W5hYu1pJqqNs8eukRcrl4JKerPYyP3SMcFRnRiMfEB6iDHZgOU8nVr9S M+Wade0uPfU/xXIPNoR89GppZFuaMr96DaTYqgoVIS+H1SOcTHqs9WyOJJuIb50bMQmi Zsxj6b53Fz/DJTWkXqd17pSOGUfRivnfXx2FWqJqeY67BbfRJOXTsLV3C75kZAQ3cQFD OaHQ== X-Gm-Message-State: APjAAAUV7w1AFlqFywcAcYT3D3NMcv7XJlX93Tq71MY90fPYD18uQD22 ajiUeLBEsjgdEUotBhW4A8vptSmH X-Google-Smtp-Source: APXvYqz7l58+8BlwOoqO0n/Qmri2gRQp0wKs7NkDq1q3am+rjcK0uSSw3MIy5gqGqpkURRpVf3wv0w== X-Received: by 2002:a62:8202:: with SMTP id w2mr13605503pfd.100.1575061790842; Fri, 29 Nov 2019 13:09:50 -0800 (PST) Received: from ?IPv6:2607:fb90:b211:2efc:51d8:e8c0:ed26:2642? ([2607:fb90:b211:2efc:51d8:e8c0:ed26:2642]) by smtp.gmail.com with ESMTPSA id v16sm16485697pje.1.2019.11.29.13.09.49 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 29 Nov 2019 13:09:50 -0800 (PST) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: Enji Cooper Mime-Version: 1.0 (1.0) Subject: Re: Best way to print something from the kernel at 1s intervals? Date: Fri, 29 Nov 2019 13:09:44 -0800 Message-Id: References: Cc: freebsd-current@freebsd.org In-Reply-To: To: Peter Eriksson X-Mailer: iPhone Mail (17A878) X-Rspamd-Queue-Id: 47PnFs2Wvyz4JfY X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=SjIsEtS5; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of yaneurabeya@gmail.com designates 2607:f8b0:4864:20::541 as permitted sender) smtp.mailfrom=yaneurabeya@gmail.com X-Spamd-Result: default: False [-1.50 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; FREEMAIL_FROM(0.00)[gmail.com]; MV_CASE(0.50)[]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[gmail.com:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; SUBJECT_ENDS_QUESTION(1.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-current@freebsd.org]; IP_SCORE_FREEMAIL(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[1.4.5.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; IP_SCORE(0.00)[ip: (-0.75), ipnet: 2607:f8b0::/32(-2.25), asn: 15169(-1.94), country: US(-0.05)]; RCVD_TLS_ALL(0.00)[] X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Nov 2019 21:09:54 -0000 > On Nov 28, 2019, at 12:52, Peter Eriksson wrote: >=20 > =EF=BB=BFI=E2=80=99ve been looking into the =E2=80=9Ckernel looks to be hu= ng at reboot=E2=80=9D problem at bit. Adding a lot of printf() calls to the r= elevant parts it looks like it actually isn=E2=80=99t hung but busy unmounti= ng filesystems (which we have thousands of), flushing disk caches, calling r= egistered callbacks and stuff and sometimes it takes a bit longer than usual= - probably due to ZFS having stuff queued up that needs to be written to di= sk before it finishes=E2=80=A6 >=20 > Anyway, I=E2=80=99d like to propose that we add some kind of counter/print= f() calls in that code area so we can see that things are indeed progressing= . However, I=E2=80=99d probably prefer not to print _every_ filesystem (or r= egistered callbacks - a lot of those...) - that generates a lot of output (t= ried that :-) but something like: >=20 > Unmounting filesystems: > 1234 done > (With the "1234 done=E2=80=9D updated something like once per second). >=20 > What=E2=80=99s the right/best way to do that from the kernel? In user spac= e I=E2=80=99d just call time(&t) at some convenient points and only print so= mething if =E2=80=9Ct=E2=80=9D has changed. :-) Can you use DTrace instead to get the information you need? Cheers, -Enji=