Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp11658445rwl; Tue, 3 Jan 2023 02:48:32 -0800 (PST) X-Google-Smtp-Source: AMrXdXszaD8rKOm+hWxof1BAUpgc3E36yc9gW7RXydG2jlZUZ35QCcQCXQfrIQpdMrKOGGNwbvjS X-Received: by 2002:a05:6402:176e:b0:48b:4f30:b083 with SMTP id da14-20020a056402176e00b0048b4f30b083mr9563164edb.40.1672742912293; Tue, 03 Jan 2023 02:48:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672742912; cv=none; d=google.com; s=arc-20160816; b=Hn0LwzZIIXetb3q4jOkDMhLb5NcjLvdDxa4unl6TlMu2zB9+eIVFcH1qRS4BDvqkzx 0dFFCozj+OPHDXtr2gPNWV61SK5Ic++cJrtLkrCsJHMPPVAQtBguRN6eEUmHCmx0a0Eb P9SuK38IyBWywtbIQAFkALuMsSSxBgDLbckYI5iIN/32ISnJnF7Gt92EmGc3ncWkMQp0 xcAN94DfTej/22keKHDXVWaj2qRQzcuOoMsruNTTgkG//ggx4BV8FgFkM33MjgdGTnYo DJhojnxv4Bks0xYkTbZxfyy2Ze+GVlADCD3GO4orQlId/J4dVdlP7452ZKXHCuBqZewP MAYA== 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:date:subject:cc:to:from; bh=O1sM/ALXstszhb7a5OWhCd9mfD88mpPsRnQLCkj+Ags=; b=Vjc6M3KSTiFcng/l8S/s/aUYjSKMZH6oFwebQB+p4WKY95r5GDx/CJOFcifhMWpFII zazGuWtqCPFpLlOXqaOYIVGchPJUlgP9yEF8L9JrgLJ5TDUduBP1jhXGBPHhbC2dST6l r7mIgcnU3gPD9dDb3wViT0fbpJxqA10X6FqEsKpsEChzsXPRvAGdcHp7izlJZv/xt55b 0ZzHJruiE5ZGtkzdTSDY0IXOnIQNNYlZOqEiIjdNlkhUwdnh9LgtPM3pjWDIOox6gLE3 kAKFwRe2B4BqMAgEYtYYT8kayQ4Sf54Nwh/NCm0gOZvTM9qik7XJslf/6DjZxfMV1Lm3 xFsQ== 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 n18-20020aa7c692000000b0047f2f8bfc05si24533024edq.135.2023.01.03.02.48.17; Tue, 03 Jan 2023 02:48:32 -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 S237181AbjACKel (ORCPT + 62 others); Tue, 3 Jan 2023 05:34:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57714 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230124AbjACKeS (ORCPT ); Tue, 3 Jan 2023 05:34:18 -0500 Received: from serv15.avernis.de (serv15.avernis.de [IPv6:2a01:4f8:151:30a2::163]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1DC8AB21; Tue, 3 Jan 2023 02:34:15 -0800 (PST) Received: from iago.. (unknown [95.91.249.42]) by serv15.avernis.de (Postfix) with ESMTPSA id 36866BDE03E8; Tue, 3 Jan 2023 11:34:13 +0100 (CET) From: Andreas Ziegler To: Daniel Bristot de Oliveira , Steven Rostedt Cc: linux-trace-devel@vger.kernel.org, linux-kernel@vger.kernel.org, Andreas Ziegler Subject: [PATCH 0/2 v2] rtla osnoise hist average calculation Date: Tue, 3 Jan 2023 11:33:58 +0100 Message-Id: <20230103103400.275566-1-br015@umbiko.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Virus-Scanned: clamav-milter 0.103.7 at serv15.avernis.de X-Virus-Status: Clean X-Spam-Status: No, score=-0.4 required=5.0 tests=BAYES_00,RCVD_IN_SORBS_WEB, SPF_HELO_NONE,SPF_NONE autolearn=no 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 Version 2 of the proposed patch, with changes split in two separate commits, as suggested by Daniel Bristot de Oliveira rtla osnoise hist always outputs '0' as average duration value. Example: # rtla osnoise hist -P F:1 -c 0-1 -r 900000 -d 1M -b 1 -E 5000 -T 1 # RTLA osnoise histogram # Time unit is microseconds (us) # Duration: 0 00:01:00 ... count: 5629 1364 min: 1 1 avg: 0 0 max: 2955 56 This is due to sum_sample in osnoise_hist_update_multiple() being calculated as the sum (duration), not as sum (duration * count). Truncating of the average value in final output suggests too optimistic results; display floating point value instead. Andreas Ziegler (2): tools/tracing/rtla: osnoise_hist: use total duration for average calculation tools/tracing/rtla: osnoise_hist: display average with two-digit precision tools/tracing/rtla/src/osnoise_hist.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) -- 2.34.1