Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp3810476ybg; Fri, 25 Oct 2019 09:13:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqwJyyi764JzYNDBeGDiQyktj5hpR+vm0zhKhM9Ssot4V1tJmsqJbrqZ6IW6e3+aFWdgICk9 X-Received: by 2002:a50:f7cc:: with SMTP id i12mr4857821edn.81.1572020008048; Fri, 25 Oct 2019 09:13:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572020008; cv=none; d=google.com; s=arc-20160816; b=xqtj/imcF7eFtbUZ3ijHPxLlNX3oFLx7OVYue5/XnEZn8tPb9dWHd/B2nLIIun6AUF hzbTBLc42rFeXJkzRuhjWGXor4cvbTS4OVVVkwCbhG8M9nCpI+VkNjbwn1Rq48bZv+P1 FyIScB09icGkLet2K5v+RuqlhE2em00UWlofWZ03Y8bPs3vJNujFwFOM0nEBlUZOI/c5 Q2wwwSH/M9+4NBx+TL12jfk4QnoO2taDuTBySPiqze4Qv3WtmoLkpZ5AFdWHIwlcWkMG kNms2Idn7sZEPGtPxZJfQcnc1qaNaZHEBu7XYul0dKBhq2fh0gDy8Mnz9ZQdYKGgwDFw MV6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=PH0bJrrct13OtBTiOhljVf6qdjT6mdvYcPf9jH5za6c=; b=lIzAtW+kZIT/Q0DH4DJyW1yV9qIpFdU1Lv5ATvpPXZidCn8PdeZcHlCpyOVoDLHiNk fdUrBZcKHLcQOyf93fxC+HRWNXUQeiliW21k/AHrVs5tVRm4MC3UEa04YaCVrZc2CDEc raE4kZVeIPznUEoeP1Xz/BvoTLwyQUsDyt0b8ZGp2czpO4FXT29zYpYQAH1dUJKZGmaH +k8HFOmOpECT1akLpU45kpJ56G08h+KlmNduvAy5AXm+o54V+Dqq+H1HT2vAzKuXvWg2 culExsT5iITxHLK+kn/Zbsa14tDScSYDePqevpeLV+MsjHli5Arw/qvqR9g6wcJJ2/cI 9hng== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=2RLgaYAn; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t18si488250ejf.351.2019.10.25.09.13.04; Fri, 25 Oct 2019 09:13:28 -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=fail header.i=@infradead.org header.s=merlin.20170209 header.b=2RLgaYAn; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404883AbfJXOBy (ORCPT + 99 others); Thu, 24 Oct 2019 10:01:54 -0400 Received: from merlin.infradead.org ([205.233.59.134]:57888 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731381AbfJXOBy (ORCPT ); Thu, 24 Oct 2019 10:01:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=PH0bJrrct13OtBTiOhljVf6qdjT6mdvYcPf9jH5za6c=; b=2RLgaYAnVgKkblXMxNOUOTT9h Rf0uLT0nhkvEeARLz7h2ThZy4ujzXWuOBkzpxifosRltObEf80IMz5QgLfdeC0d6jNqDukg48j+if pHXxZG1qAnNWADM5BxidUvMc/IpsphlN+8wZa87kZvfRkuKO/9qMiLcTorpq3jIh7yeYmRk/Wfv/O cjKFvhyRl+byyl5Hyco98nsR/Cs7wTluom3VUW+8ygFQWrK4GBjwVS2YptzkPhPwaqqijnBYMtFIr V4oQHkSOTGhcXOmWnmNz5myXFQ1hww4jTEwYNhyst6XUQTbfT2VEsEjkBDs2fNfkJkR0y0+7DsMav yo2yGNM3Q==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1iNdgK-0000Aw-NU; Thu, 24 Oct 2019 14:01:40 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id CBD44306DEB; Thu, 24 Oct 2019 16:00:40 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 2FE462B1D7CA3; Thu, 24 Oct 2019 16:01:39 +0200 (CEST) Date: Thu, 24 Oct 2019 16:01:39 +0200 From: Peter Zijlstra To: Alexander Shishkin Cc: Arnaldo Carvalho de Melo , Ingo Molnar , linux-kernel@vger.kernel.org, jolsa@redhat.com, adrian.hunter@intel.com, mathieu.poirier@linaro.org, mark.rutland@arm.com Subject: Re: [PATCH v2 1/4] perf: Allow using AUX data in perf samples Message-ID: <20191024140139.GF4114@hirez.programming.kicks-ass.net> References: <20191022095812.67071-1-alexander.shishkin@linux.intel.com> <20191022095812.67071-2-alexander.shishkin@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191022095812.67071-2-alexander.shishkin@linux.intel.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 22, 2019 at 12:58:09PM +0300, Alexander Shishkin wrote: > @@ -11213,6 +11367,9 @@ SYSCALL_DEFINE5(perf_event_open, > if (event->attr.aux_output && !perf_get_aux_event(event, group_leader)) > goto err_locked; > > + if (event->attr.aux_sample_size && !perf_get_aux_event(event, group_leader)) > + goto err_locked; > + Either aux_sample_size and aux_output are mutually exclusive, or you're leaking a refcount on group_leader. The first wants a check, the second wants error path fixes. > /* > * Must be under the same ctx::mutex as perf_install_in_context(), > * because we need to serialize with concurrent event creation.