Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp172737yba; Thu, 2 May 2019 22:53:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqyp3BlbkyTxcrFcEdAGo2KsFZZPtpkEvHzkgtbVi9ZwWS41xQ89oTiuqiCrE1uoNEmMHbxC X-Received: by 2002:a05:6602:2082:: with SMTP id a2mr5532114ioa.154.1556862783520; Thu, 02 May 2019 22:53:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556862783; cv=none; d=google.com; s=arc-20160816; b=Y1bttOFJsbxupUVHMSzEmyrjow0wNIHgSW4xUcBKq8xAmJODftIkFpr8/O1tTGHySs 28qtwT73fCmW0xpfQWDMtjbhspqZ7LlsaMtTRyyyATlcvbas6Mw8mfGd6c7q4wEQlXx1 2uvo5UoQxzaUBVBjCN5MhZuQD5oDH7+8qXFvdgmkJJkH8+S/3wszEDJyTzXzL3EPr0MA rUB4TKDGgAXRajSZ4tw+F1BsXHW1X/46/fXAr2ZJX8KBv6B3jmN0Un3UFvz+3FTExHfg t02CWS7+bpmFPHeqr8S29/xujvluoPr0vtFJW0pF5a6R5vnygXoBoeeBoPj0kqtHGJxK KKpQ== 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=yJk8vxgxnyREeORp3ZGYiUe4W63+mvTYx011g+D2w9I=; b=rEf05qkLV0dAj8xEu5l2jS5RibLxqNxc2TGjJoCjKwvOuaiKHNhMPQpwPXEn2f0YHA zjBBOs3eLEJAmOzCgaBOJD0DUwdwTqUR39cbyl25ut2n48VARkPFmJeSrvIoxP4BiEyd 4kju2dEst4ZpOf3+5qz9QxtN0FQbjMBqNPhdH8JkTpBrG5VeI9fyNXz8+cwPyJh6Wm2I MJxN6wKHfEfvd5thNC2gwSNjy/d6MV9w0U8tURzjeHlvSybfSTjHlsJ/KqNsqJ8z8heI PmJd53/i2vn38n9QfT/TVvIKPy3ZjPVmq4lu8eKbi6OAHUCDbewKKv9cfH7JzSWacihg 16Rw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="gVy2A/3x"; 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 t9si796411iod.160.2019.05.02.22.52.49; Thu, 02 May 2019 22:53:03 -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="gVy2A/3x"; 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 S1726396AbfECFs3 (ORCPT + 99 others); Fri, 3 May 2019 01:48:29 -0400 Received: from mail-ot1-f65.google.com ([209.85.210.65]:34341 "EHLO mail-ot1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725794AbfECFs3 (ORCPT ); Fri, 3 May 2019 01:48:29 -0400 Received: by mail-ot1-f65.google.com with SMTP id n15so4325872ota.1 for ; Thu, 02 May 2019 22:48:28 -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=yJk8vxgxnyREeORp3ZGYiUe4W63+mvTYx011g+D2w9I=; b=gVy2A/3xGfxoPlL5Ko9/iS3jo2EDVupQVAr70qs6RZrFHNgUtzEok56tjyUqT06FB0 N61EUVCJQSGnIGYHynH3drr29YDViWxqPU9Sza34pLTsoxVh0uUM8E5CV1L0C/mIM9w0 WGa5tKq18lnS81IMo5BcR1Ykh3Nl7b9ExnnVx27s6jE5lyDFV5nm2p2xr1/VPFBW2Ah2 kgZSCZQGbf96we5F6/cwHf89KEU3jBrsGd1WH/gd1lUYccvZTH42q4V6uaQ3GXtHhroy 5qgEL+EjcYwXRo906ivSwsvihl3a7m9bzISXOlTNYJMfYhl7JWVTEbNxfJuRwSUQRKBU kRfw== 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=yJk8vxgxnyREeORp3ZGYiUe4W63+mvTYx011g+D2w9I=; b=hbBDK2aKyBEtXiWaAOFqLMPeNDpnwUubMugSr6Lsu89xelyB3niR94CekJKMJf/bxF YZAG5NKcQMIG9/HGKZkSjRtylQDlWm8x0hOThUY1MF8TpvpQq13SUh6ufd58gMIZUJdA pLR3XFMOcJJT2oI2aQijUNNLL3Z1w1k0fqa2KNwfgniAWwwy4cJxp6xcHbx62a75+Guy WkY+85HOzddFCPR9yU9VD3v6R2zvIGqdmOtgvMBeMHtl0bu0jtVz2f+xE6o/zMNkJjzt qzQvN1r8uYf+v/BVxKBcl8Cf2Tb4g4A0XrcDtZPvYrbPXhb7xUOEY5I3PBNR6+8dKYJD wwnA== X-Gm-Message-State: APjAAAVp5qvWZcZkuac6JHQX4mnmnoF0bkI9zw9ycVI45fUJsIoRpB9W p99V6VF6mlR6wqvVNSUnO5p9IcEyw9UDx5399GBDvg== X-Received: by 2002:a9d:3621:: with SMTP id w30mr5187084otb.98.1556862507760; Thu, 02 May 2019 22:48:27 -0700 (PDT) MIME-Version: 1.0 References: <20190501230126.229218-1-brendanhiggins@google.com> <20190501230126.229218-5-brendanhiggins@google.com> In-Reply-To: From: Brendan Higgins Date: Thu, 2 May 2019 22:48:16 -0700 Message-ID: Subject: Re: [PATCH v2 04/17] kunit: test: add kunit_stream a std::stream like logger To: shuah Cc: Frank Rowand , Greg KH , Kees Cook , Kieran Bingham , Luis Chamberlain , Rob Herring , Stephen Boyd , devicetree , dri-devel , kunit-dev@googlegroups.com, linux-doc@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kbuild@vger.kernel.org, Linux Kernel Mailing List , linux-kselftest@vger.kernel.org, linux-nvdimm , linux-um@lists.infradead.org, Sasha Levin , "Bird, Timothy" , Amir Goldstein , Dan Carpenter , Dan Williams , Daniel Vetter , Jeff Dike , Joel Stanley , Julia Lawall , Kevin Hilman , Knut Omang , Logan Gunthorpe , Michael Ellerman , Petr Mladek , 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 Thu, May 2, 2019 at 6:50 PM shuah wrote: > > On 5/1/19 5:01 PM, Brendan Higgins wrote: < snip > > > diff --git a/kunit/kunit-stream.c b/kunit/kunit-stream.c > > new file mode 100644 > > index 0000000000000..93c14eec03844 > > --- /dev/null > > +++ b/kunit/kunit-stream.c > > @@ -0,0 +1,149 @@ < snip > > > +static int kunit_stream_init(struct kunit_resource *res, void *context) > > +{ > > + struct kunit *test = context; > > + struct kunit_stream *stream; > > + > > + stream = kzalloc(sizeof(*stream), GFP_KERNEL); > > + if (!stream) > > + return -ENOMEM; > > + res->allocation = stream; > > + stream->test = test; > > + spin_lock_init(&stream->lock); > > + stream->internal_stream = new_string_stream(); > > + > > + if (!stream->internal_stream) > > + return -ENOMEM; > > What happens to stream? Don't you want to free that? Good catch. Will fix in next revision. < snip > Cheers