Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp6032892ybi; Tue, 4 Jun 2019 17:21:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqxS0sMkiqJ3s+Vgjz3NDODFB/5mpTmMReDxvPFbD5zxa0Er+EDPIMEbnzgd1UxGHNoyI86+ X-Received: by 2002:a17:90b:d83:: with SMTP id bg3mr26002606pjb.63.1559694069815; Tue, 04 Jun 2019 17:21:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559694069; cv=none; d=google.com; s=arc-20160816; b=r6mvdM8/LvMOEIuiX95wdZbFYgpJKG3zLZdX/B8gtYLqHOvXvxC7AgiIBE28tMx70r MmcohXVoPdUNUqaStRi4nxMPQgku1RRRaNK3DMgiSQeYRCwGRsBTsl8invkbzJIC2bmD YOVwhAJb7emJiVboK5BCKmWD6ujDeZ5AIXMHSG55aat/ol/fwNY82u0N+KRMpyVVDHCr YmorvkUf3EbFUdZibOGpiwbKwDFOkmTOZfeKlx/hNOe4aBFAR93A9u7Q3TvqCuIuD3ju UHfgJ0cTZ4BkeuBUZu8QVUNpgs6a3fFFjvhuAEINGNgrB9gJEnQ2OFr8TY6ZnXSE4gVG bz3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=wdmJ9l6dKN/M8KJKaReWlFRx3EElIyLoR59kmGQ0ajY=; b=i7MrPa31Nq2NhXnBnuJLf/vX1gQk8j21up4pf6+tpqbekKlerD/Vya8bEqkTY+ORv/ dV1j0wxlTjj0xW6VWxbm3K5nAU5j6FNjjVOOkMKFqzdAJIZSqrbIhoEcyLTMVelC6Qgc 2TmBe06hxXW1ZD724niIfO1K4HbrD6NYjTm4K04BSbaV7Z++duXnb6grLIpm8fxDW2Oq R5PgTr9MZTbKRaTcdMzFpU4ObO+P18212CRS1PYqtcCGwsXRpDmPoxGr5uf58lBh9CpW 1bkee+enPQ+beRplfxCkyegSekex6WeUMKaRGlu4jDjD8/xQJv1UJsl/f3i+2t09GEZB jIfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=mWp51IFY; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 36si28309317pla.80.2019.06.04.17.20.53; Tue, 04 Jun 2019 17:21:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=mWp51IFY; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726656AbfFEATn (ORCPT + 99 others); Tue, 4 Jun 2019 20:19:43 -0400 Received: from mail-lj1-f193.google.com ([209.85.208.193]:40109 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726566AbfFEATm (ORCPT ); Tue, 4 Jun 2019 20:19:42 -0400 Received: by mail-lj1-f193.google.com with SMTP id a21so6256194ljh.7 for ; Tue, 04 Jun 2019 17:19:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=wdmJ9l6dKN/M8KJKaReWlFRx3EElIyLoR59kmGQ0ajY=; b=mWp51IFY9ldz1n3pj1fKrjbn8ZSGPWgwyelkcW6/s7v+y0e0DR/V8GR1ZxM1BsBeAX mqVaa/tfXDd/6MEO1OGM22zX0t4jPSi2d71oCngZuhbWkZxio6+sFzeQvWqDrIYIpJuw nH2s7y3MrUSzM3dAVIORTn4j8f2hTE4FKXFXiB6vbyOyWM+8sm7qnuJAdZe0dYu2FmQB G/4Hd50+HcTF52V70z6ii5Z+BoWQp+0M49tLLSAs+EJ/ROKxeK9GHDSjTGCoNxZTB406 eMV8PQsiA3EH2MFRRpS50GYwQWxdJ7xN9x1Gd1qekPsZCFSmXsLb0mvz92xMWF6zHTLn it2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=wdmJ9l6dKN/M8KJKaReWlFRx3EElIyLoR59kmGQ0ajY=; b=hyg58QQGJB1xJVFpSEOj0igvJyy6RWpGDCeBFxmlLGQWJQh33ti3cS+y3gp9hDDqiI D1eIRYH8350b3FMemsa4S6X06wOONvk4ZjLCC+567LxOjmL9U3Jl+tuOTMwwbBYaF5v9 YiXQMFkGudgAIhLP/8UC6Ogg+9/RTcjed4wFApxjqSk+WOZbPqIOecuMKbYTkfISqFHj TcZXbUZspCvWw3yIh7BPLMCIG9ez8WDggxU37cnSz73ubYBMwK4NJPG+VI3dVn4YmCCR M2jzeZ8DHHkdpYLDBfVSGFwvVBT/mIYrKS5v2DK6zUqXN/JYbPryKY8Ev3ahzU/34uiK p5rw== X-Gm-Message-State: APjAAAVNLwOSACr6Mkv842JHEwlKg5oNQpTkzq8KldY7jTdpntfLEOms phpVPSQnD2BMUkdPoEnMU+OUe0EXUj/L6uGWODmbqg== X-Received: by 2002:a2e:9e8e:: with SMTP id f14mr3500ljk.120.1559693980056; Tue, 04 Jun 2019 17:19:40 -0700 (PDT) MIME-Version: 1.0 References: <20190514221711.248228-1-brendanhiggins@google.com> <20190514221711.248228-4-brendanhiggins@google.com> <20190517174300.7949F20848@mail.kernel.org> In-Reply-To: <20190517174300.7949F20848@mail.kernel.org> From: Brendan Higgins Date: Tue, 4 Jun 2019 17:19:28 -0700 Message-ID: Subject: Re: [PATCH v4 03/18] kunit: test: add string_stream a std::stream like string builder To: Stephen Boyd Cc: Frank Rowand , Greg KH , Josh Poimboeuf , Kees Cook , Kieran Bingham , Luis Chamberlain , Peter Zijlstra , Rob Herring , shuah , "Theodore Ts'o" , Masahiro Yamada , devicetree , dri-devel , kunit-dev@googlegroups.com, "open list:DOCUMENTATION" , linux-fsdevel@vger.kernel.org, linux-kbuild , Linux Kernel Mailing List , "open list:KERNEL SELFTEST FRAMEWORK" , linux-nvdimm , linux-um@lists.infradead.org, Sasha Levin , "Bird, Timothy" , Amir Goldstein , Dan Carpenter , Daniel Vetter , Jeff Dike , Joel Stanley , Julia Lawall , Kevin Hilman , Knut Omang , Logan Gunthorpe , Michael Ellerman , Petr Mladek , Randy Dunlap , Richard Weinberger , David Rientjes , Steven Rostedt , wfg@linux.intel.com Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 17, 2019 at 10:43 AM Stephen Boyd wrote: > > Quoting Brendan Higgins (2019-05-14 15:16:56) > > A number of test features need to do pretty complicated string printing > > where it may not be possible to rely on a single preallocated string > > with parameters. > > > > So provide a library for constructing the string as you go similar to > > C++'s std::string. > > > > Signed-off-by: Brendan Higgins > > Reviewed-by: Greg Kroah-Hartman > > Reviewed-by: Logan Gunthorpe > > Is there any reason why we can't use the seqfile API for this? These > both share a similar goal, formatting strings into a buffer to be read > later. Maybe some new APIs would be needed to extract the buffer > differently, but I hope we could share the code. I can see why you are asking. It seems as though they are trying to do *similar* things, and it seems possible that we might be able to extract some common functionality out of seq_file that could replace this; however, it looks like it would be require a significant refactoring of seq_file to separate out the file system specific bits from the more general stringbuilder functionality. In my opinion, a refactoring like this makes no sense in this patchset; it probably belongs in its own patchset (preferably as a follow on). I also am not sure if the FS people would appreciate indirection that serves them no benefit, but I can ask if you like. > If it can't be used, can you please add the reasoning to the commit text > here? Will do. Thanks!