Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp7258550rwi; Mon, 24 Oct 2022 12:00:35 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4xBeuvydUn7arilAPTG6PTS5XKaYGASgsjCXGPDWQGma9CY13xStRgR+4tbULSWImcLiX6 X-Received: by 2002:a63:2d05:0:b0:460:55e3:df91 with SMTP id t5-20020a632d05000000b0046055e3df91mr29351055pgt.177.1666638035352; Mon, 24 Oct 2022 12:00:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666638035; cv=none; d=google.com; s=arc-20160816; b=YMOtQBQqtuzH972vyVhe+440HkdWEnWrRSaKdJTsP2gVJ5RF1c+ClZ3CNIHEvCmhsV xCI4DRHQHXQXZk8SS9XN6P4dNsnt8o71GUaqqtZy4dJtPbwRhHhDQkSAC3KLolwIu9mf KAQ7MzDoiVhE/s8fnmROcE4g+LFA03tW7Kg+dxHnfMIvIvnCMYVdin5EbqbxHA6UmYX4 hJ4E9gw0idFJ4EU58J9hYBByK+rPxZTap1grUAsmKxcYBPLvNnxA71PxQ+xXVxmoyVKm 1pDpsHjARG82QvpJ+GmnqBRq/TL9jCTZmDjMUj73Y0juh1Wb+xtzDIoEuHt4sRhEeDCm 7FlQ== 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=RtwEENTJFDzxnIjXNH8dzKKQi44lQbmEBWE3NxEL1Co=; b=KnHQ21dLKJllgXW9OOjUJbn8bEPHaQ2PkUsl1LGVEpzvYpJ/UDomFvpLDZnhEclpXq DvpAQldcrW0gWQntC1aKyilazN0o3MGRNhUUSbfLYDFf+PQ2Qvf4q34Wp2MFV7rhjsko S8e2yLgO5SchU8C7jA77ErsaEutmlkjeQ6Sc2EcBxrd9AGUj4j9NN7M8R2s+P70Zu8o2 6y49FCy0FLAaig2pMeo4e7BqfL9siutxLYex8TaaFAuU4ewgepRBUbRO8nNapT/MHEFu lP+58aKmppDb2xfHqC9V0uG1/KPP9O75LLeHDN3xz6no18rhPBouCgLE9pJvPSY0KUn0 Luhw== 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 b20-20020a170902b61400b00179f69eae64si205459pls.620.2022.10.24.12.00.21; Mon, 24 Oct 2022 12:00:35 -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 S231494AbiJXSiG (ORCPT + 99 others); Mon, 24 Oct 2022 14:38:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35586 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231659AbiJXShg (ORCPT ); Mon, 24 Oct 2022 14:37:36 -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 4A36746DA0; Mon, 24 Oct 2022 10:19:21 -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 707956147C; Mon, 24 Oct 2022 16:19:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 38206C433C1; Mon, 24 Oct 2022 16:19:16 +0000 (UTC) Date: Mon, 24 Oct 2022 12:19:26 -0400 From: Steven Rostedt To: Maxime Ripard Cc: Stephen Boyd , Michael Turquette , Masami Hiramatsu , linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org Subject: Re: [PATCH 2/2] clk: Add trace events for rate requests Message-ID: <20221024121926.1f11c57a@gandalf.local.home> In-Reply-To: <20221018-clk-rate-request-tracing-v1-2-6f3aa0b0b9de@cerno.tech> References: <20221018-clk-rate-request-tracing-v1-0-6f3aa0b0b9de@cerno.tech> <20221018-clk-rate-request-tracing-v1-2-6f3aa0b0b9de@cerno.tech> 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 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, 18 Oct 2022 15:56:42 +0200 Maxime Ripard wrote: I know I reviewed this but looking at this again, I noticed: > +DECLARE_EVENT_CLASS(clk_rate_request, > + > + TP_PROTO(struct clk_rate_request *req), > + > + TP_ARGS(req), > + > + TP_STRUCT__entry( > + __string( name, req->core ? req->core->name : "none") > + __field(unsigned long, min ) > + __field(unsigned long, max ) > + __string( pname, req->best_parent_hw ? clk_hw_get_name(req->best_parent_hw) : "none" ) It may be best to move the two __string() declarations together. The reason is that dynamic strings (which __string() is) uses 4 bytes embedded in the first part of the event. Two bytes for offset, where the dynamic string exists, and two bytes for the strings length. On 64 bit machines the above has: __string() 4 bytes __field(unsigned long) 8 bytes __field(unsigned long) 8 bytes __string() 4 bytes and then another unsigned long field below, which is another 8 bytes. > + __field(unsigned long, prate ) > + ), > + > + As compilers tend to use word alignment, the above turns into: __string() 4 bytes __PADDING__ 4 bytes __field(unsigned long) 8 bytes __field(unsigned long) 8 bytes __string() 4 bytes __PADDING__ 4 bytes __field(unsigned long) 8 bytes Where there will be 8 bytes of padding in that event that wastes precious ring buffer space. By changing the event to: TP_STRUCT__entry( __string( name, req->core ? req->core->name : "none") __string( pname, req->best_parent_hw ? clk_hw_get_name(req->best_parent_hw) : "none" ) __field(unsigned long, min ) __field(unsigned long, max ) __field(unsigned long, prate ) ), It will turn the size into: __string() 4 bytes __string() 4 bytes __field(unsigned long) 8 bytes __field(unsigned long) 8 bytes __field(unsigned long) 8 bytes With no padding and no wasted space. I would suggest changing this. -- Steve