Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp4259642iog; Tue, 28 Jun 2022 12:19:45 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vgACrwRHlYB2ZQaxuaDqOJWS1VY46PuTLWcxVwZnobEYhlLHydb1GHViVt5dAs7JeV8XIi X-Received: by 2002:a65:490d:0:b0:40d:9867:2df with SMTP id p13-20020a65490d000000b0040d986702dfmr19170261pgs.171.1656443985632; Tue, 28 Jun 2022 12:19:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656443985; cv=none; d=google.com; s=arc-20160816; b=hlcBInaxGvqKfMZDgIjmCv1PVr9E6JH4jPaZcxmWxrHosb6pkqbPoxUuU7jo68W8yR tYpXICT4gzEmie5iE1Onwo+YI9aW0czKOR3k/2iXTZ+zEExUrwkuZfvskJif2jKtCqU6 IPS5u87KiCd4u+gV5K0vIYgd8mKfgvslbHKAO3Jm2u0MiM8dtfdDxCpymEc82YnTTQX0 i7KkT16LdLDH1fYZuxv5USloganeIHPtnArT0xaAIGwIeodex7wUUDaRA4+NTI+vac70 MIVIAuyyG9Aqn+z+EiRriAQC+G4b9zfl085RrZZI7tvIKQy9uKVJh0w0V9iDt3l74Cml 4Yjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=e/sJA5RNTCL9qVfqIhiZwv4Uz0lEW4g0dtDf/X5stGA=; b=kC2HERp/OD3BSdFa4DGAeOQV443v58MTfRTKBn7lpQSmy9fzaVjsL0JmQX1TsoRw8Y kgRfxTWjEkRdnmr9dchI4V5Du+Nlyrskcom6NMqVFCEgfbMloofwhwWOKaEwdS4K8GxA 3Wjtc14mP+ZadKxcZ+NTAz0k5BRdTfjS+yQczK5ILbfXkNg/NPxFVVxcnFhq3Fy0lOZm tBCnc8q6UpkdHxbC97M6tIypQxiGPsTUqwgo+ajUe/wksXGI2v714Dx5eaxiIfyvpVr6 TlPxUEFSxQmAqEThcXaR7CpzDIOV//uPrZbuUDKip9DZ8loTMh931V5jvqegk65lA8wu yVIg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b3-20020a170902650300b00163d6240143si19440147plk.6.2022.06.28.12.19.33; Tue, 28 Jun 2022 12:19:45 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235904AbiF1TFt (ORCPT + 99 others); Tue, 28 Jun 2022 15:05:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35058 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235415AbiF1TFL (ORCPT ); Tue, 28 Jun 2022 15:05:11 -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 8763C2CC8F; Tue, 28 Jun 2022 12:05:10 -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 18E9C618E2; Tue, 28 Jun 2022 19:05:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 97EEFC3411D; Tue, 28 Jun 2022 19:05:07 +0000 (UTC) Date: Tue, 28 Jun 2022 15:05:06 -0400 From: Steven Rostedt To: Daniel Bristot de Oliveira Cc: 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 , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-trace-devel@vger.kernel.org Subject: Re: [PATCH V4 11/20] rv/monitor: wwnr instrumentation and Makefile/Kconfig entries Message-ID: <20220628150506.291d093a@gandalf.local.home> In-Reply-To: <944694879f67c0e635815ac57154be477a1b9108.1655368610.git.bristot@kernel.org> References: <944694879f67c0e635815ac57154be477a1b9108.1655368610.git.bristot@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 X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE 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 Thu, 16 Jun 2022 10:44:53 +0200 Daniel Bristot de Oliveira wrote: > diff --git a/kernel/trace/rv/monitors/wwnr/wwnr.c b/kernel/trace/rv/monitors/wwnr/wwnr.c > index 8ba01f0f0df8..3fe1ad9125d3 100644 > --- a/kernel/trace/rv/monitors/wwnr/wwnr.c > +++ b/kernel/trace/rv/monitors/wwnr/wwnr.c > @@ -10,11 +10,8 @@ > > #define MODULE_NAME "wwnr" > > -/* > - * XXX: include required tracepoint headers, e.g., > - * #include > - */ > #include > +#include > > /* > * This is the self-generated part of the monitor. Generally, there is no need > @@ -37,21 +34,20 @@ DECLARE_DA_MON_PER_TASK(wwnr, char); > * are translated into model's event. > * > */ > -static void handle_switch_in(void *data, /* XXX: fill header */) > +static void handle_switch(void *data, bool preempt, struct task_struct *p, > + struct task_struct *n, unsigned int prev_state) > { Patch 8 was the "educational" patch. There's no reason to split 10 and 11 up too. -- Steve > - struct task_struct *p = /* XXX: how do I get p? */; > - da_handle_event_wwnr(p, switch_in_wwnr); > -} > + /* start monitoring only after the first suspension */ > + if (prev_state == TASK_INTERRUPTIBLE) > + da_handle_init_event_wwnr(p, switch_out_wwnr); > + else > + da_handle_event_wwnr(p, switch_out_wwnr); > > -static void handle_switch_out(void *data, /* XXX: fill header */) > -{ > - struct task_struct *p = /* XXX: how do I get p? */; > - da_handle_event_wwnr(p, switch_out_wwnr); > + da_handle_event_wwnr(n, switch_in_wwnr); > } > > -static void handle_wakeup(void *data, /* XXX: fill header */) > +static void handle_wakeup(void *data, struct task_struct *p) > { > - struct task_struct *p = /* XXX: how do I get p? */; > da_handle_event_wwnr(p, wakeup_wwnr); > }