Received: by 10.213.65.68 with SMTP id h4csp2587749imn; Mon, 2 Apr 2018 10:11:03 -0700 (PDT) X-Google-Smtp-Source: AIpwx49LHMCYoKGA0PwOG6GYguxjK9jhdiDW24mG1OGQnVoGfrOjnGI58pHpe0dkJ73U0shByMQ3 X-Received: by 10.98.61.80 with SMTP id k77mr8046101pfa.2.1522689063022; Mon, 02 Apr 2018 10:11:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522689062; cv=none; d=google.com; s=arc-20160816; b=tq4ReydoumU9zaAU6NtLAj0EaWxdvcWUDmBINPvAABXnsycdAVhgFLGGdNpDmClAWo Ya39KIqTudOWHyuQtC53wS7hl3sjzNcoe2J6Wdu8VpB6gbcwWo7TgY03iEg02IAJaFd4 v6zxe2cgewXzeoWS46Dio0L0DCIrIXmog25AjIJhitKToT0eW9sLbOhbF4zlHdke9nsc zA55KFRkUL8TsHb7Pcp0QEI4xZ0i0Z6Ea4o7afwYK2qCUoQU+TPGsMB8Vzy+PCikl4HB 6Am3byBx0JELU4ScdS+2jDWqeGX5RWl7hG+gOnSyuMcEC3eH94DxIayA7yGBWb8QmAQb ypiQ== 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:date:cc:to:from:subject:message-id :arc-authentication-results; bh=SqjXLTM48i6KuF6VnjN5xIKMist9ycYHOhPfEK3IX4I=; b=l0a4vJrM+MFtgqJBzZlvK0WSDZFB/uvxoDkp8rIJN0In3QvdOghXwJ4q/BqwnJ1m2A aXTS0fAOc6Pmo5mgCKUruuWP0z2ghvhjct9bYP+qZXPZIt7Odpv7iEv8hqdyPSiMhPQJ ePMRf0Hga4ecN15V9Pn2ozmZqXaOqzzo7vK7bM3PzHbG9c13VePUVsBHSFPPuKQx3p3M ULAMTIVIqW56p0LUBHZMwFXFJwimNGVayjjFJ2pxZBxGkd3ZA7GOWh3z3J/evRhPmQi3 8pkBKso7cC3gH3/15dlNPXRsnil6LASnR/s+bW5RwbXPBczfGkYCq6rhP5XttGI69/fQ uE4w== 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 b34-v6si722891pld.249.2018.04.02.10.10.47; Mon, 02 Apr 2018 10:11:02 -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 S1753057AbeDBRJm (ORCPT + 99 others); Mon, 2 Apr 2018 13:09:42 -0400 Received: from mga07.intel.com ([134.134.136.100]:57661 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751647AbeDBRJk (ORCPT ); Mon, 2 Apr 2018 13:09:40 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Apr 2018 10:09:35 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,396,1517904000"; d="scan'208";a="40124085" Received: from tzanussi-mobl.amr.corp.intel.com (HELO [10.254.102.88]) ([10.254.102.88]) by orsmga003.jf.intel.com with ESMTP; 02 Apr 2018 10:09:34 -0700 Message-ID: <1522688973.3254.8.camel@tzanussi-mobl.amr.corp.intel.com> Subject: Re: [PATCH 3/4] tracing: Add action comparisons when testing matching hist triggers From: Tom Zanussi To: Masami Hiramatsu 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 Date: Mon, 02 Apr 2018 12:09:33 -0500 In-Reply-To: <20180403001025.6dfed9403d50d20104e54458@kernel.org> References: <20180403001025.6dfed9403d50d20104e54458@kernel.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.10.4 (3.10.4-4.fc20) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Masami, On Tue, 2018-04-03 at 00:10 +0900, Masami Hiramatsu wrote: > On Wed, 28 Mar 2018 15:10:55 -0500 > Tom Zanussi wrote: > > > Actions also need to be considered when checking for matching triggers > > - triggers differing only by action should be allowed, but currently > > aren't because the matching check ignores the action and erroneously > > returns -EEXIST. > > Hi Tom, > > Could you show us the bad/good examples (maybe different onmatch() actions)? > And if it is real bugfix, I would like to add a ftracetest testcase for this fix. > Here's an example using onmatch() actions. The first -EEXIST shouldn't occur because the onmatch() is different in the second wakeup_latency() param. The second -EEXIST shouldn't occur because it's a different action (in this case, it doesn't have an action, so shouldn't be seen as being the same and therefore rejected). In the after case, both are correctly accepted (and trying to add one of them again returns -EEXIST as it should). before: # 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 -su: echo: write error: File exists # echo 'hist:keys=next_pid if next_comm=="cyclictest"' >> /sys/kernel/debug/tracing/events/sched/sched_switch/trigger -su: echo: write error: File exists 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 Thanks, Tom