Received: by 2002:ac0:da4c:0:0:0:0:0 with SMTP id a12csp642462imi; Thu, 21 Jul 2022 08:10:05 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uFKk10Xevd6AZ4KVSpDNmoaLtVIz9X563OSO/JMM9N8xDv09DZocQ0MpJLzj0HwugtCsnw X-Received: by 2002:a05:6402:228f:b0:43a:896:e4f0 with SMTP id cw15-20020a056402228f00b0043a0896e4f0mr55495193edb.81.1658416204649; Thu, 21 Jul 2022 08:10:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658416204; cv=none; d=google.com; s=arc-20160816; b=nxsPpzN7nRdWw0sZ/gRnnDlEtcPigDeIDxlxyQTLKlcz2KF6zU6guAl7h7uiNe3M5d oxoBbgohjZdUypmI7Zn1DsrapWsexs/agS/Jrz0Ialcfc/iq8ZKYOq9NyPnvtaEwHnew nTQUyAlDxiypXZEaYRFGqrPRWDOW1zRyihub7xegcqxdOEDgmhXn4W/Uoy+6FMfRdnwE vHgGiwf+Rdn7JkXBElni6o7uDsSMNnZytvbeLPT0T+66VycKcvvytmxKcqnl0u5njPup APVesHZB9ZW6mQS78hLVemhcGwLbnp1HPPnikhE4ulaZhGjjwxwN0ti6+JCM/tFS7zPS tMNw== 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:dkim-signature:date; bh=HnJf3a3R/WDtkPI32iClfgBxpOQWUhxqHOYGsZd26QY=; b=kR09sJqNdu/hR4vCt7fw6E3C2ZF0wQqq6/20ufzb7mSUcsjk7VCgH1/Un4OCuArKFn lQFdU4utY5ROOcPadmbfjc/D72YH7jgOqKyTSMKwqHeVwaQyM1ywdh+A6ivJxdHAXRWu WOQpLDoT5tnJqDWSiwBQaxg1fFhdis0zbkmY6G+G8VOylZjr64IeVP1FaAKkQPCJtORE uBjQRbyl1co4BsiwoRXkU8cRmR+wEinEAeQdQ6JIbgkfZx0gctZO2pSoM4k2L8Bi4n4v tjOtb3SdSbnr3MVk4OSY1JeWB/pB/zHq37op0Vywq0bSvgOp9GWMGpkuhKZG6MnUfBA+ 7VdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=GdErNbbW; 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.dev Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w11-20020a05640234cb00b0043a1312a2bbsi2727422edc.472.2022.07.21.08.09.39; Thu, 21 Jul 2022 08:10:04 -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.dev header.s=key1 header.b=GdErNbbW; 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.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231605AbiGUO5d (ORCPT + 99 others); Thu, 21 Jul 2022 10:57:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44440 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231639AbiGUO51 (ORCPT ); Thu, 21 Jul 2022 10:57:27 -0400 Received: from out0.migadu.com (out0.migadu.com [94.23.1.103]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9358686C39; Thu, 21 Jul 2022 07:57:23 -0700 (PDT) Date: Thu, 21 Jul 2022 22:57:12 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1658415441; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=HnJf3a3R/WDtkPI32iClfgBxpOQWUhxqHOYGsZd26QY=; b=GdErNbbWgx1K8NgDU1VOOBBzhzkydujCEG+dIXTO5rqjXdQ4uALRBFSQIlECtB0b10E0n1 l3bxbzSgFHWEgMf1CePnOVqX+Qt9nNFm6PeKldh63AQdTpGSfflTCK9+De5fgf/QoHknF1 0Q7yHEiFdotNEEqfXVNPX4ergSGbLms= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Tao Zhou To: Daniel Bristot de Oliveira 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, Tao Zhou Subject: Re: [PATCH V6 11/16] Documentation/rv: Add deterministic automata instrumentation documentation Message-ID: References: <3c915ffd00f033d57dbac2f69e56a87b7b80adba.1658244826.git.bristot@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3c915ffd00f033d57dbac2f69e56a87b7b80adba.1658244826.git.bristot@kernel.org> X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: linux.dev X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS, 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 Tue, Jul 19, 2022 at 07:27:16PM +0200, Daniel Bristot de Oliveira wrote: > +Looking at the automata definition, it is possible to see that the system > +and the model are expected to return to the initial state after the > +preempt_enable execution. Hence, it can be used to synchronize the > +system and the model at the initialization of the monitoring section. > + > +The start is informed via a special handle function, the > +"da_handle_start_event_MONITOR_event)", in this case:: da_handle_start_event_$MONITOR(event) the same as the previous version should be right. > + > + da_handle_start_event_wip(preempt_disable_wip); I didn't see this in last version that the event should be preempt_enable_wip. > + > +So, the callback function will look like:: > + > + void handle_preempt_enable(void *data, unsigned long ip, unsigned long parent_ip) > + { > + da_handle_start_event_wip(preempt_enable_wip); > + } > + > +Finally, the "handle_sched_waking()" will look like:: > + > + void handle_sched_waking(void *data, struct task_struct *task) > + { > + da_handle_event_wip(sched_waking_wip); > + } > + > +And the explanation is left for the reader as an exercise. > + > +Start and Stop functions Start and Stop functions are changed to enable and disable functions. > +------------------------ > + > +dot2k automatically creates two special functions:: > + > + enable_MONITOR() > + disable_MONITOR() > + > +These functions are called when the monitor is enabled and disabled, > +respectively. > + > +They should be used to *attach* and *detach* the instrumentation to the running > +system. The developer must add to the relative function all that is needed to > +*attach* and *detach* its monitor to the system. > + > +For the wip case, these functions were named:: > + > + enable_wip() > + disable_wip() > + > +But no change was required because: by default, these functions *attach* and > +*detach* the tracepoints_to_attach, which was enough for this case.