Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp1587869pxb; Thu, 7 Oct 2021 10:42:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxupRS2M7QkbYA4t/5HGD3olRaBmB3tjfV1ZT3/HIvdMeyZkUB82tfFIvQmOc0dHjQ2DYpj X-Received: by 2002:a17:907:3e8e:: with SMTP id hs14mr7252427ejc.35.1633628574994; Thu, 07 Oct 2021 10:42:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633628574; cv=none; d=google.com; s=arc-20160816; b=jbcpeZuV7JE+Yd1uu1aDaj/vcznh0p5HVG4hjNPwF/9TmIjJYS0G0GQ2vakg/mtjAl VuJmHorvCrlA3Btj1ABu1SS8zdrc/lcg+rmPlveBGdWAYqgl01qEvH6c/qDbR3LjtyW5 X/lMeNcL955pX393RTrCrayhflzL+kfU5jmxDWpR0Sz2jAq4pSCqCzcOBM5tFZffXQS8 8kYst5BNqhMUh2cTVSQlRxhdF9b8kjh9yPIuJnPIw1ElwLSwcYNhMH3a62w3+nmdvJ4p Dh1l+Wh8MpFQEiC/j2A5QAUsKQnkCIAK9trxz02Cymq2APzaqUyt6Ls368UJq8cPgk2p irHA== 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:message-id:subject:cc:to:from:date; bh=nP9o3EVNuZnxMvoLpBNa5Ig0TO9sIh0R+Ce6Ylgbn0I=; b=FfljupRYEkWkSu3lKFdOMMI2whf2hwsAT49Ejj3KeWULFBx11kRccx+drLBIA5YfrI 1Evl7F+0qh+zB4WY8fLBUwzNsFJRBrLbvBD2If3f7mV3mZWMCUKS/NKWgSW8M8U0sN6l v1L9qH61ZVCIydYErg95FELCCyXsiAOHFYfMI6SH+ULcBp9F11iimwXn2BsmmZmpxurw qfaybj1craNqHzsU7m9idLUnhFBCBo74PLIztPrcEh1l16LzR6jk+zYTSvLhuc+HtUe2 f8XnuK2muRh1mmn7r96X9aA3SO08BTbrRd2ZMY0VRKJ9QyPCmz2uRpHXcqxJReeJXYMY DuoQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gn42si237828ejc.441.2021.10.07.10.42.30; Thu, 07 Oct 2021 10:42:54 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243322AbhJGRnD (ORCPT + 99 others); Thu, 7 Oct 2021 13:43:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:56680 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242002AbhJGRnB (ORCPT ); Thu, 7 Oct 2021 13:43:01 -0400 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 081526121F; Thu, 7 Oct 2021 17:41:05 +0000 (UTC) Date: Thu, 7 Oct 2021 13:41:03 -0400 From: Steven Rostedt To: Yafang Shao Cc: pmladek@suse.com, keescook@chromium.org, viro@zeniv.linux.org.uk, akpm@linux-foundation.org, peterz@infradead.org, valentin.schneider@arm.com, mathieu.desnoyers@efficios.com, qiang.zhang@windriver.com, robdclark@chromium.org, christian@brauner.io, dietmar.eggemann@arm.com, mingo@redhat.com, juri.lelli@redhat.com, vincent.guittot@linaro.org, bsegall@google.com, mgorman@suse.de, bristot@redhat.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 4/4] kernel/kthread: show a warning if kthread's comm is truncated Message-ID: <20211007134103.4da8a8ab@gandalf.local.home> In-Reply-To: <20211007120752.5195-5-laoar.shao@gmail.com> References: <20211007120752.5195-1-laoar.shao@gmail.com> <20211007120752.5195-5-laoar.shao@gmail.com> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 7 Oct 2021 12:07:52 +0000 Yafang Shao wrote: > - vsnprintf(name, sizeof(name), namefmt, args); > + len = vsnprintf(name, sizeof(name), namefmt, args); > + if (len >= TASK_COMM_LEN) { > + pr_warn("truncated kthread comm:%s, pid:%d by %d characters\n", > + name, task->pid, len - TASK_COMM_LEN + 1); Instead of saying how many characters it is truncated to, what about just showing what it was truncated to? pr_warn("truncated kthread comm from:%s to:%.*s for pid:%d\n", name, TASK_COMM_LEN - 1, name, task->pid); ? -- Steve > + }