From patchwork Tue Oct 18 15:48:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Masami Hiramatsu (Google)" X-Patchwork-Id: 293 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp2030474wrs; Tue, 18 Oct 2022 08:52:48 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5xMpUfZQif0N+jTDBFrC2z9ploM55ZANKm1Ko05iqx91infq3B7sOvQbW8Drd2H9hc3+DD X-Received: by 2002:a05:6402:1604:b0:458:b2b7:bd5a with SMTP id f4-20020a056402160400b00458b2b7bd5amr3100844edv.73.1666108368035; Tue, 18 Oct 2022 08:52:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666108368; cv=none; d=google.com; s=arc-20160816; b=iEkQHM7LUanpxvPvORgHKrmvSjVBEAyRq8B05I3xQjCffPr3L3kZlryG94heHGXRqh yIrEFeo8kMJxYUVZo0naRvDJWwzmlgMlIKvVR0bngElSXbS+tqdGTHYrDDqo8z/r6/dt PQs0ftbbPRcpqP0359yQu5LiNM5gVm34OfjuncPpFKdh/ZhaZ3rHSPMxDe8dsQC525ni mDy1CHjJw5Wyzj1CNqHJBfPdtBNlGeEk3x4s8KKJSsDyBLHNjpiR2GyLdn7FiyPoN/X9 2WaVjqKWkuyak/YxzIyNXYzZJSHUNCHYc9MujkFHTS080fdVCY43wIc0f1h/0+mkEev3 R3Gg== 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 :user-agent:message-id:date:subject:cc:to:from:dkim-signature; bh=RfdnOnSuZO42wXfNs+Z24Qh3zdk3eGy4OCrWG+rZ3+c=; b=0GP8aREGu7aL/fE24OHZdWdrmECXoarhqn9fQwctOyCsXapg3hUn36TVLisk6G092h nwjsnES3EIVmWwko4u32u+I1FsiG1osY0OQIwe7PnhkYBOu1PuamARVPaYmqa0eeX1rY ZymU7am5n0ot3nYzLD+db4ea6YMMrF38Lv56qifhIn8fNqCXJTeDFyaCHRMonkbsrHqy DH64MSnsMOjCebbToMfRVJqGyzvrmN67YtHoEK2Gf9XEry4gEXPP0+XLx5pvqmv4mL/q xIiWM4tcaoCX+vyYhmv9pl5A4+qqSjy1stZFx/TcCvAVZFDaZu5r/WCZFDY2Q0k453ma IUSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fPZSljBM; 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=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o7-20020a056402038700b00458bbd3a0d2si10297327edv.602.2022.10.18.08.52.22; Tue, 18 Oct 2022 08:52:48 -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=@kernel.org header.s=k20201202 header.b=fPZSljBM; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230352AbiJRPso (ORCPT + 99 others); Tue, 18 Oct 2022 11:48:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52162 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230111AbiJRPsl (ORCPT ); Tue, 18 Oct 2022 11:48:41 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B7272C821C; Tue, 18 Oct 2022 08:48:39 -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 ams.source.kernel.org (Postfix) with ESMTPS id 6EA76B81BE1; Tue, 18 Oct 2022 15:48:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 62EE7C433D7; Tue, 18 Oct 2022 15:48:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1666108117; bh=pO0jFVJ4UO7ZMjfoTjgr0/MJjcpLWwBFEgsVsAQtQjE=; h=From:To:Cc:Subject:Date:From; b=fPZSljBM9iYf3pgxYCNFfyVkWi59Cnv2wImor1EPqKCQi1WvvrtFsWGH2VlxbD3sD HWOoOjSdd8lrrCibDjc8mJDFnytFQuyqFFGWHZM9g0i0y7OaPKUWZ6ZFMsec9H3EJT TkQYDzchWY8p9DRwRktmi+hiXugDMa2u3InZUqWylP28H6VSy9K9UytB7dmXChR2Pf HObrUxsCYNw58YBz8TyfmjdwxvHrzYTdUyaxXN5LkiQ0zeh8gPPxR9R65dmPDJIr8s uD2RrfyZmacLL1eBdgyFnD2+WthgKrpDxPB0CtcRAAaFYbsLJXWkTHNKeDKmLNd1zP VFdn8hxoU840w== From: "Masami Hiramatsu (Google)" To: Steven Rostedt Cc: Tom Zanussi , linux-trace-kernel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v6 0/5] tracing/hist: Add percentage histogram suffixes Date: Wed, 19 Oct 2022 00:48:33 +0900 Message-Id: <166610811353.56030.10023036046735082272.stgit@devnote2> X-Mailer: git-send-email 2.25.1 User-Agent: StGit/0.19 MIME-Version: 1.0 X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747041248477523580?= X-GMAIL-MSGID: =?utf-8?q?1747041248477523580?= Hi, Sorry, I forgot to update this series. Here is the 6th version of .percent and .graph suffixes for histogram trigger to show the value in percentage and in bar-graph respectively. The previous version is here; https://lore.kernel.org/all/166226473132.223837.9011128463174539022.stgit@devnote2 This is just fixing to add my signed-off-by and Tom's reviewed/tested-by. No functional changes. Here shows an example of the percentage and the bar graph of the runtime of the running tasks without raw hitcount field. # cd /sys/kernel/debug/tracing/ # echo hist:keys=pid:vals=hitcount.percent,hitcount.graph:sort=pid:NOHC > \ events/sched/sched_stat_runtime/trigger # sleep 10 # cat events/sched/sched_stat_runtime/hist # event histogram # # trigger info: hist:keys=pid:vals=hitcount.percent,hitcount.graph:sort=pid:size=2048:nohitcount [active] # { pid: 14 } hitcount (%): 6.91 hitcount: ## { pid: 16 } hitcount (%): 1.13 hitcount: { pid: 57 } hitcount (%): 6.99 hitcount: ## { pid: 61 } hitcount (%): 55.28 hitcount: #################### { pid: 67 } hitcount (%): 5.52 hitcount: ## { pid: 69 } hitcount (%): 20.08 hitcount: ####### { pid: 71 } hitcount (%): 0.40 hitcount: { pid: 77 } hitcount (%): 0.97 hitcount: { pid: 78 } hitcount (%): 0.56 hitcount: { pid: 145 } hitcount (%): 1.13 hitcount: { pid: 153 } hitcount (%): 0.48 hitcount: { pid: 154 } hitcount (%): 0.48 hitcount: Totals: Hits: 1230 Entries: 12 Dropped: 0 With the NOHC (or nohitcount) option, the histogram will skip display of raw hitcount, but it will allow to display percent and graph of hitcount. Trigger Result val=runtime -> Show hitcount and runtime val=runtime:NOHC -> Show runtime val=hitcount:NOHC -> Error (noval) -> show hitcount (noval):NOHC -> Error val=hitcount.parcent -> show hitcount and hitcount% val=hitcount.parcent:NOHC -> show hitcount% Thank you, --- Masami Hiramatsu (Google) (4): tracing: Add .percent suffix option to histogram values tracing: Add .graph suffix option to histogram value tracing: Add nohitcount option for suppressing display of raw hitcount tracing: docs: Update histogram doc for .percent/.graph and 'nohitcount' Tom Zanussi (1): tracing: Allow multiple hitcount values in histograms Documentation/trace/histogram.rst | 10 ++ kernel/trace/trace.c | 7 + kernel/trace/trace_events_hist.c | 177 ++++++++++++++++++++++++++++++++----- 3 files changed, 169 insertions(+), 25 deletions(-) -- Masami Hiramatsu (Google)