Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp2118885lqb; Mon, 27 May 2024 08:25:10 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVXV0UV9MbPdrca35yn68lehDYX/O3KQqJH/0mxZ2pSG9pjGYYSLHCivcvc0/EnGm0XhRDXUwFfLgWv8+g/trwAHPbeXmsPcG1Re1mmxg== X-Google-Smtp-Source: AGHT+IHVJH1VnFMhNAEt6BGTZtxeKJC78wTEgzqJDLHV86ryGPhFRJ4rQka+TOt+TeXKB4PkOJ76 X-Received: by 2002:a05:6218:2615:b0:183:86c4:75d0 with SMTP id e5c5f4694b2df-197e50d264dmr611408655d.8.1716823509834; Mon, 27 May 2024 08:25:09 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716823509; cv=pass; d=google.com; s=arc-20160816; b=WPAzKQpRQOGOdGr8EZiWQThsXL+eQlJ1PIdFUz5rEHD0O+K8/YTS7KnVhVBFc2lDBj J2cK49iKEHkpPG6/EefyzC87sHOLeDEVcTB3jFL2QXSJIab+t4b4nqpOULRYr7Xod4mq 4kNLfwzdTnGYEsvzIBMCNtdnVe/8eT/CpNPLsL6WEpbNmCYATtARLbFGwDL2i7A0qXVG 2wg1SBwZInChPtE7IYTyEeqhhLdPq3A/A5Jjn90OZBqsXkc1Z5Ly1+jpa0oB8X862HE2 J/SWswg/zBaOwVNGnuAaKCtW4jqFePzrm38qesVYSo1RRdt9YoYKmqc+MNOL/f+Sgd08 Q2sA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=fovS7e3KM/LcT9QtzEodGZIjj0DUcgpQyzljDo7RuCQ=; fh=02bfzHpSrhTBuD5HjysvAMd1udWV3HY+42FEQdse+hc=; b=jgpGdXgRVqt58botG74sHq/8hJYeWNyEz8L7GOBdXcoF9MoDepcqQs0NnswuLXJRTo hvxYAb2VUXyiimrxbaCcOTvJcBCnNyqpeJytIK8cQS0nm5RNx0w/4Xszc9npCBCge57D DyfErBoQ35eUKKfJFK4vqTK3KR8bLutmX105sFRTNoC+wE9M7rpP46YZH/vz7f/kogwr 34celBoxhzdeUkhWUPawsV79PvFNEXjudeVg7tKwzq8Mry3PuVEatRXAObqvgoGhgqCR CqbmB2GvXzLBA2+SYQuU3I4rPJV0zNSLEYMrHhp6ZQ2xPez9zorjEAIYpaJQ5tZ2je08 P9gQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.com header.s=google header.b=OCyUgVho; arc=pass (i=1 spf=pass spfdomain=suse.com dkim=pass dkdomain=suse.com dmarc=pass fromdomain=suse.com); spf=pass (google.com: domain of linux-kernel+bounces-191019-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-191019-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 41be03b00d2f7-682278902bfsi6648491a12.384.2024.05.27.08.25.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 08:25:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-191019-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=google header.b=OCyUgVho; arc=pass (i=1 spf=pass spfdomain=suse.com dkim=pass dkdomain=suse.com dmarc=pass fromdomain=suse.com); spf=pass (google.com: domain of linux-kernel+bounces-191019-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-191019-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 770D328CA6E for ; Mon, 27 May 2024 15:14:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BCD7515FD0E; Mon, 27 May 2024 14:55:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="OCyUgVho" Received: from mail-ej1-f45.google.com (mail-ej1-f45.google.com [209.85.218.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C4A6B15FCF5 for ; Mon, 27 May 2024 14:54:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716821701; cv=none; b=QaF2UG59HYQcPWq8eV0PmdZpg0/z++b7ZxHgYjK+ukwZxAZDoeecY2SdmywB4RIezqyak5jQScLPrbcXmbk2P3ZpBwFrpGD2Elq1fIz3Lu+gB+dKliCDGi6HnuAiukBfga6mvwSGNG02lJxR0lhxCfq09mMmnWV0Hzm/If/+8fs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716821701; c=relaxed/simple; bh=rxNoykyrgmE+ykXiTgwE+amgfPWMp+eHsqYoLpCLE2U=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Pr30wktYCGmkXQmROAb6rkULv7ycCrywth1d9HX8R6t2/UJBoP8U/r8uiGxdTHQKCiv5EblCJBL5PsPSgTQIVLNJj19/LcHxAuhe/cQpc1x7CyNtqG5z9s7tTyAGbyhLPQUdpc79jH6mk8W2QRkQ8MbV3QB9IUaLCrJi21B1MkM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=OCyUgVho; arc=none smtp.client-ip=209.85.218.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Received: by mail-ej1-f45.google.com with SMTP id a640c23a62f3a-a6267639e86so384098866b.2 for ; Mon, 27 May 2024 07:54:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1716821698; x=1717426498; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=fovS7e3KM/LcT9QtzEodGZIjj0DUcgpQyzljDo7RuCQ=; b=OCyUgVho1XA6FAXmFcs+wNtRcOLtVUWucKghPk15LR2p4EYdFsN6noulKndjQcROiV Msc27HA++C6pCDVCroszTI/XZ1pZoPjgapgCcpcVCAFRiYrinsDCrEoqdBZQJ8rLF8RQ LeOT7PmW2m1QD48nS3lvScyTEj1RKQCu2SdqEFKgbBoHBxX41KfTgevyJ7RQxE91GYyV uLRpaq1y06iTXhl/cUlgW9JcXVd4SDBBacqwM57VWpzGpIh6Lm0TziB8Adkzl0QWHGkF ypPijbd/yNKoaHRFBTCjiWWRKEWDRug8RUU9GDYU1Nw94xLqp/KC3AFUPqAkv52Mfzhm DrfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716821698; x=1717426498; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=fovS7e3KM/LcT9QtzEodGZIjj0DUcgpQyzljDo7RuCQ=; b=mnlbiFJgWOQZWFLLqB8UNgaQYAytp+rAGIvw9pe7jlSMv45aKh07rs4u6bpYyXIf3m gASUfNpDR2FMlVIlTO782+NLE+NZP34D3Q+U4h+dA92jPLb4K6cOrWZ4fZi5loRSAsys c9Nv7d6afzoU+SaKLBJIWzHp/ZAm5doZ89vxvLteEGq8J0NbYsSRwfoRTDRoDoCz4h8v ex17ZlYEYCdBxF0zMQx7lh+B2FnsNN9r0UF4TebqHKg3VQNigMGcSZhMgRnaRYqTcjko isFA/x2tqXvLPvUlPWLS4W8hMxAa1/r34r33PQ4Nvae7jkroD1kg9JIWkm1HlUrXVSlY Wj6Q== X-Forwarded-Encrypted: i=1; AJvYcCW2AeKhEcR0Z9wXzS52iJkrbRbJQOPKDnThN/jvl5jEaDW1mcLvZlllybEhW+e3YT7is9iO8Y74qkAOrTTJFjKdwQs9DWHtmvtpMuir X-Gm-Message-State: AOJu0YwVJ6eqAUJ5NqRLxgmkeiIE/DeHlNfs/vtwfEbgTRSOv27LnMHK Q4wSapMTE6HvezqWBQeSTMfVig7nIHPhEJlDdBT+2HxB+iVqtyHQu0G7m3/3cSk= X-Received: by 2002:a17:906:7c98:b0:a59:beb2:62cc with SMTP id a640c23a62f3a-a62651469a3mr631672666b.61.1716821698131; Mon, 27 May 2024 07:54:58 -0700 (PDT) Received: from pathway.suse.cz ([176.114.240.50]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a626c934fd8sm496587566b.47.2024.05.27.07.54.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 07:54:57 -0700 (PDT) Date: Mon, 27 May 2024 16:54:56 +0200 From: Petr Mladek To: Xiang Gao Cc: rostedt@goodmis.org, john.ogness@linutronix.de, senozhatsky@chromium.org, linux-kernel@vger.kernel.org, fengqi@xiaomi.com, xiaoa Subject: Re: [PATCH] printk: Increase PRINTK_PREFIX_MAX and the buf size in print_caller. Message-ID: References: <20240527091929.316471-1-gxxa03070307@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240527091929.316471-1-gxxa03070307@gmail.com> On Mon 2024-05-27 17:19:29, Xiang Gao wrote: > Sometimes we need to add our own hooks to carry more caller information > to improve debug efficiency, but currently the buf in print caller is > too small. > --- a/kernel/printk/internal.h > +++ b/kernel/printk/internal.h > @@ -23,7 +23,7 @@ int devkmsg_sysctl_set_loglvl(struct ctl_table *table, int write, > #ifdef CONFIG_PRINTK > > #ifdef CONFIG_PRINTK_CALLER > -#define PRINTK_PREFIX_MAX 48 > +#define PRINTK_PREFIX_MAX 64 > #else > #define PRINTK_PREFIX_MAX 32 > #endif > diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c > index 420fd310129d..2d7f003113f7 100644 > --- a/kernel/printk/printk.c > +++ b/kernel/printk/printk.c > @@ -1331,7 +1331,7 @@ static size_t print_time(u64 ts, char *buf) > #ifdef CONFIG_PRINTK_CALLER > static size_t print_caller(u32 id, char *buf) > { > - char caller[12]; > + char caller[32]; Could you provide more details, please? How exactly do you add your own hooks? If you need to modify the code to add the extra info, you could also modify the buffer size. The buffer is big enough for the info printed by the upstream code. I do understand why we should do this change upstream. > snprintf(caller, sizeof(caller), "%c%u", > id & 0x80000000 ? 'C' : 'T', id & ~0x80000000); Best Regards, Petr