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 A5BAAC19F29 for ; Sun, 31 Jul 2022 16:47:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233290AbiGaQrk (ORCPT ); Sun, 31 Jul 2022 12:47:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46346 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229558AbiGaQrj (ORCPT ); Sun, 31 Jul 2022 12:47:39 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B097DE011; Sun, 31 Jul 2022 09:47:38 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 4A57360F68; Sun, 31 Jul 2022 16:47:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C4F1AC433C1; Sun, 31 Jul 2022 16:47:36 +0000 (UTC) Date: Sun, 31 Jul 2022 12:47:30 -0400 From: Steven Rostedt To: Tao Zhou Cc: Daniel Bristot de Oliveira , Wim Van Sebroeck , Guenter Roeck , Jonathan Corbet , Ingo Molnar , Thomas Gleixner , Peter Zijlstra , Will Deacon , Catalin Marinas , Marco Elver , Dmitry Vyukov , "Paul E. McKenney" , Shuah Khan , Gabriele Paoloni , Juri Lelli , Clark Williams , Randy Dunlap , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-trace-devel@vger.kernel.org Subject: Re: [PATCH V9 01/16] rv: Add Runtime Verification (RV) interface Message-ID: <20220731124730.311c8207@rorschach.local.home> In-Reply-To: References: <0197dd47-ea15-4d8b-5fc7-e466d8a501a7@kernel.org> 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: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-doc@vger.kernel.org On Sun, 31 Jul 2022 23:06:31 +0800 Tao Zhou wrote: > > All things above are misled by the first interpretation but,,, > > Yeah, this is not that clear from my above words expression. I said the return > value of da_monitor_init_*() will be 0, but it is not right. Global and per-cpu > monitor will return 0, per-task monitor may return a positive value when the > slot is equal or greater than RV_PER_TASK_MONITOR_INIT(how possible this will > happen I do know yet). This is from reading the current code implementation. > I just want to say that there may be a bug here. Well, rv_get_monitor_slot() can currently only return 0 or negative. This is because PER_TASK_MONITORS is just 1 and we can not return that or greater. > If rv_enable_monitor() return a positive value and the error happened(as above With the current code this can not happen, as we only allow for a single PER_TASK_MONITORS. But in the future, if we increment this, then you are correct. We can not just check retval, but need to check retval < 0. This does need to be fixed. But because it currently isn't an issue because we they can only return 0 or negative, I'm going to pull this series in. But Daniel, these checks do need to be updated. Please send patches on top of this series to address it. -- Steve > said), user space will not know this is a error return value, but regard it as a > right writing. Even if the return value(the slot value not in [0..RV_PER_TASK_MONITOR_INIT)) > is equal to count of charaters that are writen to the file(the string length of monitor name), > it will still be not a right writing. >