Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3640976imm; Mon, 18 Jun 2018 01:22:30 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLgmvXc6m+35lUAdcUL2YaSkr4irWSSqr+J5AEY1TsXV+e3QgjZULILYL8/vHlgRxFPT2Xb X-Received: by 2002:a17:902:7e42:: with SMTP id a2-v6mr12898512pln.151.1529310150450; Mon, 18 Jun 2018 01:22:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529310150; cv=none; d=google.com; s=arc-20160816; b=LhCOswL0c9OplCQ0q3lrqdaSu7/hG59DKUfsECvfg7r8ptQdaubt99qruBbhpiyUw3 UlItjAu3ucTRhAp/cavNDleURO3ICPqo0ehSuEfqaI6GJDTQ4ziRi+cVv968/eSM4Q0g bZMpGQiUrY5cW7ipAVO0+0Ac1N+a/uSSWtSyqTlrlklB/sHr7lCdpMpBH8npaZLD6fvw z1ldXE+mjAU78hQEYJxjqeV4RFO3P6oLQ+neuw0IzTHb9AcjDWHtONHoyICEM1HVc8EZ jn7jfUtAt0S/XIXtwsHgIPSej/a70D9wQ8fyx1NRkfEg35bZYBicMum8W2jmyk64/Wxb VM3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=Wh5A8JhsChyT9FYJiMJeR/RqzYDdQv3+CRtpo6lWhFY=; b=UQOKKiiGwVPkB2A/I0huer3jgtnLhcGsUIB89eGdvyWG2EZznUw7XTvvzIxdFvvjnT 9/EMNkXk27g9JeW0cGGR4aW2z7VLjKLpD5Q4QIzuIys0FtFIFpKyscnhtAjTkjWI7ZRS 1PChJapQLbtJ25YyAdrnhbjeJGdd4tllimoTPDk7BMYi7k+n78NWj4J/VOwY0W8LuuRO q0qrVd2M0z+p8Krlekdny1GztJJAdyRkarWwMc+ns9JHQKeG9jvUmRoE246nDH0oBwSw FEQuk4Q+Upxs0p8z0XZAU+UcGXn+WB3TvuR0ZsklMECTYdsgA9IRLfFitW8xDbv0uY+0 UD+A== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g7-v6si11885659pgu.152.2018.06.18.01.22.16; Mon, 18 Jun 2018 01:22:30 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935810AbeFRIV1 (ORCPT + 99 others); Mon, 18 Jun 2018 04:21:27 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:55288 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935804AbeFRIVV (ORCPT ); Mon, 18 Jun 2018 04:21:21 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id AF5CDC7F; Mon, 18 Jun 2018 08:21:20 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tom Zanussi , Masami Hiramatsu , "Steven Rostedt (VMware)" , Sasha Levin Subject: [PATCH 4.16 098/279] selftests: ftrace: Add a testcase for multiple actions on trigger Date: Mon, 18 Jun 2018 10:11:23 +0200 Message-Id: <20180618080612.856154463@linuxfoundation.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180618080608.851973560@linuxfoundation.org> References: <20180618080608.851973560@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.16-stable review patch. If anyone has any objections, please let me know. ------------------ From: Masami Hiramatsu [ Upstream commit 25aa50e0ca397a5e5d4d6fcecefa8107877d1dd0 ] Add a testcase for multiple actions with different parameters on an event trigger, which has been fixed by commit 192c283e93bd ("tracing: Add action comparisons when testing matching hist triggers"). Link: http://lkml.kernel.org/r/152292055227.15769.6327959816123227152.stgit@devbox Reviewed-by: Tom Zanussi Tested-by: Tom Zanussi Signed-off-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (VMware) Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-multi-actions-accept.tc | 44 ++++++++++ 1 file changed, 44 insertions(+) create mode 100644 tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-multi-actions-accept.tc --- /dev/null +++ b/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-multi-actions-accept.tc @@ -0,0 +1,44 @@ +#!/bin/sh +# description: event trigger - test multiple actions on hist trigger + + +do_reset() { + reset_trigger + echo > set_event + clear_trace +} + +fail() { #msg + do_reset + 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 + +clear_synthetic_events +reset_tracer +do_reset + +echo "Test multiple actions on hist trigger" +echo 'wakeup_latency u64 lat; pid_t pid' >> synthetic_events +TRIGGER1=events/sched/sched_wakeup/trigger +TRIGGER2=events/sched/sched_switch/trigger + +echo 'hist:keys=pid:ts0=common_timestamp.usecs if comm=="cyclictest"' > $TRIGGER1 +echo 'hist:keys=next_pid:wakeup_lat=common_timestamp.usecs-$ts0 if next_comm=="cyclictest"' >> $TRIGGER2 +echo 'hist:keys=next_pid:onmatch(sched.sched_wakeup).wakeup_latency(sched.sched_switch.$wakeup_lat,next_pid) if next_comm=="cyclictest"' >> $TRIGGER2 +echo 'hist:keys=next_pid:onmatch(sched.sched_wakeup).wakeup_latency(sched.sched_switch.$wakeup_lat,prev_pid) if next_comm=="cyclictest"' >> $TRIGGER2 +echo 'hist:keys=next_pid if next_comm=="cyclictest"' >> $TRIGGER2 + +do_reset + +exit 0