Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp628120yba; Fri, 3 May 2019 07:58:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqxhwsFbDa06rIQewqTOjI7PyOh5kgh4xD7kepgj7i8smrf8c36fPLumVDVASZatxi9LEr73 X-Received: by 2002:a63:de0a:: with SMTP id f10mr10812521pgg.418.1556895533829; Fri, 03 May 2019 07:58:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556895533; cv=none; d=google.com; s=arc-20160816; b=EI7ttUbM6quMrsN5N1jGJd2bnP0wfm3eTv0JPkEDJa18iZFGUfbwe0VsawO9tcS7Pl kp4fNzr99pjIgS77HzZ5xdcLqaSmRjJ+veXwybzCA6wzhr8IayzpKj2UT3i/xnoO4rTG OoLGEt6IjSlbd6fjNFSHDgU+PXBnzPjhG8gQolkIpS0iupef52s9N3mGN024r0UbJBPc 6AAKrEHGbBTKyLEE7pejg+IJoarer/jS2nHN4SbmrlK4HPGJKF2K88woGjIQWM/9ci5r 8B4iNbmVWG4LpR4F+GJA8LEuPZpvZKH4I32vevLpShdCyiDpu4eAhsZ9FV5EtUiqq98H r5ZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=mE/iywC3wQkDgN11LE1EJNH0DkIl60cGK1y/+CH4QeA=; b=K9YS8NI78VIVXhi+52tY1zlU0ljc8e1o0dGTVXaOBAhwQ4FMiT8TsYmFInYsN/s+ZV U1F1NX17xjSp6msjHknCDOLYjQf/uhBgQeuB6ryCU8hSAxhC9wnXxxDRYVRwWV+qzOdo l+hXEsByJaSJgoxw+DT/B0sd9R0GD+zKHu3dub3SVZ4Floy65hvhT6TM95Y4jr5lp0Z+ fAmiz0Hz76G2A9qe77OF9Q4pPOd2BM145dg/7IbZNcEXrk2OZQ2L6h3NgQdFVwtSPc7S xZeO9FpHT4O49X9cC0uAzEZauYyS4pted2kjtNaTp0SfK7VFIfI9hFe+/61e08oe8z7n v6zA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i1si2303785pfa.61.2019.05.03.07.58.38; Fri, 03 May 2019 07:58:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728165AbfECO42 (ORCPT + 99 others); Fri, 3 May 2019 10:56:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:36250 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726992AbfECO42 (ORCPT ); Fri, 3 May 2019 10:56:28 -0400 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A040D2070B; Fri, 3 May 2019 14:56:27 +0000 (UTC) Date: Fri, 3 May 2019 10:56:26 -0400 From: Steven Rostedt To: Tzvetomir Stoyanov Cc: linux-trace-devel@vger.kernel.org, linux-kernel@vger.kernel.org, tom.zanussi@linux.intel.com Subject: Re: [PATCH] Documentation/trace: Add clarification how histogram onmatch works Message-ID: <20190503105626.453d32c4@gandalf.local.home> In-Reply-To: <20190503143537.19752-1-tstoyanov@vmware.com> References: <20190503143537.19752-1-tstoyanov@vmware.com> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 3 May 2019 17:35:37 +0300 Tzvetomir Stoyanov wrote: > The current trace documentation, the section describing histogram's "onmatch" > is not straightforward enough about how this action is applied. It is not > clear what criteria are used to "match" both events. A short note is added, > describing what exactly is compared in order to match the events. Hi Tzvetomir, Thanks for sending this. Some minor tweaks below. > > Signed-off-by: Tzvetomir Stoyanov > --- > Documentation/trace/histogram.txt | 11 +++++++---- > 1 file changed, 7 insertions(+), 4 deletions(-) > > diff --git a/Documentation/trace/histogram.txt b/Documentation/trace/histogram.txt > index 7ffea6aa22e3..b75a75cfab8c 100644 > --- a/Documentation/trace/histogram.txt > +++ b/Documentation/trace/histogram.txt > @@ -1863,7 +1863,10 @@ hist trigger specification. > > The 'matching.event' specification is simply the fully qualified > event name of the event that matches the target event for the > - onmatch() functionality, in the form 'system.event_name'. > + onmatch() functionality, in the form 'system.event_name'. Histogram > + keys of both events are compared to find if events match. In case > + multiple histogram keys are used, they all must match in the specified > + order. I would reword that to be: In the case that multiple histogram keys are used, both events must have the same number of keys, and the keys must match in the same order. > > Finally, the number and type of variables/fields in the 'param > list' must match the number and types of the fields in the > @@ -1920,9 +1923,9 @@ hist trigger specification. > /sys/kernel/debug/tracing/events/sched/sched_waking/trigger > > Then, when the corresponding thread is actually scheduled onto the > - CPU by a sched_switch event, calculate the latency and use that > - along with another variable and an event field to generate a > - wakeup_latency synthetic event: > + CPU by a sched_switch event (saved_pid matches next_pid), calculate CPU by a sched_switch event (where the sched_waking key "saved_pid" matches the sched_switch key "next_pid"), Other than that, looks good. Could you send a v2 with the updates? Thanks! -- Steve > + the latency and use that along with another variable and an event field > + to generate a wakeup_latency synthetic event: > > # echo 'hist:keys=next_pid:wakeup_lat=common_timestamp.usecs-$ts0:\ > onmatch(sched.sched_waking).wakeup_latency($wakeup_lat,\