Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp1013891rwe; Fri, 26 Aug 2022 21:26:38 -0700 (PDT) X-Google-Smtp-Source: AA6agR4Q8iZYb5R1FFXo0iXsvrp8U3sdbvGoL+LfKRKvSmVSEHj50ogd0znIYwLriF2EAbwnTlUL X-Received: by 2002:a05:6a00:230f:b0:52f:6734:90fe with SMTP id h15-20020a056a00230f00b0052f673490femr6997085pfh.67.1661574398233; Fri, 26 Aug 2022 21:26:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661574398; cv=none; d=google.com; s=arc-20160816; b=ToBPFGM6mc9CPUB6OyKPXzwJj4lW91fhBeeik/N3MP99mqZxuR/TD6DnnwcbV7F9L8 ubCHLLpX2owF5tQDEnSZw3YML8BsV7n281kkAs2TVBlSdLbC27mOTTo35ymE5iTc/7LB KrCgq4285NnqrDu2DGjpyPaq7wfnqxTD5QAqmxZXPmXLGX1AjGSjs4k6u6bj751F00Hi BNkVWTP8pd5oJu+O4sKNQ9T/QeKUR2d8fT6dUPpg7vZaXTBSJ/wb+HnfXmhhdlCzpBdA Pu03w/gLBjQeBNVnRCJIA+QKWkX1/LB++X7f6TQdaq9Cbr5YkLMvzjRf1gC21proF7E5 x/EA== 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=jmE4SijYH69bmrj/gFrlHwsGXypGdcNuX2RffNxe/Zw=; b=r4Gb2Q8aHFuK3ju3ES2dVjkTMXYB2QKjPtaYgUdnsrYgY3rkzgnWURKgisWypiIYPw OlG/5557KeT1NyGYsjTF/R6bajIky2mwAPWj4K4XwrRPdhoRpjIKW3AwBHBhxMmCEFme i40MarHuxjbbnpq0Tszv7Pg89yuh56F2CinD/gDcdwVwF/uGOf/yRPHqAwsBRRD+pLVK VbYKvhBhQc1O67+P0qXtU/OdmSqcHUY4LE0bsEVtMlq2TM8UeNB+m/VfYSqk4DV1YqwD PQwDOL8bJYnev5K4Cd5OYf5ExlaBqUIZXdXp4A0ALqmW1KEOEzeFlqhi7TXNt2tm3AyX bqZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Em8MGkIv; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id pv4-20020a17090b3c8400b001faa7b96ca0si3511651pjb.13.2022.08.26.21.26.26; Fri, 26 Aug 2022 21:26:38 -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=Em8MGkIv; 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 S231725AbiH0EDP (ORCPT + 99 others); Sat, 27 Aug 2022 00:03:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60668 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229449AbiH0EDM (ORCPT ); Sat, 27 Aug 2022 00:03:12 -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 F37C2E398D for ; Fri, 26 Aug 2022 21:03: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 0361861DCF for ; Sat, 27 Aug 2022 04:03:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 38407C433C1; Sat, 27 Aug 2022 04:03:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1661572989; bh=ehcQFeMDwSm+yrUdn1K0FD1tIXNWCnHe2vng7L9bw0k=; h=From:To:Cc:Subject:Date:From; b=Em8MGkIvbEXYTGTv8xKdUV6L7pLx2z/iNBE2nzzZzzmoD0x411oXMvL5Sz2O9FCnc 1QreMFXTfMwfzPs1c6567XneQWwi4IRTd3ceJxj8n5tzz+D/iixzThe/cS+8qKZc1a qsTSDPHwN+nmZ9zX6ljjYt0UXaNkAp5wWiDdlvXW0udkzAG8X8UkePlVl8xJPf4rLm mJ0Uuv4gr3fpV0DsG83ttUGs9/VpmE4lgcmnjKqRbe/7tb98ijpP0UvE8T0+U+SptD 2kaDW1HZrf9nnHo7M1OsYDSHeeImIUQlM0/B6JSABnvxaxAORBFaChmPmdrcyWzNpe DWYuQlyQog4Nw== From: "Masami Hiramatsu (Google)" To: Steven Rostedt Cc: Tom Zanussi , Ingo Molnar , linux-kernel@vger.kernel.org Subject: [PATCH v4 0/5] tracing/hist: Add percentage histogram suffixes Date: Sat, 27 Aug 2022 13:03:05 +0900 Message-Id: <166157298537.348924.2537162090505397377.stgit@devnote2> X-Mailer: git-send-email 2.25.1 User-Agent: StGit/0.19 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 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,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 Hi, Here is the 4th version of .percent and .graph suffixes for histogram trigger to show the value in percentage and in bar-graph respectively. I've rebased on Tom's hitcount patch[1/5] on the series and added a patch for supressing display of hitcount[5/5] in this version. This will help us to check the trend of the histogram instantly without any post processing tool. Here shows an example of the percentage and the bar graph of the hitcount of the running tasks. # cd /sys/kernel/debug/tracing/ # echo hist:keys=pid:vals=hitcount.percent,hitcount.graph:sort=pid > \ 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 [active] # { pid: 14 } hitcount (%): 4.68 hitcount: ### { pid: 16 } hitcount (%): 17.18 hitcount: ########### { pid: 57 } hitcount (%): 7.81 hitcount: ##### { pid: 61 } hitcount (%): 31.25 hitcount: #################### { pid: 70 } hitcount (%): 4.68 hitcount: ### { pid: 77 } hitcount (%): 1.56 hitcount: # { pid: 145 } hitcount (%): 18.75 hitcount: ############ { pid: 151 } hitcount (%): 9.37 hitcount: ###### { pid: 152 } hitcount (%): 4.68 hitcount: ### Totals: Hits: 64 Entries: 9 Dropped: 0 Of course if you explicitly specify the hitcount, it can show the hitcount as below; # cd /sys/kernel/debug/tracing/ # echo hist:keys=pid:vals=hitcount,runtime:sort=pid > \ events/sched/sched_stat_runtime/trigger # sleep 10 # cat events/sched/sched_stat_runtime/hist # event histogram # # trigger info: hist:keys=pid:vals=hitcount,runtime:sort=pid:size=2048 [active] # { pid: 14 } hitcount: 2 runtime: 304876 { pid: 16 } hitcount: 8 runtime: 300574 { pid: 26 } hitcount: 2 runtime: 15578 { pid: 32 } hitcount: 2 runtime: 219186 { pid: 57 } hitcount: 3 runtime: 506003 { pid: 61 } hitcount: 20 runtime: 1681473 { pid: 69 } hitcount: 3 runtime: 201785 { pid: 70 } hitcount: 4 runtime: 360608 { pid: 77 } hitcount: 8 runtime: 4146935 { pid: 145 } hitcount: 13 runtime: 7537994 { pid: 155 } hitcount: 4 runtime: 2511937 { pid: 156 } hitcount: 2 runtime: 1398886 Totals: Hits: 71 Entries: 12 Dropped: 0 Thank you, --- Masami Hiramatsu (Google) (4): tracing: Fix to check event_mutex is held while accessing trigger list tracing: Add .percent suffix option to histogram values tracing: Add .graph suffix option to histogram value tracing: Show hitcount value only when specified Tom Zanussi (1): tracing: Allow multiple hitcount values in histograms kernel/trace/trace.c | 3 - kernel/trace/trace_events_hist.c | 176 ++++++++++++++++++++++++++++++----- kernel/trace/trace_events_trigger.c | 3 - 3 files changed, 156 insertions(+), 26 deletions(-) -- Masami Hiramatsu (Google)