Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp6787711pxb; Wed, 17 Feb 2021 13:30:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJzcDscxRTBxKUXKLk6wm5slp8wPOkYvLxZtWQu2PWP+79BPWP6ORFzMiY1FYJ2UfJUX5qGD X-Received: by 2002:a17:906:71c2:: with SMTP id i2mr924055ejk.460.1613597429793; Wed, 17 Feb 2021 13:30:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613597429; cv=none; d=google.com; s=arc-20160816; b=z2oRuVNc8+WztdeMg44CM35IK7KWwXC3Y/6VUmEkEObatqM8FeeWIl1mJ9lfRoJVip Te7tDm1keyyPRJUECmJS9F6nLel1Qd28IUOP2KxyJHAbAmdDxMxvPL+TQQR3eHdT7d9H jMM3iuh6mIoUgg9WV+2/5Az6G5ycxBKiPOJ1fO2EZxTjS4xL3PHQUQ1u82aUn6NlSjFX nbOkRWtkX0uA1JHTvv1BU2H0wYJT2ipdqNTmIeSt1pfkhMM1WiTwFYNzphk87weHrrrS CIb34BwgBu2JEs/V253sXpluVO6ZHu4cG4OTcLZPFCvLt6F2eopLNiqPiD60Q5IzlvMw GV2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=t38IBDiln8jFDPKpINqSVjOUz/xfYh58FCdxyOqAKEc=; b=uXznjG7izHlNh8ot9kpqRRj8a290r73cUvKlNyYYPwcYZCQqJzMI5PXwHVv1IlPKG4 2GjlT1FUGHr1cvsVQNzNrhKDg8oA3Vk/64KGuVkrEUtWnlPOu13qOjXHeHxkCqoMPy/K b1Im3u8WW3KbuRekwPJwURrhdvNcmv2ymfXrSQZJqla8IaOnkjt3SMEF5neKGXmuDstj rEfeFG3AJaWz7MK71x7inBFwwV8OD4tC9jXuJ8yyEbNysAa1PbowTUN6Oe0uIcslwClu iudIhF56x10cLG+INGo/R0sov/ivVcYaqOUEvnEeEimMz51AtAbwdn8qfybaeeLx89Qy Ng/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chrisdown.name header.s=google header.b=BCltraG2; 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=NONE sp=NONE dis=NONE) header.from=chrisdown.name Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b8si802270ejq.235.2021.02.17.13.29.54; Wed, 17 Feb 2021 13:30:29 -0800 (PST) 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=@chrisdown.name header.s=google header.b=BCltraG2; 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=NONE sp=NONE dis=NONE) header.from=chrisdown.name Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232970AbhBQVY6 (ORCPT + 99 others); Wed, 17 Feb 2021 16:24:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52840 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233160AbhBQVYk (ORCPT ); Wed, 17 Feb 2021 16:24:40 -0500 Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EF22CC061574 for ; Wed, 17 Feb 2021 13:23:57 -0800 (PST) Received: by mail-wm1-x32d.google.com with SMTP id a207so5270614wmd.1 for ; Wed, 17 Feb 2021 13:23:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chrisdown.name; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=t38IBDiln8jFDPKpINqSVjOUz/xfYh58FCdxyOqAKEc=; b=BCltraG2s2ema6giKHCDQko+FfZRmoVHUbGvqbG+JZXC9sM1J71Qz/xhJOm81KHt8F Itr1Tpk/9ZOUzPOUpMLPYL8OQwtPSbpPuaZsA7UOnkw75yD9qqsjtGq4eFahRSso146A +VE7h+wAtksBGgoSo9DXtsV/nZYreL52v+dsg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=t38IBDiln8jFDPKpINqSVjOUz/xfYh58FCdxyOqAKEc=; b=nyCQllVyiGnP83gPGPU3a8vw43Amtqymt3k/ni3I66OshmvC/2Pl3z6o5N+RBXpFZx sw73MqFc7+O29WWKsJUe40BcyXNuBsaICgV6Ysk9QBczafXKJhaXHNAl1zTY9cqJyuy0 NjhAQ5pEEK2eYvXqhttPfMgCO7oWP2INkSYWgoN+OW4lhgz7cLfyEkucWpdEGsmtuFLr mab2u0l75oUJOBXKvYRG1A55JQeUoGFCqxEs4KJduAFYG/4wHT3BaKym/k4otG6QjrzU ipescELcZ6ZIEx5u4xN707lMTGZ/BN+xNoXS7xsuT6couQVVfvRHf/WlbG4+5zlmjSpZ MxjQ== X-Gm-Message-State: AOAM531/FDqzHjQYjPgLQh9C/GztrY+aGWgvXU6UpjoPuG6G2ek9R+AW SvA60D4/xqn/Sf3IPm+35UgaJQ== X-Received: by 2002:a05:600c:2184:: with SMTP id e4mr643618wme.107.1613597036649; Wed, 17 Feb 2021 13:23:56 -0800 (PST) Received: from localhost ([2620:10d:c093:400::4:f7e9]) by smtp.gmail.com with ESMTPSA id f20sm5496817wrd.96.2021.02.17.13.23.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Feb 2021 13:23:56 -0800 (PST) Date: Wed, 17 Feb 2021 21:23:55 +0000 From: Chris Down To: Steven Rostedt Cc: Petr Mladek , linux-kernel@vger.kernel.org, Sergey Senozhatsky , John Ogness , Johannes Weiner , Andrew Morton , Greg Kroah-Hartman , Kees Cook , kernel-team@fb.com Subject: Re: output: was: Re: [PATCH v4] printk: Userspace format enumeration support Message-ID: References: <20210217141717.52089bbc@gandalf.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20210217141717.52089bbc@gandalf.local.home> User-Agent: Mutt/2.0.5 (da5e3282) (2021-01-21) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Steven Rostedt writes: >OK, now do the same in C. "%q" "and I guess that "f" in the print statement >in python (but I don't know for sure) does some magic with converting the >"\n" and such. > >I agree with Petr on this. Print the format itself, and not what is >converted. It's much easier to convert "\t" and such to what they mean, >than to go the other way around. To be clear, you're advocating for escaping tabs/newlines/etc on the kernel side, right? That seems to be implied by your first paragraph, but "print the format itself and not what is converted" sounds like the opposite of that to me. I assume your meaning is "escape the format, don't print it raw", which is what Petr was also advocating for? :-)