Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1771639imm; Sat, 16 Jun 2018 02:49:02 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIaoF317WXjbganYK34e1sFeO5QHhSKZHO0B9dCkUQoMvyj7bwbU/v3XC4SSP5uBQokA6t6 X-Received: by 2002:a63:3c4c:: with SMTP id i12-v6mr4717479pgn.309.1529142541982; Sat, 16 Jun 2018 02:49:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529142541; cv=none; d=google.com; s=arc-20160816; b=dGqa2kcV7pPB+ExlnUp+3c1f4XbzH1V6T6gvo0SLynPpgUO7ylHs+EZCd2RIbrh4QH H2BrnKInGINi+pE0aVw/ggxyHhv8/T/4gzqJ2w7uOdQzNmyuSJhngwUtVZ6YlWTTVxzu +sxeBuV+SBym1hOLYur6JM+QHDTpAknjMYWETLxPGi0z16+/Ts84TzzLppRWbpOQ7N2I BuiCqBAltwqXqsJQqDYLAXSRRmD6SfO6ILtRATjqDxefFybaNZuT4kDFF26DTwQWkc1J 1ktKZYyTo4eYbUA41xGS1SgbTYazzOEMG7beNKduZ9yQ5b/FY1bA5C1DSqKhLMJVEK3y BYjw== 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 :dkim-signature:arc-authentication-results; bh=g4E8a0ZRHw+UqpGItKO3hmQ2K95HHhibGeWeNP3+uDU=; b=L16qAr9a8k6fHVwmRGVvnAwBC13R0F6h/bfQ2/5frxfo6aJWWBM0GD95K4LWVRuuTR Gw2g4Hk75yiS6X46UNPyJzl9MGbu+J/qQDug0uGsko0Nwj1V+dQN7ushf2zK1KInV8WC NCGqoJzPfchMi8ozvu6/3+l5RHhyr+VLIRsVH7dUfDTaIBhuOUteXjh9LncZWiFHJpmV CJoJDc3xCZ3n/Y7y0xNIbP0eniussecgeZosZisDKCpsfuYJhKZGM2pes1BQ8Mn1CAEY rpeeqcwTloF45/VUEdjY1tGEqwr2jooBQcXjKhDF98Ptg1qw97OBFXEl37AMLolYJ+j/ 4yDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ulj86c9s; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l21-v6si10275644pfk.321.2018.06.16.02.48.47; Sat, 16 Jun 2018 02:49:01 -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; dkim=pass header.i=@kernel.org header.s=default header.b=ulj86c9s; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932746AbeFPJsT (ORCPT + 99 others); Sat, 16 Jun 2018 05:48:19 -0400 Received: from mail.kernel.org ([198.145.29.99]:37978 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932358AbeFPJsR (ORCPT ); Sat, 16 Jun 2018 05:48:17 -0400 Received: from devbox (NE2965lan1.rev.em-net.ne.jp [210.141.244.193]) (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 822AE2087E; Sat, 16 Jun 2018 09:48:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1529142496; bh=NzOA5MW67GY5PIUEdyhRQ/ZCNWwmC8v1oFQ5nMCALTg=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=ulj86c9sUDvDF6bYxkctFCsxGQz5v8BbKYisNZMnkVh3ePxOYhtHo2QuJ99bYi/2g 5zZcNexZd1pVV2CcAF2JEL4azz0JkdvP39I/b+6kes2hOmO1d9Xr4aVGQeP8XKB3pf 5RbGN7jafMViRJKE47Fqhrf0rwWNxwfpffO7lGvQ= Date: Sat, 16 Jun 2018 18:48:12 +0900 From: Masami Hiramatsu To: Joel Fernandes Cc: linux-kernel@vger.kernel.org, kernel-team@android.com, "Joel Fernandes (Google)" , Changbin Du , Ingo Molnar , Jonathan Corbet , linux-doc@vger.kernel.org, Steven Rostedt , Tom Zanussi , bigeasy@linutronix.de, mhiramat@kernel.org, tglx@linutronix.de, namhyung@kernel.org, vedang.patel@intel.com, mathieu.desnoyers@efficios.com, julia@ni.com, linux-rt-users@vger.kernel.org Subject: Re: [PATCH] tracing: Fix some errors in histogram documentation Message-Id: <20180616184812.ad77980a00483a761e315c27@kernel.org> In-Reply-To: <20180614224859.55864-1-joel@joelfernandes.org> References: <20180614224859.55864-1-joel@joelfernandes.org> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-redhat-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 Thu, 14 Jun 2018 15:48:59 -0700 Joel Fernandes wrote: > From: "Joel Fernandes (Google)" > > Fix typos, inconsistencies in using quotes, incorrect section number, > etc. in the trace histogram documentation. Looks good to me. Reviewed-by: Masami Hiramatsu Thanks! > > Signed-off-by: Joel Fernandes (Google) > --- > Documentation/trace/histogram.txt | 23 ++++++++++++----------- > 1 file changed, 12 insertions(+), 11 deletions(-) > > diff --git a/Documentation/trace/histogram.txt b/Documentation/trace/histogram.txt > index 6e05510afc28..da955cd696f6 100644 > --- a/Documentation/trace/histogram.txt > +++ b/Documentation/trace/histogram.txt > @@ -1730,35 +1730,35 @@ If a variable isn't a key variable or prefixed with 'vals=', the > associated event field will be saved in a variable but won't be summed > as a value: > > - # echo 'hist:keys=next_pid:ts1=common_timestamp ... >> event/trigger > + # echo 'hist:keys=next_pid:ts1=common_timestamp ...' >> event/trigger > > Multiple variables can be assigned at the same time. The below would > result in both ts0 and b being created as variables, with both > common_timestamp and field1 additionally being summed as values: > > - # echo 'hist:keys=pid:vals=$ts0,$b:ts0=common_timestamp,b=field1 ... >> \ > + # echo 'hist:keys=pid:vals=$ts0,$b:ts0=common_timestamp,b=field1 ...' >> \ > event/trigger > > Note that variable assignments can appear either preceding or > following their use. The command below behaves identically to the > command above: > > - # echo 'hist:keys=pid:ts0=common_timestamp,b=field1:vals=$ts0,$b ... >> \ > + # echo 'hist:keys=pid:ts0=common_timestamp,b=field1:vals=$ts0,$b ...' >> \ > event/trigger > > Any number of variables not bound to a 'vals=' prefix can also be > assigned by simply separating them with colons. Below is the same > thing but without the values being summed in the histogram: > > - # echo 'hist:keys=pid:ts0=common_timestamp:b=field1 ... >> event/trigger > + # echo 'hist:keys=pid:ts0=common_timestamp:b=field1 ...' >> event/trigger > > Variables set as above can be referenced and used in expressions on > another event. > > For example, here's how a latency can be calculated: > > - # echo 'hist:keys=pid,prio:ts0=common_timestamp ... >> event1/trigger > - # echo 'hist:keys=next_pid:wakeup_lat=common_timestamp-$ts0 ... >> event2/trigger > + # echo 'hist:keys=pid,prio:ts0=common_timestamp ...' >> event1/trigger > + # echo 'hist:keys=next_pid:wakeup_lat=common_timestamp-$ts0 ...' >> event2/trigger > > In the first line above, the event's timetamp is saved into the > variable ts0. In the next line, ts0 is subtracted from the second > @@ -1767,7 +1767,7 @@ yet another variable, 'wakeup_lat'. The hist trigger below in turn > makes use of the wakeup_lat variable to compute a combined latency > using the same key and variable from yet another event: > > - # echo 'hist:key=pid:wakeupswitch_lat=$wakeup_lat+$switchtime_lat ... >> event3/trigger > + # echo 'hist:key=pid:wakeupswitch_lat=$wakeup_lat+$switchtime_lat ...' >> event3/trigger > > 2.2.2 Synthetic Events > ---------------------- > @@ -1808,10 +1808,11 @@ the command that defined it with a '!': > At this point, there isn't yet an actual 'wakeup_latency' event > instantiated in the event subsytem - for this to happen, a 'hist > trigger action' needs to be instantiated and bound to actual fields > -and variables defined on other events (see Section 6.3.3 below). > +and variables defined on other events (see Section 2.2.3 below on > +how that is done using hist trigger 'onmatch' action). Once that is > +done, the 'wakeup_latency' synthetic event instance is created. > > -Once that is done, an event instance is created, and a histogram can > -be defined using it: > +A histogram can now be defined for the new synthetic event: > > # echo 'hist:keys=pid,prio,lat.log2:sort=pid,lat' >> \ > /sys/kernel/debug/tracing/events/synthetic/wakeup_latency/trigger > @@ -1961,7 +1962,7 @@ hist trigger specification. > back to that pid, the timestamp difference is calculated. If the > resulting latency, stored in wakeup_lat, exceeds the current > maximum latency, the values specified in the save() fields are > - recoreded: > + recorded: > > # echo 'hist:keys=pid:ts0=common_timestamp.usecs \ > if comm=="cyclictest"' >> \ > -- > 2.18.0.rc1.242.g61856ae69a-goog > -- Masami Hiramatsu