Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753683AbdIRKJG (ORCPT ); Mon, 18 Sep 2017 06:09:06 -0400 Received: from mail-pg0-f65.google.com ([74.125.83.65]:36516 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752369AbdIRKIz (ORCPT ); Mon, 18 Sep 2017 06:08:55 -0400 X-Google-Smtp-Source: AOwi7QCE/ixi9NVnIR83ho3LDSOY3lUy4873s7+CCiRfUu9qG0Z5cifIlVml4ocR2qulR7cSp7IQPA== Date: Mon, 18 Sep 2017 19:08:49 +0900 From: Sergey Senozhatsky To: Joe Perches Cc: Sergey Senozhatsky , pierre kuo , Petr Mladek , Sergey Senozhatsky , rostedt@goodmis.org, linux-kernel@vger.kernel.org Subject: Re: [RFC V2] printk: add warning while drop partial text in msg Message-ID: <20170918100849.GC1514@jagdpanzerIV.localdomain> References: <1501421870-12042-1-git-send-email-vichy.kuo@gmail.com> <20170801024303.GA469@jagdpanzerIV.localdomain> <20170817010541.GA20907@jagdpanzerIV.localdomain> <20170918093905.GB1514@jagdpanzerIV.localdomain> <1505728803.12022.8.camel@perches.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1505728803.12022.8.camel@perches.com> User-Agent: Mutt/1.9.0 (2017-09-02) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2051 Lines: 43 On (09/18/17 03:00), Joe Perches wrote: [..] > > which is not a real world example, isn't it? > > > > printk_deferred("%s", local_string[2048]) makes no sense anyway, > > since we limit the message size to 1024 - HEADER chars in > > vprintk_emit() // see static char textbuf[LOG_LINE_MAX]. > > > > I'm not quite following what were you trying to prove, sorry. > > does any function in the upstream kernel printk()-s buffers > > larger than LOG_LINE_MAX? which one? > > > > > > - the longest line in my dmesg output is 260 bytes in total (including timestamp) > > try a kernel with a few modules loaded > > For instance: > > $ dmesg | awk '{ print length($0), $0 }'|sort -rn | head -1 > 827 [337318.968616] Modules linked in: snd_usb_audio snd_usbmidi_lib ccm rfcomm bnep snd_hda_codec_hdmi dell_led snd_hda_codec_realtek snd_hda_codec_generic hid_multitouch binfmt_misc nls_iso8859_1 arc4 i2c_designware_platform i2c_designware_core dell_wmi snd_soc_skl snd_soc_skl_ipc snd_soc_sst_ipc snd_soc_sst_dsp snd_hda_ext_core snd_soc_sst_match snd_soc_core snd_compress ac97_bus snd_pcm_dmaengine snd_hda_intel dell_laptop intel_rapl snd_hda_codec dell_smbios dcdbas x86_pkg_temp_thermal snd_hda_core intel_powerclamp snd_hwdep coretemp kvm_intel snd_pcm kvm irqbypass crct10dif_pclmul crc32_pclmul ghash_clmulni_intel iwlmvm pcbc mac80211 snd_seq_midi snd_seq_midi_event aesni_intel aes_x86_64 crypto_simd snd_rawmidi glue_helper cryptd intel_cstate intel_rapl_perf snd_seq iwlwifi snd_seq_device uvcvideo videobuf2_vmalloc linked modules are not printed as a single line - printk("module linked in ................................"). it's a bunch of pr_cont() calls: printk(KERN_DEFAULT "Modules linked in:"); list_for_each_entry_rcu(mod, &modules, list) { pr_cont(" %s%s", mod->name, module_flags(mod, buf)) } when pr_cont() buffer is getting full, we just flush it (log_store()) if (cont.len + len > sizeof(cont.buf)) cont_flush(); but the point is -- we don't truncate anything here, and don't lose the content. don't we? -ss