Received: by 10.213.65.68 with SMTP id h4csp104489imn; Thu, 5 Apr 2018 18:54:35 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/6uDHDujnj0nht3SptHyc+9ITnK4vtunuFW48/uNSHoC+mUVPkLmzQg2CKLXZvfXAHe3ZE X-Received: by 10.98.78.21 with SMTP id c21mr18969986pfb.107.1522979675483; Thu, 05 Apr 2018 18:54:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522979675; cv=none; d=google.com; s=arc-20160816; b=lPjtvupaaCiejqahlp5OOuIAO/2i14FP4Tj+sAfr9U9ExbiKSRKIwnV3Aao9/6Bym4 xsxDMQiGSWLO5eVgy/HoRJk7Z6HvhUjVLXhXZosy7USCwhhVCAzhMuDQstAAyF0UogPd XkrWSWVM72QICad8gCamTIPb/MBgk/mgWUPlb1bj7wtOZEEAYQeTgh+voqBjGynsxfxM 0Xw9uzhMWRzZWrmxz6vM/BOegW0Z5WTUtTQi+P7hiXXCs3uxvXwtKS/6J2vCHi172cd5 T5toPQNurKOcSlZ5Jms1jlZY1lbgK4jVXcc6BgWScEA60c+nzZ77Z6x/VYEt+XZmNoKg 4jag== 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=MWSFSDRVdYF1ungoGN33+Gt/PUCVoUrE9gco8T9Lbos=; b=M2VwvtACt6ODQGJu3xKnHfExHezAUbs7Ywkj+GDOUEWfWd90e32qA75f0YWTHwVLju Nd74Xc6rkZj+jSOLI3a8cl026/HdcDZyR4LC8NqWBp4kW0KfDAlev+uMcwKX/BpzhW1g o8PRUS0xZ6WTZAIjosbxeMRiTyw2arwmVNH6gfBtK9VqY29KxSCfA7qkr8osUwrsESCh 8eBAcsqP6GIFde3PwouanJCFGGor3pRbJdOzdwIN/ct5W9lhBapQfuHQDdzfwCwkGeeQ oWsD+//6YoknZ6dOMvysT0QEHqZwnR+Sms4h/ytdqX/ESIqNfwq/o1Qt+Z1LNCiKr8VN NqIA== 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 t16si7103777pfj.10.2018.04.05.18.54.21; Thu, 05 Apr 2018 18:54:35 -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 S1751387AbeDFBxP (ORCPT + 99 others); Thu, 5 Apr 2018 21:53:15 -0400 Received: from mail.kernel.org ([198.145.29.99]:36314 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751275AbeDFBxO (ORCPT ); Thu, 5 Apr 2018 21:53:14 -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 7BE6C217CE; Fri, 6 Apr 2018 01:53:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7BE6C217CE 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: Fri, 6 Apr 2018 10:53:09 +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: <20180406105309.b50ea1a21d2cbd9b0e39dbfd@kernel.org> In-Reply-To: <1522971253.32118.47.camel@tzanussi-mobl.amr.corp.intel.com> References: <20180403001025.6dfed9403d50d20104e54458@kernel.org> <1522688973.3254.8.camel@tzanussi-mobl.amr.corp.intel.com> <20180404213338.5bcd14994d8e0142b5bfefc6@kernel.org> <1522855023.32118.14.camel@tzanussi-mobl.amr.corp.intel.com> <20180405125016.6460a0ab372061ecf49f471a@kernel.org> <1522971253.32118.47.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 Thu, 05 Apr 2018 18:34:13 -0500 Tom Zanussi wrote: > Hi Masami, > > On Thu, 2018-04-05 at 12:50 +0900, Masami Hiramatsu wrote: > > [...] > > > Can you print out the error with which event we should see? e.g. > > > > ERROR: Variable already defined at sched_wakeup: ts0 > > > > How about printing the event name along with the last command, for any > error? : > > ERROR: Variable already defined: ts0 > Last command: [sched:sched_wakeup] keys=pid:ts0=common_timestamp.usecs if comm=="cyclictest" Hmm, is the Last command shows the last command on sched_wakeup ? or sched_switch?? [...] > Before: > > # 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:ts0=common_timestamp.usecs if comm=="cyclictest"' >> /sys/kernel/debug/tracing/events/sched/sched_switch/trigger > > And other commands making us think we cleared everything out so the > below error is a surprise > > # echo 'hist:keys=pid:ts0=common_timestamp.usecs if comm=="cyclictest"' >> /sys/kernel/debug/tracing/events/sched/sched_wakeup/trigger > -su: echo: write error: Invalid argument No, my senario is different. Your senario tries 1) define ts0 on sched_wakeup 2) remove ts0 from sched_switch (but silently failed) 3) re-define ts0 on sched_wakeup and get an error In this case, user can dump sched_wakeup/trigger and see there is already ts0 defined. My senario is a bit different 1) define ts0 on sched_wakeup 2) remove ts0 from sched_switch (but silently failed) 3) re-define ts0 on *sched_switch* and get an error The 3rd operation failed on "sched_switch" not on "sched_wakeup". In this case we will totally lost where the ts0 defined. That's why I have asked you to show "where the ts0 is defined" at error line. Anyway, I think it is a good chance to introduce /error_log file, since we have too many non-critical errors on operations. I feel that checking hist file by errors on trigger file is not a bit intuitive. # cat /sys/kernel/debug/tracing/error_log ERROR(events/sched/sched_switch/trigger): Variable already defined: ts0@sched:sched_wakeup Command: keys=pid:ts0=common_timestamp.usecs if comm=="cyclictest" This can be used from probe events too :) e.g. ERROR(kprobe_events): Unsupported type: uint8 Command: p vfs_read arg1=%di:uint8 Any thought? Thank you, -- Masami Hiramatsu