Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3835493yba; Tue, 7 May 2019 07:51:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqx49Xjrg3vcOuEVUQF/KAo1Evz1Kx0oH0WspNaOVXkK92FDVsNSSor2AucwXJ51IlTGtJkO X-Received: by 2002:a17:902:4a0c:: with SMTP id w12mr41152647pld.52.1557240664809; Tue, 07 May 2019 07:51:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557240664; cv=none; d=google.com; s=arc-20160816; b=HhAG/htYB9U2T+3qn5Qp2WBlNvD4BgI42DaMfJV6P3nTxlD1SRMP6USLCGI7F45sJb pzpcGSMy/rRB2AC9YSFUGT0ZGWEn6WtwyzOHdfr4g3wv6F5p3pJNiPVsJz2zmOKTttBF mAVpWbS0pTe/zDm0frqSZRLk8fwVYBeW50UD/yk1y8DwoTnDLssTNOnSsmyPfZz7T7im f7pqDB6behWbQwYkYIAKMlIRV3Sb5Y4DggUxI5LcMMxVxGc7f/k0Z5UT4WR+GHJTS9UM bWZZdO9FbdwIJEpcfG201MS9EzHRfwOzRljzwk7N5ixo3T4Iqa+pcla1S0j1MYJUq5qC JLMg== 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 :message-id:date:subject:cc:to:from; bh=HYpLsdPWfoBOLPoyyFo9Rla4dC8XU3P9MTPhnbUzRMo=; b=kiLVUJKZUe7V5tXLVlfdcgBpVltGcwLa6S2jfp5kSz8Kv2d4s5++bJ7J1a3CKAU1tz OvrrU0Iq/o1qYf52eNsFIUfCx+DH6s+i/8BSAjRGG14dwsZ21VG4k7eW67OkhzUgeFCG X1DxNYoq2SmEqvluL5r0WlmtHkbaV0/TKA1N3ECF2zk3+ann4h7o526h/A7dkksRPkZo xLaZjhsiZ98/Ac7XQT6ISTulxpOsv7E21IGYSxMmZXhmgdql7KwBoh2+KodlXlN+K35a GCDhUzyLH16O2iOg2vLNNK8/dynckIdP8RNu/ZHzya5u19umQelVGL9wXjAX3Q3uNsrP iAjw== 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; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=vmware.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v7si15713684pgb.40.2019.05.07.07.50.46; Tue, 07 May 2019 07:51:04 -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; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=vmware.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726571AbfEGOtu (ORCPT + 99 others); Tue, 7 May 2019 10:49:50 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:33887 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726337AbfEGOtt (ORCPT ); Tue, 7 May 2019 10:49:49 -0400 Received: by mail-wr1-f68.google.com with SMTP id f7so12451883wrq.1; Tue, 07 May 2019 07:49:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=HYpLsdPWfoBOLPoyyFo9Rla4dC8XU3P9MTPhnbUzRMo=; b=LDp9gPhD6blPTq81jKuLLCmuwocP0b66ePHxNX/ufkki53Bkb3zmQokSdfYZa3jCWS +3t6fcvTPLBn5vZLsDvxup2RKqNCXYacDGNngH0Qy7hktcYozwa3t8pXsG/fqZPFq8qn qdxQvAH2MqPrXlBFf8THiRSg1O8OzTEESmgE6sp8pXz8xbKE8gCGlTXcXmIUQ48OUr2Q cw1BT/jtODHepG39zrwBBxFJyO3Gp+837henAZBKiK26vkrDK7cSZ0gKMvB+uRD4Oblt fJlzcTkfF1OE3/VnyEGw4zj4Aybg96OEsf7qPRDrqMK5rPrx6tqXgsaVF6YU1RlcuV4e ZK7g== X-Gm-Message-State: APjAAAXAs7sXXAJXwNOh7OKAOQ1W4CZP4GyDTYaJwBsGFcdlyRj1V6Sb 47F7zKfpDI2SgX4Tv7rjQvJfZAU2 X-Received: by 2002:a5d:424a:: with SMTP id s10mr11462236wrr.327.1557240588310; Tue, 07 May 2019 07:49:48 -0700 (PDT) Received: from oberon.eng.vmware.com ([146.247.46.5]) by smtp.gmail.com with ESMTPSA id v1sm13536800wrd.47.2019.05.07.07.49.47 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 07 May 2019 07:49:47 -0700 (PDT) From: Tzvetomir Stoyanov To: rostedt@goodmis.org Cc: linux-trace-devel@vger.kernel.org, linux-kernel@vger.kernel.org, tom.zanussi@linux.intel.com Subject: [PATCH v2] Documentation/trace: Add clarification how histogram onmatch works Date: Tue, 7 May 2019 17:49:46 +0300 Message-Id: <20190507144946.7998-1-tstoyanov@vmware.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Signed-off-by: Tzvetomir Stoyanov --- Documentation/trace/histogram.txt | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Documentation/trace/histogram.txt b/Documentation/trace/histogram.txt index 7ffea6aa22e3..d97f0530a731 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 the case + 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,10 @@ 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 (where the sched_waking key "saved_pid" + matches the sched_switch key "next_pid"), calculate 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,\ -- 2.21.0