From mboxrd@z Thu Jan 1 00:00:00 1970 From: Brendan Higgins Subject: Re: [PATCH v2 04/17] kunit: test: add kunit_stream a std::stream like logger Date: Thu, 2 May 2019 22:48:16 -0700 Message-ID: References: <20190501230126.229218-1-brendanhiggins@google.com> <20190501230126.229218-5-brendanhiggins@google.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Return-path: In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org 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 List-Id: linux-nvdimm@lists.01.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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_PASS,T_DKIMWL_WL_MED,USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id ADC83C43219 for ; Fri, 3 May 2019 05:48:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 778652075E for ; Fri, 3 May 2019 05:48:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="gVy2A/3x" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726428AbfECFs3 (ORCPT ); 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-Google-Smtp-Source: APXvYqwsEAlSz/eNFlgajgo4Kt8DHISJN+MfNVQqCm9syohvOOWU5/fOAXzlAO0OoVTlNR0j/l6/cH2CfoUTavBQdJA= 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 From mboxrd@z Thu Jan 1 00:00:00 1970 From: brendanhiggins at google.com (Brendan Higgins) Date: Thu, 2 May 2019 22:48:16 -0700 Subject: [PATCH v2 04/17] kunit: test: add kunit_stream a std::stream like logger In-Reply-To: References: <20190501230126.229218-1-brendanhiggins@google.com> <20190501230126.229218-5-brendanhiggins@google.com> Message-ID: 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 From mboxrd@z Thu Jan 1 00:00:00 1970 From: brendanhiggins@google.com (Brendan Higgins) Date: Thu, 2 May 2019 22:48:16 -0700 Subject: [PATCH v2 04/17] kunit: test: add kunit_stream a std::stream like logger In-Reply-To: References: <20190501230126.229218-1-brendanhiggins@google.com> <20190501230126.229218-5-brendanhiggins@google.com> Message-ID: Content-Type: text/plain; charset="UTF-8" Message-ID: <20190503054816.HnhxbtBl0VR3am07R78LPn4kGpLAGMGdF6j6ml61MVk@z> On Thu, May 2, 2019@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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ot1-x341.google.com ([2607:f8b0:4864:20::341]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hMR3e-0007kN-Ar for linux-um@lists.infradead.org; Fri, 03 May 2019 05:48:31 +0000 Received: by mail-ot1-x341.google.com with SMTP id s11so4330561otp.0 for ; Thu, 02 May 2019 22:48:29 -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 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-um" Errors-To: linux-um-bounces+geert=linux-m68k.org@lists.infradead.org To: shuah Cc: Petr Mladek , linux-doc@vger.kernel.org, Amir Goldstein , dri-devel , Sasha Levin , Michael Ellerman , linux-kselftest@vger.kernel.org, Frank Rowand , Rob Herring , linux-nvdimm , Kevin Hilman , Knut Omang , Kieran Bingham , wfg@linux.intel.com, Joel Stanley , David Rientjes , Jeff Dike , Dan Carpenter , devicetree , linux-kbuild@vger.kernel.org, "Bird, Timothy , linux-um@lists.infradead.org, Steven Rostedt" , Julia Lawall , Dan Williams , kunit-dev@googlegroups.com, Richard Weinberger , Stephen Boyd , Greg KH , Linux Kernel Mailing List , Luis Chamberlain , Daniel Vetter , Kees Cook , linux-fsdevel@vger.kernel.org, Logan Gunthorpe 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 _______________________________________________ linux-um mailing list linux-um@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-um