Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp437336pxm; Wed, 2 Mar 2022 19:26:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJy1RE5bE/kyBVYAjaoc4K116lvxRqp0Q8VuNQuUUXiCvxZ4jY1+wRwbseRIIkeK0G4tMGt1 X-Received: by 2002:a81:83c9:0:b0:2dc:6bb:4b0a with SMTP id t192-20020a8183c9000000b002dc06bb4b0amr6851656ywf.294.1646277993615; Wed, 02 Mar 2022 19:26:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646277993; cv=none; d=google.com; s=arc-20160816; b=hrVD5Tve0MUJufVLEzfoT4o4Fi8MDMp5eIGGIqHhl+yR57fbGF7vwIhznI0sh5kPtw qHpNy8LUlgCSj9IWm9XlMkHDyK6y2NS2F3kDAWXkQImvkJTAHNoh3eDMbRjsibSLOnVM rixsAkkRbPd1/pi3jHgYzEtyJs77XjNKbuw8ZK5oQxf4kkmEz69S0wtdA7/yLDRmw9wB adoP7AnnFxEtaBNCchv7S0zUAcebSDtoPQDBL/95QjBts9oGPm907qdjeJ/S070dPVQh GcUszWcBrDnL65EbmvPSh67/pJpwd11C7qm9LCeEOUmmrE3Z6KsUMWDcvVl0Iomy+hym n36Q== 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=5n7vW4c00DPULjsq3+Q0z7y1FoJYxO3iXC9wvvHIBGI=; b=JCy2NIkJtct0D9zjgj8MYv31k8ZjbZClbLZP60SEyhWm0ybTzKf0tf5VgkR/th72dy eRZSbar1odWZUYs6244OL/8lAIlQLT+eXjSKm3HxlDNndpsGM2QwqJwaJ7GKOhMhnYZc XtihoHgMUrgp8vpuM9H0vdemTqxYHCPamrpE89hdNDZhz+HCFYG32tUrnG4STP3IFPPd 1Hy2c4ayShVoMAPWKEuS0zdYm9q2pB1qjmAunZwX/nfFD68uhGjkxcAI3pV9sqzR2/PE jtEyjGv9VbBqxJRo4BnIOnxsob+DhboX/g8bwDSzzFSecnB9OaMgbOqGxpQwDtIdh1Zq sAhw== 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 x35-20020a25ace3000000b006287db9cddbsi719384ybd.571.2022.03.02.19.26.17; Wed, 02 Mar 2022 19:26:33 -0800 (PST) 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 S229458AbiCCD07 (ORCPT + 99 others); Wed, 2 Mar 2022 22:26:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53260 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229446AbiCCD06 (ORCPT ); Wed, 2 Mar 2022 22:26:58 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3B5AF45799 for ; Wed, 2 Mar 2022 19:26:14 -0800 (PST) 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 C8ADD61738 for ; Thu, 3 Mar 2022 03:26:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 51D07C004E1; Thu, 3 Mar 2022 03:26:12 +0000 (UTC) Date: Wed, 2 Mar 2022 22:23:25 -0500 From: Steven Rostedt To: Masami Hiramatsu Cc: linux-kernel@vger.kernel.org, Ingo Molnar , Andrew Morton , Joel Fernandes , Peter Zijlstra , Tom Zanussi Subject: Re: [PATCH 2/2] tracing: Add sample code for custom trace events Message-ID: <20220302222325.7ad12606@rorschach.local.home> In-Reply-To: <20220303104006.56820d801a9ba6c4d5da8c93@kernel.org> References: <20220302032414.503960863@goodmis.org> <20220302032820.877781830@goodmis.org> <20220303104006.56820d801a9ba6c4d5da8c93@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, 3 Mar 2022 10:40:06 +0900 Masami Hiramatsu wrote: > > +static struct trace_event_call sched_switch_call = { > > + .class = &sched_switch_class, > > + .event = { > > + .funcs = &sched_switch_funcs, > > + }, > > + .print_fmt = SCHED_PRINT_FMT, > > +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 0) > > + .module = THIS_MODULE, > > +#else > > + .mod = THIS_MODULE, > > +#endif > > I think this example code doesn't need to care about older kernels. Oops, I thought I got rid of all the mod versions :-p I had this working on a 5.4 kernel that we were going use, and there was a bunch more of these in my original code. I'll nuke this on v2. > > Others looks good to me. > > Reviewed-by: Masami Hiramatsu > > Hopefully, it is more helpful if there are more comments for other developers. :-) > (and usage comments too) Actually, I was thinking of coming up with a bunch of helper functions/macros to make this less complex. But yeah, it needs a bunch of comments before it can be accepted. Thanks a lot for the review! -- Steve