Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3334984imm; Sun, 17 Jun 2018 17:18:36 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIjwg8Cd9GjZ2Sr+qW3QogjzBqbJOhCHTPgVhJp5YcC6w0e2B5S7lVh6QocOfLbREJ5LSgl X-Received: by 2002:a63:5401:: with SMTP id i1-v6mr8952053pgb.187.1529281116670; Sun, 17 Jun 2018 17:18:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529281116; cv=none; d=google.com; s=arc-20160816; b=n8b/GiXEa0LG7MIMkpEe/R93PAim/RpmX+dEKNF7aEJxUcY/8Ou9xX0qG4yxuRhqzH ZKXGGC3Y4oROfG2qFZyE9ePbyUlnXXihdEmxXeN18idFF632TxiIr7AS8ccU52LBG+TC Olf82yxqDrRZnQ0ltdr26fxkgoF/uBLcZZtloeRerrwLVAFYREOcuWnhOO5DuD80WLlz x4uSsdiEC4CrbiRLuPNGRnAqANFJk+IHA3hLWfbzZ9MnYUsQYFb++h5uNdMR99/s2+vb XlK1X/v8zXnhsmaTYysFiwOC/Qfh4q7A3XWyePLGEboMBc6nUbNS+nZe8iGKgk31wsFh 3tIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=+3Yy088ci3nAjW4MeMftDns+Is1kiImcM22W5nU1ro8=; b=HMcOrXy3hAHQJnUNsePzu9vJBm/yZgEprAgwAxrhrFlpnMLtyaMCBDZp7GKDndmIWp CQv+69IS9pY9K93WSKAk114GmD/c9QnGhwDwSKCPT/PnQQm8moTx92wq2Eul87z6uPKS MI5weV/nVSC0F2Jj//itN9990QtBheXsWNVC7MFqddQSnWCaVRvtBDQmTE9dtKhPyhcc 9zKFxII6phjclVHnOwwAwjVDHXNqiJ1BRpkTZQorzkwfiP4KCqDEaeBAvnsKVXV+fsGJ ZCmCvPR4vcFJtLxntP5NTEdFlhRMbcXlHBD/q4rv2WW+DBlHn5B/rj2sHpOhnSRbSYDJ 5Rcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=KdP+3fDI; 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 b24-v6si13315426pfl.223.2018.06.17.17.18.09; Sun, 17 Jun 2018 17:18:36 -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; dkim=pass header.i=@joelfernandes.org header.s=google header.b=KdP+3fDI; 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 S1754497AbeFRAPt (ORCPT + 99 others); Sun, 17 Jun 2018 20:15:49 -0400 Received: from mail-pl0-f66.google.com ([209.85.160.66]:36677 "EHLO mail-pl0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754411AbeFRAPr (ORCPT ); Sun, 17 Jun 2018 20:15:47 -0400 Received: by mail-pl0-f66.google.com with SMTP id a7-v6so8044487plp.3 for ; Sun, 17 Jun 2018 17:15:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=+3Yy088ci3nAjW4MeMftDns+Is1kiImcM22W5nU1ro8=; b=KdP+3fDISridbzOMLlpQjBGP6BsuzRZXcpbFAtJq/rkjoiUbtAL6bgQuEywSE+Seda vQs4UYNGee1OTXdlIMquz3oLdCwxUg3ggItdeBLWtDtPwtFg99wSYBJdrggyTcyQab+X HhbVD47aC1MUEidttIBp/J79ZSacLs70RdagI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=+3Yy088ci3nAjW4MeMftDns+Is1kiImcM22W5nU1ro8=; b=I7rT418EforiRK9TS7J7H/drsrFIo2ABv6B8lei56Jdz91/wzs4MDbTDRlS5QiQ2z5 dxpmGyT+yX2KwEVlQy2vgAEEglfZDv/KANczHUjwUyDRDLRiCMRI8nlGcbKq5LM0w106 BFyOM8KjgdBdPd0bvdHqCtVkkb8trzj/9qYOGx4gZogql3lhZ7HkoZhBpHxWmK7JFRTF t04u5cexdKiFmWZBo5SEXqEI8AxXbcNDwIfTpAcCvqqta5tD4cQK7DpzRz8r9avVqSyF +Oy1R2sHO7D1y1goLR4vBbjqm1qZMeCRUt2AtjIXippdvxGK0+NyHCU6ciC7WAnaELwH XmQg== X-Gm-Message-State: APt69E0mHx1apkMD+KpDvck/94xG+E06mDkqN0J9IX4yaFEVuyqOadu/ dppAjhMlgEonpnmDoq0DH/OAuA== X-Received: by 2002:a17:902:4424:: with SMTP id k33-v6mr11683418pld.242.1529280946886; Sun, 17 Jun 2018 17:15:46 -0700 (PDT) Received: from localhost ([2620:0:1000:1600:3122:ea9c:d178:eb]) by smtp.gmail.com with ESMTPSA id j15-v6sm28571400pfk.40.2018.06.17.17.15.45 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 17 Jun 2018 17:15:45 -0700 (PDT) Date: Sun, 17 Jun 2018 17:15:45 -0700 From: Joel Fernandes To: Masami Hiramatsu Cc: Joel Fernandes , linux-kernel@vger.kernel.org, kernel-team@android.com, Ingo Molnar , Steven Rostedt , tglx@linutronix.de, namhyung@kernel.org, mathieu.desnoyers@efficios.com, linux-rt-users@vger.kernel.org, Tom Zanussi , peterz@infradead.org Subject: Re: [PATCH RFC] tracing: Call triggers only if event passes filter checks Message-ID: <20180618001545.GA187086@joelaf.mtv.corp.google.com> References: <20180615010113.127718-1-joel@joelfernandes.org> <20180616224329.02e37ef4aee72c7d5685818e@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180616224329.02e37ef4aee72c7d5685818e@kernel.org> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jun 16, 2018 at 10:43:29PM +0900, Masami Hiramatsu wrote: > On Thu, 14 Jun 2018 18:01:13 -0700 > Joel Fernandes wrote: > > > From: "Joel Fernandes (Google)" > > > > Currently, trace event triggers are called regardless of if the event > > filter checks pass or fail. Thus if one were to enable event triggers > > and filters at the same time, then the triggers will always be called > > even if the filter checks didn't pass. > > > > This is a problem for a usecase I was experimenting with: measuring the > > time preemption is disabled using synthetic events and dump the stack > > using the stacktrace trigger if the total preempt off time was greater > > than a threshold. Following are the commands for the same: > > > > Create synthetic event: > > > > echo 'preemptdisable u64 lat' >> \ > > /sys/kernel/debug/tracing/synthetic_events > > > > echo 'hist:keys=cpu:ts0=common_timestamp.usecs:scpu=cpu' >> \ > > /sys/kernel/debug/tracing/events/preemptirq/preempt_disable/trigger > > > > echo 'hist:keys=cpu:wakeup_lat=common_timestamp.usecs-$ts0:\ > > onmatch(preemptirq.preempt_disable).preemptdisable($wakeup_lat)' >> \ > > /sys/kernel/debug/tracing/events/preemptirq/preempt_enable/trigger > > > > Enable synthetic event: > > > > echo stacktrace > /sys/kernel/debug/tracing/events/synthetic/preemptdisable/trigger > > echo 'lat > 400' > /sys/kernel/debug/tracing/events/synthetic/preemptdisable/filter > > Have you tried if statement as below? > > echo "stacktrace if lat > 400" > /sys/kernel/debug/tracing/events/synthetic/preemptdisable/trigger > Yes I tried this and it works, thanks! Steven also suggested the same thing in his reply as well. thanks, - Joel