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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C88ACEB64DC for ; Mon, 26 Jun 2023 06:07:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229727AbjFZGHl convert rfc822-to-8bit (ORCPT ); Mon, 26 Jun 2023 02:07:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36946 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229556AbjFZGHi (ORCPT ); Mon, 26 Jun 2023 02:07:38 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C8EB8EE for ; Sun, 25 Jun 2023 23:07:37 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 5DAF660C89 for ; Mon, 26 Jun 2023 06:07:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2B683C433C8; Mon, 26 Jun 2023 06:07:34 +0000 (UTC) Date: Mon, 26 Jun 2023 02:07:31 -0400 From: Steven Rostedt To: Linus Torvalds Cc: LKML , Masami Hiramatsu , Mark Rutland , Beau Belgrave , Andrew Morton , sunliming Subject: Re: [GIT PULL] tracing: user_event fix for 6.4 Message-ID: <20230626020731.299d0b10@rorschach.local.home> In-Reply-To: References: <20230623152926.128aa568@gandalf.local.home> <20230623220959.6461cc02@rorschach.local.home> <20230624135056.263e0ba9@rorschach.local.home> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 25 Jun 2023 16:04:32 -0700 Linus Torvalds wrote: > The fact that your explanation is "we have that bug in other places" > does *not* make me any happier. Actually it's just the behavior inside the kernel. I just wrote a quick program to see the behavior of /sys/kernel/tracing/trace_marker, and yeah, it actually returns an error when writing if the ring buffer is disabled. I was trying to imitate the internal behavior in the kernel, but I shouldn't have, as we control all the instances of that. Now testing the other user space interface, it does behave the way you described (something I implemented years ago!). So I will drop this version of the patch. >From the code for trace_marker: if (unlikely(!event)) /* Ring buffer disabled, return as if not open for write */ return -EBADF; sunliming's original patch had it return an error. I'll have him redo that one, because the current behavior is still wrong as it returns as if it wrote something when it did not. https://lore.kernel.org/all/20230608011554.1181097-2-sunliming@kylinos.cn/ We were the ones to tell him not to return an error, so I take the blame on that. But if we are going to return an error, I rather follow what trace_marker does and return -EBADF and not -EFAULT. sunliming, Care to send a v3 that returns -EBADF instead? Thanks, -- Steve