Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp16427381rwd; Mon, 26 Jun 2023 09:49:57 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ66/bUpUphyr+K9JO6KaTcq/U7308Wv1DerhLMfiHZVTWY8+LJOQSK/tosWyahZvsG76lJL X-Received: by 2002:a05:6a20:8f0b:b0:107:1805:feea with SMTP id b11-20020a056a208f0b00b001071805feeamr40203566pzk.37.1687798196668; Mon, 26 Jun 2023 09:49:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687798196; cv=none; d=google.com; s=arc-20160816; b=BT2WTanT+3Bx7ByAipxDX/BpAoJrvk6pSGiUrvdz6phwxHspLmEGbdtQUPYOG9soF4 G81NDB2SUlalxql+JUr18gkPF1Yl3ioCgcbH5/U1AmSOQFY5XYVaYRUnLXFlkXJTkMn0 XQnCPnuPUbMKTdBdebYlFoerKThUK52iQVYnwSKsYEIcYwyvAtbUZh6SF8tr+/x79n6v Jr4QZ0LZ8TNTbAtrrEk9pUG1BNLOwLmY6Nu5Qhw7WriiER5i9QbqAPpjDgs618WuhZDe v+gn08JAdtfifFyyiojpckcQlq89mq15GJn+dwTeb+i1zSI0qTSeUySYLXbeH9UzzzG1 uJZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :dkim-filter; bh=icVczakG28FAD0REpW+p4noUrRkMyVkU1sHsJFRQldE=; fh=NxOLEjILkSa3IC2PasUMY/FjSDti5P59cd3mgoHwNcU=; b=fY6jJy3vYV8NoCYVelfEDpHT2edj8Tw19k/d3g3UljfVEDfRTc8yg0Xp6oFdGNVMCn 39GqkfL71pXeXxRw4iXQKKa6XO1NZse//QxHQ8FEx82vRL0anym3HdKxwh7NNwb/kQ+z a+Pyom242+UF0q6Dnmpsxym7Omuk8Yfg9tvOIYcCP3PIcr20MnK9yGAvWkWLAFMuabdY lcOsTCFPtcHEZhi890Xpt53pkQ6Y41632c4Dm0vhz/6P6cSjoUW59brEMz6GkA21s5tD nTppj5L4wtG7MI+oPQbQ5nDNZPrB3g314MArCEmxjrdCHMJ5sLU5qCLpdYv3n7ckPQXz Jh8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b="rAERRU2/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f6-20020a056a0022c600b0066975f3a955si5244359pfj.74.2023.06.26.09.49.44; Mon, 26 Jun 2023 09:49:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b="rAERRU2/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230082AbjFZQgc (ORCPT + 99 others); Mon, 26 Jun 2023 12:36:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35558 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229472AbjFZQgb (ORCPT ); Mon, 26 Jun 2023 12:36:31 -0400 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 16EF9C5; Mon, 26 Jun 2023 09:36:29 -0700 (PDT) Received: from W11-BEAU-MD.localdomain (unknown [76.135.27.212]) by linux.microsoft.com (Postfix) with ESMTPSA id 54DD421C4265; Mon, 26 Jun 2023 09:36:28 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 54DD421C4265 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1687797388; bh=icVczakG28FAD0REpW+p4noUrRkMyVkU1sHsJFRQldE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=rAERRU2/qbqd3eHtrtZJ0S0w6V90DN8uf/0mTpwZhAM1rc1vNjIuqOS3hVg8rKras wcDJ7QZaiDPtjfSROw9N6sFdwx/q9av2RtWPyboqReloy+5M6b+EMbOGUiFHMwJ63i qhIClxJFwEwlNwpI6ZVspi6OJO0SdCq/XIR7J7/s= Date: Mon, 26 Jun 2023 09:36:21 -0700 From: Beau Belgrave To: sunliming Cc: rostedt@goodmis.org, mhiramat@kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: Re: [PATCH v4 0/3] tracing/user_events: Fix incorrect return value for writes when events are disabled and add its tests Message-ID: <20230626163621.GA104@W11-BEAU-MD.localdomain> References: <20230626111344.19136-1-sunliming@kylinos.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230626111344.19136-1-sunliming@kylinos.cn> X-Spam-Status: No, score=-19.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL, USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 26, 2023 at 07:13:41PM +0800, sunliming wrote: > Now the writing operation return the count of writes regardless of whether > events are enabled or disabled. Fix this by just return -EBADF when events > are disabled. > > v3 -> v4: > - Change the return value from zero to -EBADF > Applied these locally, ran a few tests. This looks good to me. Acked-by: Beau Belgrave Thanks, -Beau > v2 -> v3: > - Change the return value from -ENOENT to zero > > v1 -> v2: > - Change the return value from -EFAULT to -ENOENT > > sunliming (3): > tracing/user_events: Fix incorrect return value for writing operation > when events are disabled > selftests/user_events: Enable the event before write_fault test in > ftrace self-test > selftests/user_events: Add test cases when event is disabled > > kernel/trace/trace_events_user.c | 3 ++- > tools/testing/selftests/user_events/ftrace_test.c | 8 ++++++++ > 2 files changed, 10 insertions(+), 1 deletion(-) > > -- > 2.25.1