Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp672856imu; Wed, 16 Jan 2019 05:50:15 -0800 (PST) X-Google-Smtp-Source: ALg8bN4XpuwS3yMdOjwLxwBpjTZ7TXgPw5cbMyGysVQ7DC5oMhYkGutmrqh2aQwXCXTE4YMvPmbD X-Received: by 2002:a17:902:fa2:: with SMTP id 31mr10014231plz.75.1547646615868; Wed, 16 Jan 2019 05:50:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547646615; cv=none; d=google.com; s=arc-20160816; b=NNI/wt+Ye9mNtQnwlZBrj8DmgETkVdsjurnbmM75aXT+H9cVweCLZKqPE9/ZGNog6W I7RMrVXjPgI6/KWBEYLhT3BnI8BthXyK/ECMokREK5xhM4Zgp8u0TfwCyPa/JQjuZzV5 rHpC/r9MFguohE7VzPrIq/aNo2oiDveJUHYvzLQ+n0YztJza0JpG1d4Ub/p2lldhAd+3 taoQlQNm818ReAMREEJT7xlV3MXi+Jy7Gwrd6lKB4FstgZPYRSnxFKIyNQx/zdnIOcC2 KQpKhEJGCIOFeotNygBqjIKlFmAA5OQcBzHMJWA5f0E2zR9NVnuCqTdy6QcX5JRuKTcN 5iHA== 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=X+QCWsh+VxtrtKRT9ncV4/MBcPV3tk/RP8Ncu2rrUEk=; b=ewSe2S8ICBRFCPP7oAyp0BREPzKm5Rvp3Ru4soxc+kZPsd1AdBvSB+e8bbx9cCO3bq kux3ixgwQ5r80RPjKcNFtoNxOMlXCytEVqZlLLPBOAkGPXr6FzRIjr/uFY8TtY1sGZxE gg/3x9u23fqMSA+MsZkO1NvgoJttVEVk9zPBnFgQgRCOSlgyb8aKEqXDbzIRrgwbSbTr 2bbwqcmblYazir7eSbTDZakCRv+gmm7RzNvvbh52Mvlo81BSjrEWR2Uf6MS8hPt9octn O1EjmyUXQ3BwqTov8ES8VSZ90u6HQCvLXVviuu1lDftcb8lo4bXk4QB4kSXVx/Yl/EvZ msIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=RL3IM+vA; 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 c7si1209353plz.118.2019.01.16.05.49.57; Wed, 16 Jan 2019 05:50:15 -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=RL3IM+vA; 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 S2391016AbfAOWGe (ORCPT + 99 others); Tue, 15 Jan 2019 17:06:34 -0500 Received: from mail.kernel.org ([198.145.29.99]:49500 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390981AbfAOWGc (ORCPT ); Tue, 15 Jan 2019 17:06:32 -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 6ED83217D9; Tue, 15 Jan 2019 22:06:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1547589991; bh=alDVXvG/kmHoahAYIoLfxDroKlCCKLYWMSwwYVnO8k4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:In-Reply-To: References:From; b=RL3IM+vAs0hovAqnrP9xXGrHciNo/r8v/fT3SaQnctPivssN3/5999d26b/QVUwHd KomkLRvceX/+gakWg2BeLGBTTCMyXhmDX/WP4q4fDqvefkBI1IPAX8ue40WMV2K/aZ J3y/usX3gdlRKQGDzhZhmKOCLEgRJ+XNZTEwCBOI= 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 13/16] tracing: Add hist trigger snapshot() action test case Date: Tue, 15 Jan 2019 16:05:57 -0600 Message-Id: <4942b3857d1146f7549931cf08f840627c64c77a.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:snapshot() action. Signed-off-by: Tom Zanussi Acked-by: Masami Hiramatsu --- .../inter-event/trigger-snapshot-action-hist.tc | 43 ++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-snapshot-action-hist.tc diff --git a/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-snapshot-action-hist.tc b/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-snapshot-action-hist.tc new file mode 100644 index 000000000000..18fff69fc433 --- /dev/null +++ b/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-snapshot-action-hist.tc @@ -0,0 +1,43 @@ +#!/bin/sh +# SPDX-License-Identifier: GPL-2.0 +# description: event trigger - test inter-event histogram trigger snapshot action + +fail() { #msg + echo $1 + exit_fail +} + +if [ ! -f set_event ]; then + echo "event tracing is not supported" + exit_unsupported +fi + +if [ ! -f snapshot ]; then + echo "snapshot is not supported" + exit_unsupported +fi + +grep -q "onchange(var)" README || exit_unsupported # version issue + +grep -q "snapshot()" README || exit_unsupported # version issue + +echo "Test snapshot action" + +echo 1 > /sys/kernel/debug/tracing/events/sched/enable + +echo 'hist:keys=comm:newprio=prio:onchange($newprio).save(comm,prio):onchange($newprio).snapshot() if comm=="ping"' >> /sys/kernel/debug/tracing/events/sched/sched_waking/trigger + +ping $LOCALHOST -c 3 +nice -n 1 ping $LOCALHOST -c 3 + +echo 0 > tracing_on + +if ! grep -q "changed:" events/sched/sched_waking/hist; then + fail "Failed to create onchange action inter-event histogram" +fi + +if ! grep -q "comm=ping" snapshot; then + fail "Failed to create snapshot action inter-event histogram" +fi + +exit 0 -- 2.14.1