Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp732930imu; Wed, 16 Jan 2019 06:46:27 -0800 (PST) X-Google-Smtp-Source: ALg8bN7oqNzquv0SdT5EjST5FTkr1+289svpnY5yuR9BFTEhY5EA0pYdpl/qQz8zp93C4JBe8b+J X-Received: by 2002:a62:5fc4:: with SMTP id t187mr10277382pfb.66.1547649987596; Wed, 16 Jan 2019 06:46:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547649987; cv=none; d=google.com; s=arc-20160816; b=BuAi5khdGtx4P8a+Jh4b7PY/s5FLCip4UoOAEseeSRhjECv1YsVmgME5WfpCN/Ll24 2Sp6q20c+uBjiZCHybjJS/GqjxImG9rdf+G3okX1KgMS4QJ+T0YCGG7TY3T5MkkWF7As 5uYPWFYRQkcpe/I67wPLc0u2WB1roImQuFy0BW/hZ/bZghHhHCePvAXnvROpDnU/vmXK Wo2GENjtPdtFv4qodkOqhOzRYq+asZjXHhUVG9BOCwSfC0NIALCcEwlEUa+ghAkoOA6o yz1XzTmUp4XtSmLaMVD2VcPVVkw43qwmdSTIeIPiaW7zBCLEXBxJnoaJ+25tB3iFV74Z cEYg== 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=5C3RB2wWobqDHll4T3kLlvsxGawSCIGYOFVuEW/Z8LA=; b=E2+htxO3HZUCQ8cGnvXHANgZMb+rAp236qsKBqRi1LWEEy8XsbKnnvagb6nn7CoF05 PzgvSDhu9ByTR4NxwELVw50Gf3ecq7B/gIwo/W0EgD/vIDO9hz5tQVGdaVp3ct4g5oEl aNm1fEPsRSxBcLCvOojupX7bra24M9WhVrJAj3UwLf6do612C8l5lqYwq1MA0C+Abl3x XEYBNoKD1Uus53q42/su6wSqUlBkG4UEMAnTDBAn+uutinn04LE+/wIwk8lMo4QRmAQG Kx04El3ohSdhxDckAuIbmmOwu0FjXqHTNqMGHCBHkBTF+3opzjlhn+fst2yZ5772muAq bvJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=feYLM+Tq; 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 g1si6353830pgu.149.2019.01.16.06.46.11; Wed, 16 Jan 2019 06:46:27 -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=feYLM+Tq; 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 S2391030AbfAOWGg (ORCPT + 99 others); Tue, 15 Jan 2019 17:06:36 -0500 Received: from mail.kernel.org ([198.145.29.99]:49518 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391004AbfAOWGd (ORCPT ); Tue, 15 Jan 2019 17:06:33 -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 295D6217D6; Tue, 15 Jan 2019 22:06:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1547589993; bh=69H0Rau91m0BDUFzzGTW9uHGU5es4EwEUvCRAAl6Q70=; h=From:To:Cc:Subject:Date:In-Reply-To:References:In-Reply-To: References:From; b=feYLM+Tqnbw/FXupWLUFikBFDNFEcKs436QJCAv8c2SBIpDgAHSpd5ibb4DJIw9Wp pEx1S5eDJAwEnAHhW0Q5jZoH0s5vKdjJvWlycSwohrny0g5roETU24KcB1PwPtuZpG AgFz1CfCJ/L9ibV4Yrotr/yYV1LTGgnB/h+MYp84= 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 14/16] tracing: Add hist trigger onchange() handler test case Date: Tue, 15 Jan 2019 16:05:58 -0600 Message-Id: <0bbfefb52520ab1591c27059f7f9519dae60be3b.1547589128.git.tom.zanussi@linux.intel.com> 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 Add a test case verifying the basic functionality of the hist:onchange($var) handler. Signed-off-by: Tom Zanussi Acked-by: Masami Hiramatsu --- .../inter-event/trigger-onchange-action-hist.tc | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-onchange-action-hist.tc diff --git a/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-onchange-action-hist.tc b/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-onchange-action-hist.tc new file mode 100644 index 000000000000..064a284e4e75 --- /dev/null +++ b/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-onchange-action-hist.tc @@ -0,0 +1,28 @@ +#!/bin/sh +# SPDX-License-Identifier: GPL-2.0 +# description: event trigger - test inter-event histogram trigger onchange action + +fail() { #msg + echo $1 + exit_fail +} + +if [ ! -f set_event ]; then + echo "event tracing is not supported" + exit_unsupported +fi + +grep -q "onchange(var)" README || exit_unsupported # version issue + +echo "Test onchange action" + +echo 'hist:keys=comm:newprio=prio:onchange($newprio).save(comm,prio) if comm=="ping"' >> /sys/kernel/debug/tracing/events/sched/sched_waking/trigger + +ping $LOCALHOST -c 3 +nice -n 1 ping $LOCALHOST -c 3 + +if ! grep -q "changed:" events/sched/sched_waking/hist; then + fail "Failed to create onchange action inter-event histogram" +fi + +exit 0 -- 2.14.1