Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp732804imu; Wed, 16 Jan 2019 06:46:20 -0800 (PST) X-Google-Smtp-Source: ALg8bN7k+p0moEIpwLmChVRJKGOw/pkW7YBvQDBIJ8X71Zr12Kcq5PYwp7m8K/dJB3lmJWW1PkRT X-Received: by 2002:a17:902:d697:: with SMTP id v23mr10092959ply.261.1547649979980; Wed, 16 Jan 2019 06:46:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547649979; cv=none; d=google.com; s=arc-20160816; b=d3aW2+8OxhFcZjvI1FjTGonxZvKN0QAuCrs/uNQCW6mMNMJKaw7xPhbv5FzedzpvJM yZIMG/IjPi/DHIkwHk/uKqZRsG3x43YOJ0rmr3+q98DVan5KS9ZXRAYemgLqvW9BTcZI PTdhoZ3mWpMeVfleH5fPLMCzBAajWMGh4D14cXxxEsP2vtG/h9FJRr0+ZHHGsaoa0h4o Su2N1nsE/Bj/JqjhKY2ZR4pLcmC4wz24s3p5JQPxNX3HvmYWS08LiHHXwAd7w7BaFkzz icqT3ePEZHSA3fiL5fGxPRiM2qMQ+mDEMKPeYn6ZB/Zpcm/PSPdircvUDl7ywSFJSLPc 0IBg== 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=EuswfqV5UfOkkfv0HX2PntEmVFw5NFq5IS8lUpzE4AY=; b=g/WLENR0YSJFY1j+YsdINKLwRA9muJj/hyNviadbS7jaXLKVL9KQmtSI7iVWE09XX/ iILaF8Fd0Mp8ovULdl3QQgWUHurILEuk1aNDIKtv6clHCRVo2Z8R5WFt7HFINsa/m302 HiiopoAXZWY5+mvS82X/05bOiOWpGPI+PcVESaxIfNq5sTzIDQZ/kJy5T7hEjOLcKmKG 7WcDKeYTw+rkCkz37dsT6e/dqkNO5lPKcimsn9g3Y+FzbW2TZCsXHY1zbs09UeJMk7HP 2GafXbENJV/76rzy/W2Wzzjqy9mfe2DliVOZmYzBagAPrsDg3aa8WaZDTfFcDukj1xWp WblA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=i9UxPZ7v; 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 j17si6779109pfd.113.2019.01.16.06.46.01; Wed, 16 Jan 2019 06:46:19 -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=i9UxPZ7v; 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 S2391059AbfAOWGr (ORCPT + 99 others); Tue, 15 Jan 2019 17:06:47 -0500 Received: from mail.kernel.org ([198.145.29.99]:49558 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391020AbfAOWGf (ORCPT ); Tue, 15 Jan 2019 17:06:35 -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 CDC6C217D4; Tue, 15 Jan 2019 22:06:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1547589994; bh=ZrMDhspZRqsHQCgIRprU3Q2jciZ8eMIG6Ar+7cGmCjc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:In-Reply-To: References:From; b=i9UxPZ7vl+6jwkn1BXVjLfe2r15L+gYmbZhByxXJBf1oYeNcbSBAg/J/HVvPRkmd+ YhuPhsPY7ezg6+YCcwwx9O1hpCRIFyd5CUpUdvF5hL1LIM9fWhu5VSnMY+dqSnIJin yJnLdbq0puBjXdL0FYj7nL8v+h8EqUGC6b8k+Hak= 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 15/16] tracing: Add alternative synthetic event trace action test case Date: Tue, 15 Jan 2019 16:05:59 -0600 Message-Id: <3f7d5cc63500a8fd9aafc784a039ad55235528d8.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 for the alternative trace( --- .../inter-event/trigger-trace-action-hist.tc | 42 ++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-trace-action-hist.tc diff --git a/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-trace-action-hist.tc b/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-trace-action-hist.tc new file mode 100644 index 000000000000..8021d60aafec --- /dev/null +++ b/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-trace-action-hist.tc @@ -0,0 +1,42 @@ +#!/bin/sh +# SPDX-License-Identifier: GPL-2.0 +# description: event trigger - test inter-event histogram trigger trace action + +fail() { #msg + echo $1 + exit_fail +} + +if [ ! -f set_event ]; then + echo "event tracing is not supported" + exit_unsupported +fi + +if [ ! -f synthetic_events ]; then + echo "synthetic event is not supported" + exit_unsupported +fi + +grep -q "trace(" README || exit_unsupported # version issue + +echo "Test create synthetic event" + +echo 'wakeup_latency u64 lat pid_t pid char comm[16]' > synthetic_events +if [ ! -d events/synthetic/wakeup_latency ]; then + fail "Failed to create wakeup_latency synthetic event" +fi + +echo "Test create histogram for synthetic event using trace action" +echo "Test histogram variables,simple expression support and trace action" + +echo 'hist:keys=pid:ts0=common_timestamp.usecs if comm=="ping"' > events/sched/sched_wakeup/trigger +echo 'hist:keys=next_pid:wakeup_lat=common_timestamp.usecs-$ts0:onmatch(sched.sched_wakeup).trace(wakeup_latency,$wakeup_lat,next_pid,next_comm) if next_comm=="ping"' > events/sched/sched_switch/trigger +echo 'hist:keys=comm,pid,lat:wakeup_lat=lat:sort=lat' > events/synthetic/wakeup_latency/trigger + +ping $LOCALHOST -c 5 + +if ! grep -q "ping" events/synthetic/wakeup_latency/hist; then + fail "Failed to create trace action inter-event histogram" +fi + +exit 0 -- 2.14.1