Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp756695imu; Wed, 16 Jan 2019 07:08:21 -0800 (PST) X-Google-Smtp-Source: ALg8bN5m/x0QVz3QezPYCrPWueszlkWMIlA5En7OzMJ+yS2ELP7xyCZ28anHE7+AeB+yE+UYcyVY X-Received: by 2002:a63:db48:: with SMTP id x8mr8939213pgi.365.1547651301747; Wed, 16 Jan 2019 07:08:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547651301; cv=none; d=google.com; s=arc-20160816; b=Qpk1qZBvpqvZ2S6i60kpa/Hg7TySoC35jiG9pGdS2Lss0+vPlhyTKnE8qwFzs0N91m mdJFVb7FUeXmsATnEHCqzkoGpfhAnqhOxfSua02eR/n+i31JyWi7NSb5HvsI1zsiEd5V f7a/RoDlndWJSuH40Yv3ufR66zs9Chr15eDYQiEcoCanSH9qrh3PBVvHNJ5x/SmDJYPj CedvWofkaDJubRcXDvehwYDl0fibEMnCcRm3NyJ9o5dXLgbZwLw6FqT5owpsA0sjnXKE 6m8y42Jx5ci4wIl0BoNq2H91Ve0wOThEUqI7XcjRXjVlR/AHCsWTZfVlM66/7f1HQAPG 506A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=h30Y6teUh6r4yHy1m6sJGetuO32i90D0kJ3r/rkUt6g=; b=inHHl5NqdexHdFbhuEp934/o11wzf4sm/oljUvjxv6Gq8Pl85CDtfoqVOANksy601q DqzWA/0nlW9aduOlkKzr7qq3RU5scSoZdZt+JCt3ttrZEpD7DkQAzRJXdba/1Wjsqiog LcZ+rZmviiSnP69+UtE3bNlJDMjnf0XHrjXkd79WxDUHiLdFd27gKqm0Vx8In9wB1xFG r/MzrV6pQhfupgL3P7tqNGG/l/8Jiinjh52d/pa2OsiGMlXlm2didI/X7rYVVSIQqZ4B OrJCbpdVi+pFBSSEvQAW7f3fXtbubq7X6t2h6gyB7cecWCZtW1n6w2cjgYnztIxTGTrZ 6kaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="RaIKW/9l"; 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 189si6547978pfd.142.2019.01.16.07.07.52; Wed, 16 Jan 2019 07:08:21 -0800 (PST) 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="RaIKW/9l"; 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 S2391114AbfAOWHn (ORCPT + 99 others); Tue, 15 Jan 2019 17:07:43 -0500 Received: from mail.kernel.org ([198.145.29.99]:49152 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390882AbfAOWGN (ORCPT ); Tue, 15 Jan 2019 17:06:13 -0500 Received: from localhost.localdomain (c-98-220-238-81.hsd1.il.comcast.net [98.220.238.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 68F0A2133D; Tue, 15 Jan 2019 22:06:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1547589973; bh=OsA0utCZfyYV9YNN6vd8kJm4nnE+IBKjN6Og11Sj9lQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:In-Reply-To: References:From; b=RaIKW/9lkE3E332lqNyarbcBVPP0eK8K15qBrPgPPMGLDTY64iFLV17qMAsCP9GKO Af64NoPBFCAgyLzTZrxV0M7c7RUD0rWdl7sbn2BQ+arEH3tYs5Hml5IBk7AVyHd36+ WNs5dzh39fUmQDujgOcqXIVnJq/p9CQ3aU/n4YBU= From: Tom Zanussi To: rostedt@goodmis.org Cc: tglx@linutronix.de, mhiramat@kernel.org, namhyung@kernel.org, vedang.patel@intel.com, bigeasy@linutronix.de, joel@joelfernandes.org, mathieu.desnoyers@efficios.com, julia@ni.com, linux-kernel@vger.kernel.org, linux-rt-users@vger.kernel.org Subject: [PATCH v12 03/16] tracing: Make hist trigger Documentation better reflect actions/handlers Date: Tue, 15 Jan 2019 16:05:47 -0600 Message-Id: X-Mailer: git-send-email 2.14.1 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Tom Zanussi The action/handler code refactoring didn't change the action/handler syntax, but did generalize it - the Documentation should reflect that. Signed-off-by: Tom Zanussi --- Documentation/trace/histogram.rst | 56 ++++++++++++++++++++++++++++++--------- 1 file changed, 43 insertions(+), 13 deletions(-) diff --git a/Documentation/trace/histogram.rst b/Documentation/trace/histogram.rst index 7dda76503127..63e522107e59 100644 --- a/Documentation/trace/histogram.rst +++ b/Documentation/trace/histogram.rst @@ -25,7 +25,7 @@ Documentation written by Tom Zanussi hist:keys=[:values=] [:sort=][:size=#entries][:pause][:continue] - [:clear][:name=histname1] [if ] + [:clear][:name=histname1][:.] [if ] When a matching event is hit, an entry is added to a hash table using the key(s) and value(s) named. Keys and values correspond to @@ -1831,21 +1831,51 @@ and looks and behaves just like any other event:: Like any other event, once a histogram is enabled for the event, the output can be displayed by reading the event's 'hist' file. -2.2.3 Hist trigger 'actions' ----------------------------- +2.2.3 Hist trigger 'handlers' and 'actions' +------------------------------------------- -A hist trigger 'action' is a function that's executed whenever a -histogram entry is added or updated. +A hist trigger 'action' is a function that's executed (in most cases +conditionally) whenever a histogram entry is added or updated. -The default 'action' if no special function is explicitly specified is -as it always has been, to simply update the set of values associated -with an entry. Some applications, however, may want to perform -additional actions at that point, such as generate another event, or -compare and save a maximum. +When a histogram entry is added or updated, a hist trigger 'handler' +is what decides whether the corresponding action is actually invoked +or not. -The following additional actions are available. To specify an action -for a given event, simply specify the action between colons in the -hist trigger specification. +Hist trigger handlers and actions are paired together in the general +form: + + . + +To specify a handler.action pair for a given event, simply specify +that handler.action pair between colons in the hist trigger +specification. + +In theory, any handler can be combined with any action, but in +practice, not every handler.action combination is currently supported; +if a given handler.action combination isn't supported, the hist +trigger will fail with -EINVAL; + +The default 'handler.action' if none is explicity specified is as it +always has been, to simply update the set of values associated with an +entry. Some applications, however, may want to perform additional +actions at that point, such as generate another event, or compare and +save a maximum. + +The supported handlers and actions are listed below, and each is +described in more detail in the following paragraphs, in the context +of descriptions of some common and useful handler.action combinations. + +The available handlers are: + + - onmatch(matching.event) - invoke action on any addition or update + - onmax(var) - invoke action if var exceeds current max + +The available actions are: + + - (param list) - generate synthetic event + - save(field,...) - save current event fields + +The following commonly-used handler.action pairs are available: - onmatch(matching.event).(param list) -- 2.14.1