Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3070507imw; Mon, 18 Jul 2022 01:15:03 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vVTU90IlRPG0Rx2iaVen8HkAoaWLJbkB2C/mrnaXGsBSOON6OWRk6Hd78GWYHNn5QPktb+ X-Received: by 2002:a17:907:9706:b0:72b:4b0d:86a2 with SMTP id jg6-20020a170907970600b0072b4b0d86a2mr23662700ejc.242.1658132103281; Mon, 18 Jul 2022 01:15:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658132103; cv=none; d=google.com; s=arc-20160816; b=sxmRwsoRTxwM9Vg8zcWsdTO/5e6LNZbJ4bwt6976txFRViEQgXVVKnhPnR4BjHWxMl OqbFF1LYBkrlgMYKxw6bJsMdi4qNVK3QVyo3EN9Svo6R7ZMwejys3NDWw0CtKa6WqVLi jDsNde1NELG67izWgChKRrOkDkU54+Civ0opoSN/Dd/PmQoPDIODYHlZ5Z2l4XIuMUY4 uOUVYK8fQJhpV+Fha8F3keGIhJbCHg52XPQAc/enFEL29nqevKIx41jsFACda0IZT9uB WAZ3KzR2WtOYKFXYJlGogGg/UsNzZ1icKea2sqQpHNlmTvVHEi3wofJuxiHj5sv8EPSR SM6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=WfhxYUvCU58bggqjA04MC5QjP6iOq7l5gLieiD2RJHY=; b=AAuDaFoCxOWKQpzdGM6UaMCkqRoXE1BqCBb2kH+swZ/0ht36qdbvJ+vxEbKIYEO73c nGbjM2On5QEYUXmG37hy9AzeVZfGsy5ttTvnegCZwhxK+nSlSeaZVrKPPsMi1Mi7Umu/ yWzMo7bdkyK5URHv8T9vlyFuu/0jE0oxFVkscO7I/io8sdeQYgr8CRCfQcuCFVOHqhmP 4gYokbsrhnKB6toS+Gmr+MxedFdm9D4uN/g/pZYAj3Bgej7rjbGr+O8Vw691P8GmWOFq 83wbpRwqjcYjb4HOb2g37MumCONqUjC+VngeAZIo+hfk8+vvoeCtdV+X+WfnVmRk2p4y QBqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=PGd1WO1d; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gb34-20020a170907962200b0072b592b88d6si17472775ejc.496.2022.07.18.01.14.38; Mon, 18 Jul 2022 01:15:03 -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=@kernel.org header.s=k20201202 header.b=PGd1WO1d; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232768AbiGRHy1 (ORCPT + 99 others); Mon, 18 Jul 2022 03:54:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42578 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230009AbiGRHy0 (ORCPT ); Mon, 18 Jul 2022 03:54:26 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0051D112F; Mon, 18 Jul 2022 00:54:25 -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 8E96061366; Mon, 18 Jul 2022 07:54:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 418BCC341C0; Mon, 18 Jul 2022 07:54:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1658130865; bh=tWt1vYWDaTVxwRFLqeGhQ6xsXw83LhS7SS6nHo2L++A=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=PGd1WO1dR1rdIH2fiN+CBoHkIbKQMUkLabEOE/zWsuFuZ6UuEGL7rkfudlsSYo1Jj gaG92VUCo+9XH9rhN5pikSlXD9kiu9dStrvLRufQfQYcgBzYIlZ07PvGRhkSKaUc/A 6OWULNC8ouxJIWUgNVDMwi0v+Fuje0GdSEtdzIUXWbFKpUQaKO85DgKp/ZkffoYctk J8dbil1nRSO99qGsF9sOuI8glmcDOTqmtnN5Ag7tu9AlJa2pKnmZoe85rvXbom5ezf nnhyXIVyrmGdsy3e3UFjGmzTSQHV9f3wRQO/8CPy+ZQPHdhCNKhvu/5AdIBknHs4og oJgIcck1Nyhvg== Message-ID: <26677d42-337c-8786-f10a-0d87a14ae15c@kernel.org> Date: Mon, 18 Jul 2022 09:54:16 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH V5 04/16] rv/include: Add deterministic automata monitor definition via C macros Content-Language: en-US To: Tao Zhou Cc: Steven Rostedt , 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 References: <5e0447aa9d114c52fd2bc335de036c61d9625f1c.1657745645.git.bristot@kernel.org> From: Daniel Bristot de Oliveira In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS 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 7/17/22 17:18, Tao Zhou wrote: >> +static int task_mon_slot_##name = RV_PER_TASK_MONITOR_INIT; \ > In patch1, RV_PER_TASK_MONITOR_INIT is defined as: > > #define RV_PER_TASK_MONITORS 1 > #define RV_PER_TASK_MONITOR_INIT (RV_PER_TASK_MONITORS) > > RV_PER_TASK_MONITOR_INIT is 1 now, seems not the index of the first only > element in vector. Now no map here, one task has one monitor though if I > am not wrong. > So task_mon_slot_##name must be defined to the index of first element. > Modify the macro definition of RV_PER_TASK_MONITOR_INIT to the index of > first element in vector. > > #define RV_PER_TASK_MONITOR_INIT (RV_PER_TASK_MONITORS) - 1 nop, (RV_PER_TASK_MONITORS) is an invalid vector value, so we can detect things like: disabling a disabled monitor. (I forgot to reset it when disabling a monitor... added) -- Daniel