Received: by 10.213.65.68 with SMTP id h4csp680452imn; Wed, 4 Apr 2018 05:35:03 -0700 (PDT) X-Google-Smtp-Source: AIpwx49+R1+cXE9bcpGcuDq6mlir7hsHp36FOfqyEPSa9YIPiKX4BPn7P3aNYAbZlZBllwNS+aIP X-Received: by 2002:a17:902:529:: with SMTP id 38-v6mr18684556plf.64.1522845303704; Wed, 04 Apr 2018 05:35:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522845303; cv=none; d=google.com; s=arc-20160816; b=LWO2tUjFuh0HkLG2IyIx01pwwEg1DWwwVAbYboIxC9rRwKEuR9qA6k1W2gzNtLr5sB 2EXhlcm2/6Hm12s45L5LX530uDplNv5L0QXa8b2zXQ7pNJselSxWCWEirmcazYK03lxW Z+Tk30+vml83xwmLJAfP2ta8hdlxWSt1T14x7w3yqWt4j/SoDpGPrY/f+ZMpwTpDUTzY FWM+lRaBDpWY+biOEfh558hereTl30F/R+5owrTaeyZ/3j5JZiVI+jDHQPbwF2tVEdm2 k2UktFSRiwfK/AzPgs3GFfL7EQrBn/i4iru2r7BCUN5OdN1tVeWOE8JCDVM3036B6c+K XYiA== 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 :references:in-reply-to:message-id:subject:cc:to:from:date :dmarc-filter:arc-authentication-results; bh=mgD9T+lJKufoiNVPhR21PXmS4T1/UyqfvKxTaPowTR0=; b=YXfc7axmUDLhHVW/aov+7e9MC9UM6W8kMxk/00p/iNxN1KTqm9lGzZUJqtA8u6kJQ/ fG+ogbNQ0aSVedkj/6g9D0FLxe69c7pcxJPvcudtg8LKLa9NmEsJW7JXbpuyXqs0XsUK tuX2u9hbWj7milTrivfDLDd8oXIiuPJtUESD/cYaEOKjbGaApjzbnbhp3I7V8oFCbKDD lDuq5J9An1rngGmveRS8PHm0g87gCYwXsXvAJTP3o0GjuExYWDJopiqH5YPnRHrz2QeK o3lzYrMADCA2W1a56B7VOzT6XXlyVB2GPyhqYqWDX3eEZ44alO45XdxVK2UxJg0QsV0x vXpA== 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 h6-v6si2784441pll.726.2018.04.04.05.34.49; Wed, 04 Apr 2018 05:35:03 -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 S1751249AbeDDMdo (ORCPT + 99 others); Wed, 4 Apr 2018 08:33:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:59490 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750915AbeDDMdn (ORCPT ); Wed, 4 Apr 2018 08:33:43 -0400 Received: from devbox (NE2965lan1.rev.em-net.ne.jp [210.141.244.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id AFB5121834; Wed, 4 Apr 2018 12:33:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AFB5121834 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=mhiramat@kernel.org Date: Wed, 4 Apr 2018 21:33:38 +0900 From: Masami Hiramatsu To: Tom Zanussi Cc: rostedt@goodmis.org, tglx@linutronix.de, namhyung@kernel.org, vedang.patel@intel.com, bigeasy@linutronix.de, joel.opensrc@gmail.com, joelaf@google.com, mathieu.desnoyers@efficios.com, baohong.liu@intel.com, rajvi.jingar@intel.com, julia@ni.com, fengguang.wu@intel.com, linux-kernel@vger.kernel.org, linux-rt-users@vger.kernel.org Subject: Re: [PATCH 3/4] tracing: Add action comparisons when testing matching hist triggers Message-Id: <20180404213338.5bcd14994d8e0142b5bfefc6@kernel.org> In-Reply-To: <1522688973.3254.8.camel@tzanussi-mobl.amr.corp.intel.com> References: <20180403001025.6dfed9403d50d20104e54458@kernel.org> <1522688973.3254.8.camel@tzanussi-mobl.amr.corp.intel.com> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Tom, On Mon, 02 Apr 2018 12:09:33 -0500 Tom Zanussi wrote: > after: > > # echo 'wakeup_latency u64 lat; pid_t pid' >> /sys/kernel/debug/tracing/synthetic_events > # echo 'hist:keys=pid:ts0=common_timestamp.usecs if comm=="cyclictest"' >> /sys/kernel/debug/tracing/events/sched/sched_wakeup/trigger > # echo 'hist:keys=next_pid:wakeup_lat=common_timestamp.usecs-$ts0 if next_comm=="cyclictest"' >> /sys/kernel/debug/tracing/events/sched/sched_switch/trigger > # echo 'hist:keys=next_pid:onmatch(sched.sched_wakeup).wakeup_latency(sched.sched_switch.$wakeup_lat,next_pid) if next_comm=="cyclictest"' >> /sys/kernel/debug/tracing/events/sched/sched_switch/trigger > # echo 'hist:keys=next_pid:onmatch(sched.sched_wakeup).wakeup_latency(sched.sched_switch.$wakeup_lat,prev_pid) if next_comm=="cyclictest"' >> /sys/kernel/debug/tracing/events/sched/sched_switch/trigger > # echo 'hist:keys=next_pid if next_comm=="cyclictest"' >> /sys/kernel/debug/tracing/events/sched/sched_switch/trigger I ensured this sequence has no problem. After above sequence, the trigger file shows ====== # cat events/sched/sched_switch/trigger hist:keys=next_pid:vals=hitcount:wakeup_lat=common_timestamp.usecs-$ts0:sort=hitcount:size=2048:clock=global if next_comm=="cyclictest" [active] hist:keys=next_pid:vals=hitcount:sort=hitcount:size=2048:onmatch(sched.sched_wakeup).wakeup_latency(sched.sched_switch.$wakeup_lat,next_pid) if next_comm=="cyclictest" [active] hist:keys=next_pid:vals=hitcount:sort=hitcount:size=2048:onmatch(sched.sched_wakeup).wakeup_latency(sched.sched_switch.$wakeup_lat,prev_pid) if next_comm=="cyclictest" [active] hist:keys=next_pid:vals=hitcount:sort=hitcount:size=2048 if next_comm=="cyclictest" [active] ====== So I clear the last one ====== # echo '!hist:keys=next_pid if next_comm=="cyclictest"' >> events/sched/sched_switch/trigger # ====== OK, it should be removed. I can not see it anymore on the trigger file. ====== # cat events/sched/sched_switch/trigger hist:keys=next_pid:vals=hitcount:wakeup_lat=common_timestamp.usecs-$ts0:sort=hitcount:size=2048:clock=global if next_comm=="cyclictest" [active] hist:keys=next_pid:vals=hitcount:sort=hitcount:size=2048:onmatch(sched.sched_wakeup).wakeup_latency(sched.sched_switch.$wakeup_lat,next_pid) if next_comm=="cyclictest" [active] hist:keys=next_pid:vals=hitcount:sort=hitcount:size=2048:onmatch(sched.sched_wakeup).wakeup_latency(sched.sched_switch.$wakeup_lat,prev_pid) if next_comm=="cyclictest" [active] ====== But when I missed to remove it again, it is accepted (is not an error?) ====== # echo '!hist:keys=next_pid if next_comm=="cyclictest"' >> events/sched/sched_switch/trigger # ====== Hmm... anyway, let's clear others too. ====== # echo '!hist:keys=next_pid:onmatch(sched.sched_wakeup).wakeup_latency(sched.sched_switch.$wakeup_lat,next_pid) if next_comm=="cyclictest"' >> events/sched/sched_switch/trigger # echo '!hist:keys=next_pid:onmatch(sched.sched_wakeup).wakeup_latency(sched.sched_switch.$wakeup_lat,prev_pid) if next_comm=="cyclictest"' >> events/sched/sched_switch/trigger # cat events/sched/sched_switch/trigger # Available triggers: # traceon traceoff snapshot stacktrace enable_event disable_event enable_hist disable_hist hist ====== OK, it is cleared now. Now I test it again. ====== # echo 'hist:keys=pid:ts0=common_timestamp.usecs if comm=="cyclictest"' >> events/sched/sched_wakeup/trigger sh: write error: Invalid argument ====== Oops, what's the error? ====== # cat events/sched/sched_switch/hist ERROR: Variable already defined: ts0 Last command: keys=pid:ts0=common_timestamp.usecs if comm=="cyclictest" ====== Hmm, how can I undef ts0 and test it again? If I can not clean it, the testcase must fail on the 2nd time. Thank you, -- Masami Hiramatsu