Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp2680859pxb; Tue, 13 Apr 2021 07:44:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxIdOX1H0H9Roj/6023FWbG6qeXLE4GbjUgZKGcZBuSWZ4tRs/UC1aMjisJuYgGu8N3tbob X-Received: by 2002:a65:48c5:: with SMTP id o5mr32486100pgs.101.1618325054146; Tue, 13 Apr 2021 07:44:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618325054; cv=none; d=google.com; s=arc-20160816; b=LLKfFmYZ6S/neVoicXcowj2XpLDj1G05w1e6pGz44EkwL+06mQ0sonSBiy8MUktRcr 58HfXaS4SYRkyEF7yaCrkQaU7dZcG7JgU54eDbnkE5oHqEIY3zPWk/DQlKm8PIwGO4uE hG9YeQrA1PtQQbz577Fw0y3nzJzkY7p/gSkqbONEvrBwOmKGZuuNhLZxnlhL02RVQbOh Xgq88PddEqAmJ8mzc8Kkux1P0eEIcu9FcJFvv4xFPt5tmCj/cCs3c8yVZFDRJYzA2fnb X+icibPdrSFq8ZBUUMZYnv9oUqfPlT76Z0UJGP2F/cz3BucJBZriu2k3/uKlJYF8M0OX nMMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id :dkim-signature; bh=lJ//KP9sjHEj2Dk8AN+EzHXTAVsKo0x5AfFapyn4/ko=; b=y9QAzgvUX3kRG89sb4Z2b8eVWj3GL70/1ZGq6OyY12+ioIbpklDowQrTp6d/t7o6JD QPCAGctfb0OVLiq4BtTMH6VFmkwEo/YDgKrgxo3xTmkT/vD8gIKcw5eg1dCFWUqkOvor 06mqyQ6dRMmopQ+IK7QK/yr/QpbJUQrmziMHR1nEoG3jpKNEFjGaR5I+UTcDpJ/vyGAI jMT6bW4Rj4VLspE4DRzejukWrZc/N0+6SNHsLeCixMPCgVdep/pxZyB2pUx/+HtTCgSF N/hSAKefW+KuH3q5Z/uzLRfW7c9pRhS/DGY8T9xzyiq2Rz4AXzlWUSoX50CVp52CkK16 wEzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@t-2.net header.s=smtp-out-2 header.b=SRF8yDMD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=REJECT dis=NONE) header.from=t-2.net Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q21si2334996pfk.214.2021.04.13.07.44.01; Tue, 13 Apr 2021 07:44:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@t-2.net header.s=smtp-out-2 header.b=SRF8yDMD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=REJECT dis=NONE) header.from=t-2.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244634AbhDMLLp (ORCPT + 99 others); Tue, 13 Apr 2021 07:11:45 -0400 Received: from smtp-good-out-4.t-2.net ([93.103.246.70]:41730 "EHLO smtp-good-out-4.t-2.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237094AbhDMLLn (ORCPT ); Tue, 13 Apr 2021 07:11:43 -0400 Received: from smtp-1.t-2.net (smtp-1.t-2.net [84.255.208.30]) by smtp-good-out-4.t-2.net (Postfix) with ESMTP id 4FKNG22kGVz24lX; Tue, 13 Apr 2021 13:11:22 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=t-2.net; s=smtp-out-2; t=1618312282; bh=X6WxLRtSRDcr+IOn7tANZ9XKF17UlUnxUdkTe92hqM4=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=SRF8yDMDIaY19ZzZ02DgtoVzqGcf6dbOKpV0+FGjPzJfb5m0YqdyU3GbLbkpHWe7R xfO0U891SR+HTGAQhP/4T6qoA54QfU/MhHZ6jjE3uK+GzGPaMqk9rsophVb9mrkObK WUw8wHDu6iYwAl5/zKnoDQnheRUXy9R/zuAT4PwU= Received: from localhost (localhost [127.0.0.1]) by smtp-1.t-2.net (Postfix) with ESMTP id 4FKNG22YWXzTcsPj; Tue, 13 Apr 2021 13:11:22 +0200 (CEST) X-Virus-Scanned: amavisd-new at t-2.net Received: from smtp-1.t-2.net ([127.0.0.1]) by localhost (smtp-1.t-2.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Z9peypk7IhMd; Tue, 13 Apr 2021 13:11:22 +0200 (CEST) Received: from hpg3.u2up.net (89-212-91-172.static.t-2.net [89.212.91.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp-1.t-2.net (Postfix) with ESMTPS; Tue, 13 Apr 2021 13:10:50 +0200 (CEST) Message-ID: <157d81a5eb9e56e47e40c1cd652cdc7a915cb755.camel@t-2.net> Subject: Re: How to handle concurrent access to /dev/ttyprintk ? From: Samo =?UTF-8?Q?Poga=C4=8Dnik?= To: Petr Mladek Cc: Tetsuo Handa , Jiri Slaby , Sergey Senozhatsky , Steven Rostedt , John Ogness , linux-kernel@vger.kernel.org, Greg Kroah-Hartman Date: Tue, 13 Apr 2021 13:10:50 +0200 In-Reply-To: References: <20210403041444.4081-1-penguin-kernel@I-love.SAKURA.ne.jp> <3c15d32f-c568-7f6f-fa7e-af4deb9b49f9@i-love.sakura.ne.jp> <051b550c-1cdd-6503-d2b7-0877bf0578fc@i-love.sakura.ne.jp> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.2 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Dne 13.04.2021 (tor) ob 11:41 +0200 je Petr Mladek napisal(a): > On Mon 2021-04-12 14:41:27, Samo Pogačnik wrote: > > Dne 12.04.2021 (pon) ob 19:39 +0900 je Tetsuo Handa napisal(a): > > > What is the intended usage of /dev/ttyprintk ? > > > > > > > The intended use of 'ttyprintk' is to redirect console to /dev/ttyprintk > > via the TIOCCONS ioctl. After successfull redirection, all console > > messages get "merged" with kernel messages and as such automatically > > processed > > (stored/transferred) by the syslog service for example. > > The same can be achieved by /dev/kmsg that was created by systemd > developers. > 'kmsg' and 'ttyprintk' are different types of drivers and as such rather complementary than exclusive. The 'ttyprintk' being a tty driver allows for a system wide automatic redirection of anything written to the console. On the other hand 'kmsg' is probably better suited for a per process output redirection/injection of its output into kernel messages. Maybe i am wrong, but 'systemd' could also find 'ttyprintk' usefull? best regards, Samo